Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Languages update #671

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
3975678
Fix erase verb not removing chat messages in some cases (#21355)
DrSmugleaf Nov 6, 2023
2285037
Removing vulp speak as a temp fix
dvir001 Dec 1, 2023
4693f3c
Update HeadsetSystem.cs
dvir001 Dec 1, 2023
d06fe5a
Update RadioSystem.cs
dvir001 Dec 1, 2023
4ee3c4e
Update ListeningSystem.cs
dvir001 Dec 1, 2023
e66adbc
Feat/languages: Initial commit (something works now)
Mnemotechnician Dec 5, 2023
7503978
Rework everything, adding support for spoken/understood langs, as wel…
Mnemotechnician Dec 5, 2023
0a61515
Minor fixes
Mnemotechnician Dec 5, 2023
60632e2
Fix language checks in ChatSystem not accounting for language overrides
Mnemotechnician Dec 5, 2023
57ffd0d
Outdated comments
Mnemotechnician Dec 5, 2023
547a149
Oops. Missed a semicolon before pushing...
Mnemotechnician Dec 5, 2023
648ae24
Remove obsolete API
Mnemotechnician Dec 5, 2023
eefa226
Split langsys into common and server systems
Mnemotechnician Dec 6, 2023
9625489
Move stuff over to Content.Server.Language instead of Speech
Mnemotechnician Dec 6, 2023
4832df8
Added commands related to languages
Mnemotechnician Dec 7, 2023
98c8c34
Implement translators
Mnemotechnician Dec 7, 2023
f65f7e4
Remove entity system dependencies from commands, and do not listen on…
Mnemotechnician Dec 7, 2023
266c838
I spent... 30 minutes... debugging this... only to change 1 line
Mnemotechnician Dec 7, 2023
b9ce39c
New obfuscation system. Still quite broken.
Mnemotechnician Dec 7, 2023
53cc5ad
Hopefully fixed phrase obfuscation
Mnemotechnician Dec 7, 2023
40284c3
fix the damn LANGUAGE PROTOTYPES!!!!!
Mnemotechnician Dec 7, 2023
6d0b4ad
Make obfuscation different in each round
Mnemotechnician Dec 7, 2023
e714418
Merge remote-tracking branch 'newfrontiers/master' into feat/languages
Mnemotechnician Dec 7, 2023
1858182
SolCommon (And test commit)
FoxxoTrystan Dec 7, 2023
fde54d9
Language Select Command
FoxxoTrystan Dec 8, 2023
c1185e3
MORE LANGUAGES!
FoxxoTrystan Dec 8, 2023
cec0d7f
Fixes
FoxxoTrystan Dec 8, 2023
31bf9c3
Remove unused files
Mnemotechnician Dec 8, 2023
50c97e5
Rework translators in a way that *seems* to work
Mnemotechnician Dec 8, 2023
22c561a
Menu (WIP)
FoxxoTrystan Dec 9, 2023
660e512
Merge branch 'feat/languages' of https://github.com/Mnemotechnician/f…
FoxxoTrystan Dec 9, 2023
7306795
Translator File
FoxxoTrystan Dec 9, 2023
9a9a842
Some template ui code for the language switcher
Mnemotechnician Dec 9, 2023
286c025
Trystan why did you break this?..
Mnemotechnician Dec 9, 2023
889c1f1
Split LanguageSystem in partials, fix some ui things
Mnemotechnician Dec 9, 2023
1570cc2
New UI controller for the language menu action
Mnemotechnician Dec 9, 2023
eacfcc6
SCIENCE!
FoxxoTrystan Dec 9, 2023
844559e
Merge branch 'feat/languages' of https://github.com/Mnemotechnician/f…
FoxxoTrystan Dec 9, 2023
4e0fdda
Language update event
Mnemotechnician Dec 9, 2023
c7ac216
Moved stuff to more relevant packages
Mnemotechnician Dec 9, 2023
f7be705
First implementatiton of translator implanters
Mnemotechnician Dec 9, 2023
a16d9e5
Oops. Quick fix
Mnemotechnician Dec 9, 2023
c385f09
Update vending_machines.yml
FoxxoTrystan Dec 9, 2023
d736fcb
Merge branch 'feat/languages' of https://github.com/Mnemotechnician/f…
FoxxoTrystan Dec 9, 2023
3c1057c
Finished Science / Translators
FoxxoTrystan Dec 9, 2023
e4e6e1d
Gives (Mostly) all NPC LangaugeSpeaker Component
FoxxoTrystan Dec 10, 2023
51edfe9
CodeSpeak
FoxxoTrystan Dec 10, 2023
c11be22
Fix and finish implanters
Mnemotechnician Dec 10, 2023
5d9b40a
Rename translator data fields
Mnemotechnician Dec 10, 2023
6e5d9fa
Implemented visuals
Mnemotechnician Dec 10, 2023
f3d527b
Add missing stuff to the components
Mnemotechnician Dec 10, 2023
1b2f57e
Woring Language Menu
FoxxoTrystan Dec 11, 2023
76ae4cb
Update LanguageMenuWindow.xaml.cs
FoxxoTrystan Dec 11, 2023
72156ea
Merge remote-tracking branch 'upstream/master' into pr/671
FoxxoTrystan Dec 11, 2023
4272d8b
Broken mess, just to show, please dont use it AAA
FoxxoTrystan Dec 11, 2023
574f459
Added language names and descriptions.
Mnemotechnician Dec 11, 2023
5474fc5
Merge remote-tracking branch 'origin/feat/languages' into feat/languages
Mnemotechnician Dec 11, 2023
45dde77
Fix what I just did
Mnemotechnician Dec 11, 2023
3fefa62
Send LanguagesUpdateEvent upon successful implantation
Mnemotechnician Dec 11, 2023
70d450e
Language menu improvements
Mnemotechnician Dec 11, 2023
5fc308f
Made "make sentient" and cognizine give out a LanguageSpeakerComponent
Mnemotechnician Dec 11, 2023
1b583cc
UI Nightmare
FoxxoTrystan Dec 11, 2023
d28fe81
Merge branch 'feat/languages' of https://github.com/Mnemotechnician/f…
FoxxoTrystan Dec 11, 2023
926fd49
Update guardian.yml
FoxxoTrystan Dec 11, 2023
c2af6eb
Actually finished the language menu
Mnemotechnician Dec 11, 2023
bcac627
Translator Uses Power, KINDA...
FoxxoTrystan Dec 12, 2023
c1c0368
Update languages.ftl
FoxxoTrystan Dec 12, 2023
edd14b6
Merge branch 'feat/languages' of https://github.com/Mnemotechnician/f…
FoxxoTrystan Dec 12, 2023
271a24d
Contravand CodeSpeak / Fixes
FoxxoTrystan Dec 12, 2023
991dc0c
Fixes... again.
FoxxoTrystan Dec 12, 2023
1c2632d
Hmm Drawrate fix
FoxxoTrystan Dec 12, 2023
8f48707
Change the default language window size and margins
Mnemotechnician Dec 12, 2023
149cd28
Refactor some yml files
Mnemotechnician Dec 12, 2023
646a2a9
Fixed translator implant appearence
Mnemotechnician Dec 12, 2023
73a7e15
Oops
Mnemotechnician Dec 12, 2023
573cbe5
Finish Translator Power.
FoxxoTrystan Dec 12, 2023
78854ec
Linter HAPPY!
FoxxoTrystan Dec 12, 2023
e98e663
Update Translator Sprite.
FoxxoTrystan Dec 12, 2023
42078ca
Update languages.ftl
FoxxoTrystan Dec 12, 2023
782c766
Update languages.ftl
FoxxoTrystan Dec 12, 2023
49ee4b2
Adds Moffic Language
FoxxoTrystan Dec 13, 2023
5464483
Update translator_implants.yml
FoxxoTrystan Dec 13, 2023
e8d4ce5
Added frontier comments
Mnemotechnician Dec 13, 2023
81a8087
Revert "Update translator_implants.yml"
FoxxoTrystan Dec 13, 2023
893ca83
Merge branch 'feat/languages' of https://github.com/Mnemotechnician/f…
FoxxoTrystan Dec 13, 2023
6fad295
Missed a couple changes with my previous commit.
Mnemotechnician Dec 13, 2023
731f3ee
Minor refactor
Mnemotechnician Dec 14, 2023
5c4eff7
Pets can now understand GalacticCommon
FoxxoTrystan Dec 18, 2023
1f2aa4c
Merge branch 'feat/languages' of https://github.com/Mnemotechnician/f…
FoxxoTrystan Dec 18, 2023
3514e54
Merge remote-tracking branch 'upstream/master' into pr/671
FoxxoTrystan Dec 18, 2023
a8b91ea
Merge remote-tracking branch 'upstream/master' into pr/671
FoxxoTrystan Dec 24, 2023
0094be3
Merge remote-tracking branch 'upstream/master' into pr/671
FoxxoTrystan Dec 30, 2023
216159f
Shuffle files around
Mnemotechnician Jan 7, 2024
b7a5f90
Delete refrences to the long gone hardcoded vulp language
Mnemotechnician Jan 7, 2024
d6c88f7
Move the ui controller as well
Mnemotechnician Jan 7, 2024
c9ace81
Merge remote-tracking branch 'upstream/master' into pr/671
FoxxoTrystan Jan 8, 2024
5052677
Merge remote-tracking branch 'newfrontiers/master' into feat/languages
Mnemotechnician Feb 14, 2024
014b76d
Wa
Mnemotechnician Feb 14, 2024
571b560
Merge remote-tracking branch 'origin/feat/languages' into feat/languages
Mnemotechnician Feb 14, 2024
1f5dc56
Fix window flickering and increase the default window size
Mnemotechnician Feb 14, 2024
cd7e250
Added a language selector to the chat ui (kmp)
Mnemotechnician Feb 23, 2024
800b7fa
Merge remote-tracking branch 'upstream/master' into feat/languages
FoxxoTrystan Mar 14, 2024
6287ead
QOL - Language Menu
FoxxoTrystan Mar 14, 2024
1750226
OnStateUpdate Update now LanguageSelector
FoxxoTrystan Mar 15, 2024
2282345
Revert "OnStateUpdate Update now LanguageSelector"
FoxxoTrystan Mar 18, 2024
6fc0831
Merge remote-tracking branch 'upstream/master' into pr/671
FoxxoTrystan Mar 18, 2024
10bca44
Total refactor of the client-server interactions and client-side logic
Mnemotechnician Mar 20, 2024
34de3a6
Typo
Mnemotechnician Mar 20, 2024
e91f7e1
Fixes for universal speakers (no more walls speaking GC)
Mnemotechnician Mar 20, 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
1 change: 1 addition & 0 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.UseItemInHand);
human.AddFunction(ContentKeyFunctions.AltUseItemInHand);
human.AddFunction(ContentKeyFunctions.OpenCharacterMenu);
human.AddFunction(ContentKeyFunctions.OpenLanguageMenu); // Frontier - Langauges
human.AddFunction(ContentKeyFunctions.ActivateItemInWorld);
human.AddFunction(ContentKeyFunctions.ThrowItemInHand);
human.AddFunction(ContentKeyFunctions.AltActivateItemInWorld);
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.CycleChatChannelForward);
AddButton(ContentKeyFunctions.CycleChatChannelBackward);
AddButton(ContentKeyFunctions.OpenCharacterMenu);
AddButton(ContentKeyFunctions.OpenLanguageMenu); // Frontier - Languages
AddButton(ContentKeyFunctions.OpenCraftingMenu);
AddButton(ContentKeyFunctions.OpenGuidebook);
AddButton(ContentKeyFunctions.OpenInventoryMenu);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using Content.Shared.Chat;
using Content.Client._NF.Language.Systems.Chat.Controls;
using Content.Client.UserInterface.Systems.Language;
using Content.Shared.Chat;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this not be using Content.Client._NF.Language;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly, namespaces are fucked up here, _NF should be gone except in cases where it's absolutely needed (like .xaml.cs files)

