Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Atualização no console de comunicações #129

Merged
merged 22 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8f12ce2
Tira o acesso de manutenção dos grayti- quero dizer, assistente
AgentePanela Aug 24, 2024
82630c5
bota o botao emergency maint no console de comunicação
AgentePanela Aug 24, 2024
bb106a8
Traduz o texto de tempo restante
AgentePanela Aug 24, 2024
b1648f9
Atualiza a UI do console de comunicações e adiciona lang
AgentePanela Aug 24, 2024
cd40cfc
TENTA criar um novo estilo de menu
AgentePanela Aug 24, 2024
d858498
Arruma o botao amarelo
AgentePanela Aug 24, 2024
c0191e6
arruma pequeno texto
AgentePanela Aug 24, 2024
a15d35d
faz todas as maints comun se fecharem quando apertar o botao
AgentePanela Aug 25, 2024
8ccbfdf
Arrumas algumas coisas e prepara outras
AgentePanela Aug 25, 2024
57b1f4c
Adiciona motivo pra evacuação
AgentePanela Aug 25, 2024
ca26454
Faz o botao de enviar mensagem pra cc funcionar, reason na evac e out…
AgentePanela Aug 25, 2024
5c508bf
changelog yayy
AgentePanela Aug 25, 2024
4e0acb3
Merge branch 'rbertoche:pirata' into maint-emergency
AgentePanela Aug 25, 2024
c34deb8
Remove codigo comentado
AgentePanela Aug 25, 2024
b23e564
Merge branch 'maint-emergency' of https://github.com/AgentePanela/est…
AgentePanela Aug 25, 2024
a30295b
Update Content.Client/Communications/UI/CommunicationsConsoleBoundUse…
DoutorWhite Aug 25, 2024
6ecfbc6
Update Content.Server/Communications/CommunicationsConsoleComponent.cs
DoutorWhite Aug 25, 2024
555c5df
Update Content.Server/Communications/CommunicationsConsoleSystem.cs
DoutorWhite Aug 25, 2024
c0940b5
Update Content.Server/Communications/CommunicationsConsoleSystem.cs
DoutorWhite Aug 25, 2024
2d4c220
Update Content.Server/Communications/CommunicationsConsoleSystem.cs
DoutorWhite Aug 25, 2024
18bf97a
Update Content.Shared/Communications/SharedCommunicationsConsoleCompo…
DoutorWhite Aug 25, 2024
3263b7c
Update Content.Server/Communications/CommunicationsConsoleSystem.cs
DoutorWhite Aug 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ public void BroadcastButtonPressed(string message)
SendMessage(new CommunicationsConsoleBroadcastMessage(message));
}

public void MaintEmergencyButtonPressed(){
SendMessage(new CommunicationsConsoleToggleEmergencyMaintMessage());
}

public void CentCommButtonPressed(){
SendMessage(new CommunicationsConsoleCentCommButtonMessage());
}
DoutorWhite marked this conversation as resolved.
Show resolved Hide resolved

