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
The table of contents is too big for display.
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 @@ -63,6 +63,7 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.AltUseItemInHand);
human.AddFunction(ContentKeyFunctions.OpenCharacterMenu);
human.AddFunction(ContentKeyFunctions.OpenEmotesMenu);
human.AddFunction(ContentKeyFunctions.OpenLanguageMenu); // Forge-change: Einstein Engines - Language
human.AddFunction(ContentKeyFunctions.ActivateItemInWorld);
human.AddFunction(ContentKeyFunctions.ThrowItemInHand);
human.AddFunction(ContentKeyFunctions.AltActivateItemInWorld);
Expand Down
16 changes: 16 additions & 0 deletions Content.Client/Lobby/ClientPreferencesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Content.Shared._Mono.Company; // Forge-change

namespace Content.Client.Lobby
{
Expand Down Expand Up @@ -62,6 +63,21 @@ public void SelectCharacter(int slot)
public void UpdateCharacter(ICharacterProfile profile, int slot)
{
var collection = IoCManager.Instance!;

// Forge-change-start
// Verify company exists if this is a humanoid profile
if (profile is HumanoidCharacterProfile humanoidProfile)
{
var protoManager = IoCManager.Resolve<IPrototypeManager>();
if (!string.IsNullOrEmpty(humanoidProfile.Company) &&
humanoidProfile.Company != "None" &&
!protoManager.HasIndex<CompanyPrototype>(humanoidProfile.Company))
{
profile = humanoidProfile.WithCompany("None");
}
}
// Forge-change-end

profile.EnsureValid(_playerManager.LocalSession!, collection);
var characters = new Dictionary<int, ICharacterProfile>(Preferences.Characters) {[slot] = profile};
Preferences = new PlayerPreferences(characters, Preferences.SelectedCharacterIndex, Preferences.AdminOOCColor, Preferences.ConstructionFavorites);
Expand Down
14 changes: 14 additions & 0 deletions Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Content.Shared._Mono.Company; // Forge-change

namespace Content.Client.Lobby;

Expand Down Expand Up @@ -186,13 +187,26 @@ private void RefreshLobbyPreview()
PreviewPanel.SetSprite(EntityUid.Invalid);
PreviewPanel.SetSummaryText(string.Empty);
PreviewPanel.SetBankBalanceText(string.Empty); // Frontier
PreviewPanel.SetCompanyText(string.Empty); // Forge-change Company Display
return;
}

var dummy = LoadProfileEntity(humanoid, null, true);
PreviewPanel.SetSprite(dummy);
PreviewPanel.SetSummaryText(humanoid.Summary);
PreviewPanel.SetBankBalanceText(humanoid.BankBalanceText); // Frontier

// Forge-change-start: Company Display
var companyId = humanoid.Company;
if (_prototypeManager.TryIndex<CompanyPrototype>(companyId, out var company))
{
PreviewPanel.SetCompanyText($"[color={company.Color.ToHex()}]{company.Name}[/color]");
}
else
{
PreviewPanel.SetCompanyText(Loc.GetString("humanoid-profile-editor-company-label") + $" [color=yellow]{companyId}[/color]");
}
// Forge-change-end
}

private void RefreshProfileEditor()
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@
<BoxContainer Name="TraitsList" Orientation="Vertical" />
</ScrollContainer>
</BoxContainer>
<!-- Monolith: Company Tab -->
<BoxContainer Orientation="Vertical" Margin="10">
<ScrollContainer HorizontalExpand="True" VerticalExpand="True">
<BoxContainer Name="CompanyContainer" Orientation="Vertical" />
</ScrollContainer>
</BoxContainer>
<!-- Monolith end -->
<BoxContainer Name="MarkingsTab" Orientation="Vertical" Margin="10">
<!-- Markings -->
<ScrollContainer VerticalExpand="True">
Expand Down
Loading
Loading