using Content.Shared.Input;
using Content.Shared.Language;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;

namespace Content.Client.UserInterface.Systems.Chat.Controls;
Expand All @@ -8,6 +12,7 @@ namespace Content.Client.UserInterface.Systems.Chat.Controls;
public class ChatInputBox : PanelContainer
{
public readonly ChannelSelectorButton ChannelSelector;
public readonly LanguageSelectorButton LanguageSelector; // Frontier
public readonly HistoryLineEdit Input;
public readonly ChannelFilterButton FilterButton;
protected readonly BoxContainer Container;
Expand All @@ -30,6 +35,16 @@ public ChatInputBox()
MinWidth = 75
};
Container.AddChild(ChannelSelector);
// frontier block - begin
LanguageSelector = new LanguageSelectorButton
{
Name = "LanguageSelector",
ToggleMode = true,
StyleClasses = { "chatSelectorOptionButton" },
MinWidth = 75
};
Container.AddChild(LanguageSelector);
// frontier block - end
Input = new HistoryLineEdit
{
Name = "Input",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Content.Client.UserInterface.Systems.MenuBar.Widgets;
using Content.Client.UserInterface.Systems.Sandbox;
using Robust.Client.UserInterface.Controllers;
using Content.Client.UserInterface.Systems.Language; // Frontier

namespace Content.Client.UserInterface.Systems.MenuBar;

Expand All @@ -22,6 +23,7 @@ public sealed class GameTopMenuBarUIController : UIController
[Dependency] private readonly ActionUIController _action = default!;
[Dependency] private readonly SandboxUIController _sandbox = default!;
[Dependency] private readonly GuidebookUIController _guidebook = default!;
[Dependency] private readonly LanguageMenuUIController _language = default!; // Frontier

private GameTopMenuBar? GameTopMenuBar => UIManager.GetActiveUIWidgetOrNull<GameTopMenuBar>();

Expand All @@ -44,6 +46,7 @@ public void UnloadButtons()
_ahelp.UnloadButton();
_action.UnloadButton();
_sandbox.UnloadButton();
_language.UnloadButton(); // Frontier - Languages
}

