Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
63 changes: 63 additions & 0 deletions Content.Client/_DV/AACTablet/UI/AACBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using Content.Client.Chat.TypingIndicator;
using Content.Shared._DV.AACTablet;
using Content.Shared._DV.QuickPhrase;
using Content.Shared.Chat.TypingIndicator;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;

namespace Content.Client._DV.AACTablet.UI;

public sealed class AACBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private AACWindow? _window;

private static readonly ProtoId<TypingIndicatorPrototype> AACTypingIndicator = "aac";

private TypingIndicatorSystem? _typing;

public AACBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

if (_window is { Disposed: false })
_window.Close();

_window = this.CreateWindow<AACWindow>();
_window.OnClose += Close;
_window.PhraseButtonPressed += OnPhraseButtonPressed;
_window.Typing += OnTyping;
_window.SubmitPressed += OnSubmit;
}

private void OnPhraseButtonPressed(List<ProtoId<QuickPhrasePrototype>> phraseId, string prefix)
{
SendMessage(new AACTabletSendPhraseMessage(phraseId, prefix));
}

private void OnTyping()
{
_typing ??= EntMan.System<TypingIndicatorSystem>();
_typing?.ClientAlternateTyping(AACTypingIndicator);
}

private void OnSubmit()
{
_typing ??= EntMan.System<TypingIndicatorSystem>();
_typing?.ClientSubmittedChatText();
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

if (state is not AACTabletBuiState msg)
return;

_window?.Update(msg);
}
}
104 changes: 104 additions & 0 deletions Content.Client/_DV/AACTablet/UI/AACWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'aac-tablet-title'}"
Resizable="True"
SetSize="580 422"
MinSize="580 320">
<BoxContainer Orientation="Vertical">
<!-- Main Content Area -->
<BoxContainer Name="MainContent" Orientation="Vertical" VerticalExpand="True" Margin="8 8 8 4">

<!-- Top Control Bar -->
<PanelContainer StyleClasses="AacControlBar" Margin="0 0 0 8">
<BoxContainer Orientation="Vertical" Margin="8">
<!-- Buffer Toggle Row -->
<BoxContainer Orientation="Horizontal" Margin="0 0 0 6">
<CheckBox Name="ShouldBuffer"
Text="{Loc 'aac-tablet-combine'}"
StyleClasses="AacCheckbox"
Margin="0 0 8 0"/>
<Control HorizontalExpand="True"/>

<Control SetWidth="170" Margin="8 0 0 0"/>

<OptionButton Name="RadioChannels"
StyleClasses="OpenBoth"
SetWidth="120"
Margin="8 0 0 0"/>
</BoxContainer>

<!-- Buffer Display and Controls -->
<BoxContainer Orientation="Horizontal">
<PanelContainer HorizontalExpand="True" StyleClasses="AacBufferDisplay">
<LineEdit Name="BufferedString"
Editable="False"
HorizontalExpand="True"
StyleClasses="AacBufferText"
Margin="8 4"/>
</PanelContainer>
<Button Name="ClearButton"
Text="{Loc 'aac-tablet-backspace'}"
TextAlign="Center"
StyleClasses="ClearButton"
SetWidth="90"
Margin="8 0 0 0"/>

<Button Name="SendButton"
Text="{Loc 'aac-tablet-send'}"
TextAlign="Center"
StyleClasses="SendButton"
SetWidth="90"
Margin="8 0 0 0"/>
</BoxContainer>
</BoxContainer>
</PanelContainer>

<!-- Tabbed Content Area -->
<PanelContainer VerticalExpand="True" StyleClasses="AacContentArea">
<TabContainer Name="WindowBody"
TabTitle="Search"
VerticalExpand="True"
MouseFilter="Pass"
Margin="4">
<!-- Search Tab -->
<BoxContainer Orientation="Vertical" Name="Search" VerticalExpand="True">
<!-- Search Bar -->
<PanelContainer StyleClasses="AacSearchBar" Margin="4 4 4 8">
<LineEdit Name="SearchBar"
PlaceHolder="{Loc 'aac-tablet-search-placeholder'}"
HorizontalExpand="True"
StyleClasses="AacSearchInput"
Margin="8 6"/>
</PanelContainer>

<!-- Search Results -->
<ScrollContainer HorizontalExpand="True"
VerticalExpand="True"
HScrollEnabled="False"
Margin="0 -5">
<BoxContainer Name="SearchResults"
Orientation="Vertical"
HorizontalExpand="True"
Margin="0 -5"/>
</ScrollContainer>
</BoxContainer>
</TabContainer>
</PanelContainer>
</BoxContainer>

<!-- Footer -->
<BoxContainer Name="Footer" Orientation="Vertical">
<PanelContainer StyleClasses="LowDivider"/>
<BoxContainer Orientation="Horizontal" Margin="10 4 10 4" VerticalAlignment="Center">
<Label Text="{Loc 'aac-tablet-footer-hint'}"
StyleClasses="AacFooterText"
VerticalAlignment="Center"/>
<Control HorizontalExpand="True"/>
<Label Text="{Loc 'aac-tablet-footer-info'}"
StyleClasses="AacFooterText"
VerticalAlignment="Center"
Margin="0 0 8 0"/>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</controls:FancyWindow>
Loading
Loading