public void CallShuttle()
{
SendMessage(new CommunicationsConsoleCallEmergencyShuttleMessage());
Expand Down
23 changes: 19 additions & 4 deletions Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,30 @@
Title="{Loc 'comms-console-menu-title'}"
MinSize="400 225">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="5">
<TextEdit Name="MessageInput" HorizontalExpand="True" VerticalExpand="True" Margin="0 0 0 5" MinHeight="100" />
<Label Text="{Loc 'comms-console-menu-label-announcements'}" VerticalExpand="True"/>
<TextEdit Name="MessageInput" HorizontalExpand="True" VerticalExpand="True" Margin="0 0 0 5" MinHeight="75" />
<Button Name="AnnounceButton" Text="{Loc 'comms-console-menu-announcement-button'}" StyleClasses="OpenLeft" Access="Public" />
<Button Name="BroadcastButton" Text="{Loc 'comms-console-menu-broadcast-button'}" StyleClasses="OpenLeft" Access="Public" />
<Button Name="BroadcastButton" Text="{Loc 'comms-console-menu-broadcast-button'}" StyleClasses="OpenRight" Access="Public" />

<OptionButton Name="AlertLevelButton" StyleClasses="OpenRight" Access="Public" />
<Label Text="{Loc 'comms-console-menu-label-alerts'}" VerticalExpand="True"/>
<OptionButton Name="AlertLevelButton" Access="Public" />

<Control MinSize="10 10" />

<Label Text="{Loc 'comms-console-menu-label-others'}" VerticalExpand="True"/>
<Button Name="CentCommButton" Text="{Loc 'comms-console-menu-message-centcomm'}" StyleClasses="ButtonColorGreen" Access="Public" />
<Button Name="MaintEmergencyButton" Text="{Loc 'comms-console-menu-emergency-maint'}" StyleClasses="ButtonColorYellow" Access="Public" />
<!-- <Button Name="NuclearCodeButton" Text="{Loc 'comms-console-menu-nuclear-code'}" StyleClasses="ButtonColorRed" Access="Public" /> Se quiserem adicionar isso, ta ai-->
<Button Name="EmergencyShuttleButton" Text="Placeholder Text" StyleClasses="ButtonColorRed" Access="Public" />
<RichTextLabel Name="CountdownLabel" VerticalExpand="True" />
<Button Name="EmergencyShuttleButton" Text="Placeholder Text" Access="Public" />
<!-- Footer (microwave copy) - - - por algum motivo quebra o codigo
<BoxContainer Orientation="Vertical">
<PanelContainer StyleClasses="LowDivider" />
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom">
<Label Text="{Loc 'comms-console-menu-footer-left'}" StyleClasses="WindowFooterText" />
<Label Text="{Loc 'comms-console-menu-footer-right'}" StyleClasses="WindowFooterText"
HorizontalAlignment="Right" HorizontalExpand="True" Margin="0 0 5 0" />
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered" VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/>
</BoxContainer>-->
</BoxContainer>
</controls:FancyWindow>
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public CommunicationsConsoleMenu(CommunicationsConsoleBoundUserInterface owner)
};
AlertLevelButton.Disabled = !owner.AlertLevelSelectable;

MaintEmergencyButton.OnPressed += (_) => Owner.MaintEmergencyButtonPressed();

CentCommButton.OnPressed += (_) => Owner.CentCommButtonPressed();

EmergencyShuttleButton.OnPressed += (_) => Owner.EmergencyShuttleButtonPressed();
EmergencyShuttleButton.Disabled = !owner.CanCall;

Expand Down Expand Up @@ -113,7 +117,7 @@ public void UpdateCountdown()
}

EmergencyShuttleButton.Text = Loc.GetString("comms-console-menu-recall-shuttle");
CountdownLabel.SetMessage($"Time remaining\n{Owner.Countdown.ToString()}s");
CountdownLabel.SetMessage($"Tempo restante:\n{Owner.Countdown.ToString()}s");
}

public override void Close()
Expand Down
28 changes: 28 additions & 0 deletions Content.Client/Stylesheets/StyleNano.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ public sealed class StyleNano : StyleBase

public static readonly Color ButtonColorDefault = Color.FromHex("#464966");
public static readonly Color ButtonColorDefaultRed = Color.FromHex("#D43B3B");
public static readonly Color ButtonColorDefaultYellow = Color.FromHex("#9c812c");
public static readonly Color ButtonColorHovered = Color.FromHex("#575b7f");
public static readonly Color ButtonColorHoveredRed = Color.FromHex("#DF6B6B");
public static readonly Color ButtonColorHoveredYellow = Color.FromHex("#a88b4f");
public static readonly Color ButtonColorPressed = Color.FromHex("#3e6c45");
public static readonly Color ButtonColorDisabled = Color.FromHex("#30313c");

Expand Down Expand Up @@ -145,6 +147,7 @@ public sealed class StyleNano : StyleBase
//Buttons
public const string StyleClassCrossButtonRed = "CrossButtonRed";
public const string StyleClassButtonColorRed = "ButtonColorRed";
public const string StyleClassButtonColorYellow = "ButtonColorYellow";
public const string StyleClassButtonColorGreen = "ButtonColorGreen";