public void LoadButtons()
Expand All @@ -56,5 +59,6 @@ public void LoadButtons()
_ahelp.LoadButton();
_action.LoadButton();
_sandbox.LoadButton();
_language.LoadButton(); // Frontier - Languages
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@
HorizontalExpand="True"
AppendStyleClass="{x:Static style:StyleBase.ButtonSquare}"
/>
<!-- Frontier Block End -->
<ui:MenuButton
Name="LanguageButton"
Access="Internal"
Icon="{xe:Tex '/Textures/_NF/Interface/Actions/language.png'}"
BoundKey = "{x:Static is:ContentKeyFunctions.OpenLanguageMenu}"
ToolTip="Open the Language Menu"
MinSize="42 64"
HorizontalExpand="True"
AppendStyleClass="{x:Static style:StyleBase.ButtonSquare}"
/>
<!-- Frontier Block End -->
<ui:MenuButton
Name="AdminButton"
Access="Internal"
Expand Down
18 changes: 18 additions & 0 deletions Content.Client/_NF/Language/LanguageMenuWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
Title="a"
SetSize="300 300">
<BoxContainer Orientation="Vertical" SeparationOverride="4" MinWidth="150">
<PanelContainer Name="CurrentLanguageContainer" Access="Public" StyleClasses="PdaBorderRect">
<Label Name="CurrentLanguageLabel" Access="Public" Text="Current Language:" HorizontalExpand="True"></Label>
</PanelContainer>

