@@ -28,7 +28,6 @@ namespace Content.Client.UserInterface
|
||||
public readonly Button CloseButton;
|
||||
|
||||
public CharacterSetupGui(IEntityManager entityManager,
|
||||
ILocalizationManager localization,
|
||||
IResourceCache resourceCache,
|
||||
IClientPreferencesManager preferencesManager,
|
||||
IPrototypeManager prototypeManager)
|
||||
@@ -67,7 +66,7 @@ namespace Content.Client.UserInterface
|
||||
CloseButton = new Button
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkEnd,
|
||||
Text = localization.GetString("Save and close"),
|
||||
Text = Loc.GetString("Save and close"),
|
||||
StyleClasses = {NanoStyle.StyleClassButtonBig}
|
||||
};
|
||||
|
||||
@@ -83,7 +82,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = localization.GetString("Character Setup"),
|
||||
Text = Loc.GetString("Character Setup"),
|
||||
StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger},
|
||||
VAlign = Label.VAlignMode.Center,
|
||||
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter
|
||||
@@ -149,17 +148,14 @@ namespace Content.Client.UserInterface
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = NanoStyle.NanoGold},
|
||||
CustomMinimumSize = (2, 0)
|
||||
});
|
||||
_humanoidProfileEditor = new HumanoidProfileEditor(localization, preferencesManager, prototypeManager);
|
||||
_humanoidProfileEditor = new HumanoidProfileEditor(preferencesManager, prototypeManager);
|
||||
_humanoidProfileEditor.OnProfileChanged += newProfile => { UpdateUI(); };
|
||||
hBox.AddChild(_humanoidProfileEditor);
|
||||
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
_humanoidProfileEditor.Save();
|
||||
}
|
||||
public void Save() => _humanoidProfileEditor.Save();
|
||||
|
||||
private void UpdateUI()
|
||||
{
|
||||
|
||||
@@ -48,8 +48,7 @@ namespace Content.Client.UserInterface
|
||||
public HumanoidCharacterProfile Profile;
|
||||
public event Action<HumanoidCharacterProfile> OnProfileChanged;
|
||||
|
||||
public HumanoidProfileEditor(ILocalizationManager localization,
|
||||
IClientPreferencesManager preferencesManager, IPrototypeManager prototypeManager)
|
||||
public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IPrototypeManager prototypeManager)
|
||||
{
|
||||
_random = IoCManager.Resolve<IRobustRandom>();
|
||||
Profile = (HumanoidCharacterProfile) preferencesManager.Preferences.SelectedCharacter;
|
||||
@@ -83,7 +82,7 @@ namespace Content.Client.UserInterface
|
||||
var panel = HighlightedContainer();
|
||||
var randomizeEverythingButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Randomize everything")
|
||||
Text = Loc.GetString("Randomize everything")
|
||||
};
|
||||
randomizeEverythingButton.OnPressed += args => { RandomizeEverything(); };
|
||||
panel.AddChild(randomizeEverythingButton);
|
||||
@@ -100,7 +99,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
};
|
||||
var nameLabel = new Label {Text = localization.GetString("Name:")};
|
||||
var nameLabel = new Label {Text = Loc.GetString("Name:")};
|
||||
_nameEdit = new LineEdit
|
||||
{
|
||||
CustomMinimumSize = (270, 0),
|
||||
@@ -109,7 +108,7 @@ namespace Content.Client.UserInterface
|
||||
_nameEdit.OnTextChanged += args => { SetName(args.Text); };
|
||||
var nameRandomButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Randomize"),
|
||||
Text = Loc.GetString("Randomize"),
|
||||
};
|
||||
nameRandomButton.OnPressed += args => RandomizeName();
|
||||
hBox.AddChild(nameLabel);
|
||||
@@ -143,19 +142,19 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var sexLabel = new Label {Text = localization.GetString("Sex:")};
|
||||
var sexLabel = new Label {Text = Loc.GetString("Sex:")};
|
||||
|
||||
var sexButtonGroup = new ButtonGroup();
|
||||
|
||||
_sexMaleButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Male"),
|
||||
Text = Loc.GetString("Male"),
|
||||
Group = sexButtonGroup
|
||||
};
|
||||
_sexMaleButton.OnPressed += args => { SetSex(Sex.Male); };
|
||||
_sexFemaleButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Female"),
|
||||
Text = Loc.GetString("Female"),
|
||||
Group = sexButtonGroup
|
||||
};
|
||||
_sexFemaleButton.OnPressed += args => { SetSex(Sex.Female); };
|
||||
@@ -173,7 +172,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var ageLabel = new Label {Text = localization.GetString("Age:")};
|
||||
var ageLabel = new Label {Text = Loc.GetString("Age:")};
|
||||
_ageEdit = new LineEdit {CustomMinimumSize = (40, 0)};
|
||||
_ageEdit.OnTextChanged += args =>
|
||||
{
|
||||
@@ -332,13 +331,13 @@ namespace Content.Client.UserInterface
|
||||
var hBox = new HBoxContainer();
|
||||
var importButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Import"),
|
||||
Text = Loc.GetString("Import"),
|
||||
Disabled = true,
|
||||
ToolTip = "Not yet implemented!"
|
||||
};
|
||||
var exportButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Export"),
|
||||
Text = Loc.GetString("Export"),
|
||||
Disabled = true,
|
||||
ToolTip = "Not yet implemented!"
|
||||
};
|
||||
@@ -356,7 +355,7 @@ namespace Content.Client.UserInterface
|
||||
var panel = HighlightedContainer();
|
||||
_saveButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Save"),
|
||||
Text = Loc.GetString("Save"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
};
|
||||
_saveButton.OnPressed += args => { Save(); };
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace Content.Client.UserInterface
|
||||
private readonly Label _summaryLabel;
|
||||
|
||||
public LobbyCharacterPreviewPanel(IEntityManager entityManager,
|
||||
ILocalizationManager localization,
|
||||
IClientPreferencesManager preferencesManager)
|
||||
{
|
||||
_preferencesManager = preferencesManager;
|
||||
@@ -32,12 +31,12 @@ namespace Content.Client.UserInterface
|
||||
|
||||
var header = new NanoHeading
|
||||
{
|
||||
Text = localization.GetString("Character setup")
|
||||
Text = Loc.GetString("Character setup")
|
||||
};
|
||||
|
||||
CharacterSetupButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Customize"),
|
||||
Text = Loc.GetString("Customize"),
|
||||
SizeFlagsHorizontal = SizeFlags.None
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace Content.Client.UserInterface
|
||||
public LobbyCharacterPreviewPanel CharacterPreview { get; }
|
||||
|
||||
public LobbyGui(IEntityManager entityManager,
|
||||
ILocalizationManager localization,
|
||||
IResourceCache resourceCache,
|
||||
IClientPreferencesManager preferencesManager)
|
||||
{
|
||||
@@ -69,7 +68,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = localization.GetString("Lobby"),
|
||||
Text = Loc.GetString("Lobby"),
|
||||
StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger},
|
||||
/*MarginBottom = 40,
|
||||
MarginLeft = 8,*/
|
||||
@@ -88,7 +87,7 @@ namespace Content.Client.UserInterface
|
||||
(LeaveButton = new Button
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
|
||||
Text = localization.GetString("Leave"),
|
||||
Text = Loc.GetString("Leave"),
|
||||
StyleClasses = {NanoStyle.StyleClassButtonBig},
|
||||
//GrowHorizontal = GrowDirection.Begin
|
||||
})
|
||||
@@ -115,7 +114,6 @@ namespace Content.Client.UserInterface
|
||||
|
||||
CharacterPreview = new LobbyCharacterPreviewPanel(
|
||||
entityManager,
|
||||
localization,
|
||||
preferencesManager)
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.None
|
||||
@@ -147,7 +145,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
(ObserveButton = new Button
|
||||
{
|
||||
Text = localization.GetString("Observe"),
|
||||
Text = Loc.GetString("Observe"),
|
||||
StyleClasses = {NanoStyle.StyleClassButtonBig}
|
||||
}),
|
||||
(StartTime = new Label
|
||||
@@ -160,7 +158,7 @@ namespace Content.Client.UserInterface
|
||||
(ReadyButton = new Button
|
||||
{
|
||||
ToggleMode = true,
|
||||
Text = localization.GetString("Ready Up"),
|
||||
Text = Loc.GetString("Ready Up"),
|
||||
StyleClasses = {NanoStyle.StyleClassButtonBig}
|
||||
}),
|
||||
}
|
||||
@@ -181,7 +179,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
(Chat = new ChatBox
|
||||
{
|
||||
Input = {PlaceHolder = localization.GetString("Say something!")}
|
||||
Input = {PlaceHolder = Loc.GetString("Say something!")}
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -201,7 +199,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
new NanoHeading
|
||||
{
|
||||
Text = localization.GetString("Online Players"),
|
||||
Text = Loc.GetString("Online Players"),
|
||||
},
|
||||
new MarginContainer
|
||||
{
|
||||
@@ -217,7 +215,7 @@ namespace Content.Client.UserInterface
|
||||
},
|
||||
new NanoHeading
|
||||
{
|
||||
Text = localization.GetString("Server Info"),
|
||||
Text = Loc.GetString("Server Info"),
|
||||
},
|
||||
new MarginContainer
|
||||
{
|
||||
@@ -228,7 +226,7 @@ namespace Content.Client.UserInterface
|
||||
MarginBottomOverride = 2,
|
||||
Children =
|
||||
{
|
||||
(ServerInfo = new ServerInfo(localization))
|
||||
(ServerInfo = new ServerInfo())
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
private readonly RichTextLabel _richTextLabel;
|
||||
|
||||
public ServerInfo(ILocalizationManager localization)
|
||||
public ServerInfo()
|
||||
{
|
||||
_richTextLabel = new RichTextLabel
|
||||
{
|
||||
@@ -26,10 +26,10 @@ namespace Content.Client.UserInterface
|
||||
|
||||
var uriOpener = IoCManager.Resolve<IUriOpener>();
|
||||
|
||||
var discordButton = new Button {Text = localization.GetString("Join us on Discord!")};
|
||||
var discordButton = new Button {Text = Loc.GetString("Join us on Discord!")};
|
||||
discordButton.OnPressed += args => uriOpener.OpenUri(DiscordUrl);
|
||||
|
||||
var websiteButton = new Button {Text = localization.GetString("Website")};
|
||||
var websiteButton = new Button {Text = Loc.GetString("Website")};
|
||||
websiteButton.OnPressed += args => uriOpener.OpenUri(WebsiteUrl);
|
||||
|
||||
buttons.AddChild(discordButton);
|
||||
|
||||
Reference in New Issue
Block a user