public static readonly Color ChatBackgroundColor = Color.FromHex("#25252ADD");
Expand Down Expand Up @@ -1176,6 +1179,13 @@ public StyleNano(IResourceCache resCache) : base(resCache)
new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorDefaultRed),
}),

new StyleRule(
new SelectorElement(typeof(MenuButton), new[] {MenuButton.StyleClassYellowTopButton}, null, new[] {Button.StylePseudoClassNormal}),
new[]
{
new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorDefaultYellow),
}),

new StyleRule(
new SelectorElement(typeof(MenuButton), null, null, new[] {Button.StylePseudoClassNormal}),
new[]
Expand Down Expand Up @@ -1204,6 +1214,13 @@ public StyleNano(IResourceCache resCache) : base(resCache)
new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorHoveredRed),
}),

new StyleRule(
new SelectorElement(typeof(MenuButton), new[] {MenuButton.StyleClassYellowTopButton}, null, new[] {Button.StylePseudoClassHover}),
new[]
{
new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorHoveredYellow),
}),

new StyleRule(
new SelectorElement(typeof(Label), new[] {MenuButton.StyleClassLabelTopButton}, null, null),
new[]
Expand Down Expand Up @@ -1463,6 +1480,17 @@ public StyleNano(IResourceCache resCache) : base(resCache)
.Prop(Control.StylePropertyModulateSelf, ButtonColorHoveredRed),
// ---

// Yellow Button ---
Element<Button>().Class("ButtonColorYellow")
.Prop(Control.StylePropertyModulateSelf, ButtonColorDefaultYellow),

Element<Button>().Class("ButtonColorYellow").Pseudo(ContainerButton.StylePseudoClassNormal)
.Prop(Control.StylePropertyModulateSelf, ButtonColorDefaultYellow),

Element<Button>().Class("ButtonColorYellow").Pseudo(ContainerButton.StylePseudoClassHover)
.Prop(Control.StylePropertyModulateSelf, ButtonColorHoveredYellow),
// ---

// Green Button ---
Element<Button>().Class("ButtonColorGreen")
.Prop(Control.StylePropertyModulateSelf, ButtonColorGoodDefault),
Expand Down
6 changes: 6 additions & 0 deletions Content.Client/UserInterface/Controls/MenuButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ public sealed class MenuButton : ContainerButton
[Dependency] private readonly IInputManager _inputManager = default!;
public const string StyleClassLabelTopButton = "topButtonLabel";
public const string StyleClassRedTopButton = "topButtonLabel";
public const string StyleClassYellowTopButton = "topButtonLabel";


private static readonly Color ColorNormal = Color.FromHex("#7b7e9e");
private static readonly Color ColorRedNormal = Color.FromHex("#FEFEFE");
private static readonly Color ColorYellowNormal = Color.FromHex("#FFFF00");
private static readonly Color ColorHovered = Color.FromHex("#9699bb");
private static readonly Color ColorRedHovered = Color.FromHex("#FFFFFF");
private static readonly Color ColorYellowHovered = Color.FromHex("#FFFF00");
private static readonly Color ColorPressed = Color.FromHex("#789B8C");

private const float VertPad = 8f;
private Color NormalColor => HasStyleClass(StyleClassRedTopButton) ? ColorRedNormal : ColorNormal;
private Color HoveredColor => HasStyleClass(StyleClassRedTopButton) ? ColorRedHovered : ColorHovered;
private Color NormalColorYellow => HasStyleClass(StyleClassYellowTopButton) ? ColorYellowNormal : NormalColorYellow;
private Color HoveredColorYellow => HasStyleClass(StyleClassYellowTopButton) ? ColorYellowHovered : ColorHovered;

private BoundKeyFunction _function;
private readonly BoxContainer _root;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ public sealed partial class CommunicationsConsoleComponent : SharedCommunication
[DataField]
public int InitialDelay = 30;

[ViewVariables]
[DataField]
public double ToggleAcessTimer = 0;

[ViewVariables]
[DataField]
public double ToggleAcessDelay = 5;
DoutorWhite marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Can call or recall the shuttle
/// </summary>
Expand Down
Loading