<ui:HLine></ui:HLine>

<ScrollContainer HorizontalExpand="True" VerticalExpand="True" HScrollEnabled="False" VScrollEnabled="True" MinHeight="50">
<BoxContainer Name="OptionsList" Access="Public" HorizontalExpand="True" SeparationOverride="2" Orientation="Vertical">
<!-- The rest here is generated programmatically -->
</BoxContainer>
</ScrollContainer>
</BoxContainer>
</DefaultWindow>
123 changes: 123 additions & 0 deletions Content.Client/_NF/Language/LanguageMenuWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
using Content.Client.Language.Systems;
using Content.Shared.Language;
using Content.Shared.Language.Systems;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Console;
using Robust.Shared.Utility;
using static Content.Shared.Language.Systems.SharedLanguageSystem;

namespace Content.Client._NF.Language; // This EXACT class must have the _NF part because of xaml linking

[GenerateTypedNameReferences]
public sealed partial class LanguageMenuWindow : DefaultWindow
{
private readonly LanguageSystem _clientLanguageSystem;
private readonly List<EntryState> _entries = new();

public LanguageMenuWindow()
{
RobustXamlLoader.Load(this);
_clientLanguageSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<LanguageSystem>();

Title = Loc.GetString("language-menu-window-title");
}

public void UpdateState(string currentLanguage, List<string> spokenLanguages)
{
var langName = LanguagePrototype.GetLocalizedName(currentLanguage);
CurrentLanguageLabel.Text = Loc.GetString("language-menu-current-language", ("language", langName ?? "<error>"));

OptionsList.RemoveAllChildren();
_entries.Clear();

foreach (var language in spokenLanguages)
{
AddLanguageEntry(language);
}

// Disable the button for the currently chosen language
foreach (var entry in _entries)
{
if (entry.button != null)
entry.button.Disabled = entry.language == currentLanguage;
}
}

private void AddLanguageEntry(string language)
{
var proto = _clientLanguageSystem.GetLanguage(language);
var state = new EntryState { language = language };

var container = new BoxContainer();
container.Orientation = BoxContainer.LayoutOrientation.Vertical;

// Create and add a header with the name and the button to select the language
{
var header = new BoxContainer();
header.Orientation = BoxContainer.LayoutOrientation.Horizontal;

header.Orientation = BoxContainer.LayoutOrientation.Horizontal;
header.HorizontalExpand = true;
header.SeparationOverride = 2;

var name = new Label();
name.Text = proto?.LocalizedName ?? "<error>";
name.MinWidth = 50;
name.HorizontalExpand = true;

var button = new Button();
button.Text = "Choose";
button.OnPressed += _ => OnLanguageChosen(language);
state.button = button;

header.AddChild(name);
header.AddChild(button);

container.AddChild(header);
}

// Create and add a collapsible description
{
var body = new CollapsibleBody();
body.HorizontalExpand = true;
body.Margin = new Thickness(4f, 4f);

var description = new RichTextLabel();
description.SetMessage(proto?.LocalizedDescription ?? "<error>");
description.HorizontalExpand = true;

body.AddChild(description);

var collapser = new Collapsible(Loc.GetString("language-menu-description-header"), body);
collapser.Orientation = BoxContainer.LayoutOrientation.Vertical;
collapser.HorizontalExpand = true;

container.AddChild(collapser);
}

// Before adding, wrap the new container in a PanelContainer to give it a distinct look
var wrapper = new PanelContainer();
wrapper.StyleClasses.Add("PdaBorderRect");

wrapper.AddChild(container);
OptionsList.AddChild(wrapper);

_entries.Add(state);
}

private void OnLanguageChosen(string id)
{
var proto = _clientLanguageSystem.GetLanguage(id);
if (proto != null)
_clientLanguageSystem.RequestSetLanguage(proto);
}

private struct EntryState
{
public string language;
public Button? button;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
using System.Linq;
using System.Numerics;
using Content.Client.Language.Systems;
using Content.Client.UserInterface.Systems.Chat.Controls;
using Content.Client.UserInterface.Systems.Language;
using Content.Shared.Language;
using Robust.Client.UserInterface;
using Robust.Shared.Utility;

namespace Content.Client._NF.Language.Systems.Chat.Controls;

// Mostly copied from ChannelSelectorButton
public sealed class LanguageSelectorButton : ChatPopupButton<LanguageSelectorPopup>
{
public LanguagePrototype? SelectedLanguage { get; private set; }

private const int SelectorDropdownOffset = 38;

public LanguageSelectorButton()
{
Name = "LanguageSelector";

Popup.Selected += Select;

if (Popup.FirstLanguage is { } firstSelector)
{
Select(firstSelector);
}

IoCManager.Resolve<IUserInterfaceManager>().GetUIController<LanguageMenuUIController>().LanguagesUpdatedHook += UpdateLanguage;
}

private void UpdateLanguage((string current, List<string> spoken, List<string> understood) args)
{
Popup.SetLanguages(args.spoken);

// Kill me please
SelectedLanguage = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<LanguageSystem>().GetLanguage(args.current);
Text = LanguageSelectorName(SelectedLanguage!);
}

protected override UIBox2 GetPopupPosition()
{
var globalLeft = GlobalPosition.X;
var globalBot = GlobalPosition.Y + Height;
return UIBox2.FromDimensions(
new Vector2(globalLeft, globalBot),
new Vector2(SizeBox.Width, SelectorDropdownOffset));
}

public void Select(LanguagePrototype language)
{
if (Popup.Visible)
{
Popup.Close();
}

if (SelectedLanguage == language)
return;
SelectedLanguage = language;
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<LanguageSystem>().RequestSetLanguage(language);

Text = LanguageSelectorName(language);
}

public static string LanguageSelectorName(LanguagePrototype language, bool full = false)
{
var name = language.LocalizedName;

// if the language name is short enough, just return it
if (full || name.Length < 5)
return name;

// If the language name is multi-word, collect first letters and capitalize them
if (name.Contains(' '))
{
var result = name
.Split(" ")
.Select(it => it.FirstOrNull())
.Where(it => it != null)
.Select(it => char.ToUpper(it!.Value));

return new string(result.ToArray());
}

// Alternatively, take the first 5 letters
return name[..5];
}

// public Color ChannelSelectColor(ChatSelectChannel channel)
// {
// return channel switch
// {
// ChatSelectChannel.Radio => Color.LimeGreen,
// ChatSelectChannel.LOOC => Color.MediumTurquoise,
// ChatSelectChannel.OOC => Color.LightSkyBlue,
// ChatSelectChannel.Dead => Color.MediumPurple,
// ChatSelectChannel.Admin => Color.HotPink,
// _ => Color.DarkGray
// };
// }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.Chat;
using Content.Client.UserInterface.Systems.Chat.Controls;
using Content.Shared.Chat;
using Content.Shared.Language;
using Robust.Client.UserInterface.Controls;

namespace Content.Client._NF.Language.Systems.Chat.Controls;

// Mostly copied from ChannelSelectorItemButton
public sealed class LanguageSelectorItemButton : Button
{
public readonly LanguagePrototype Language;

public bool IsHidden => Parent == null;

public LanguageSelectorItemButton(LanguagePrototype language)
{
Language = language;
AddStyleClass(StyleNano.StyleClassChatChannelSelectorButton);

Text = LanguageSelectorButton.LanguageSelectorName(language, full: true);

// var prefix = ChatUIController.ChannelPrefixes[selector];
// if (prefix != default)
// Text = Loc.GetString("hud-chatbox-select-name-prefixed", ("name", Text), ("prefix", prefix));
}
}
Loading
Loading