Skip to content

Commit

Permalink
fix character editor
Browse files Browse the repository at this point in the history
  • Loading branch information
DEATHB4DEFEAT committed Jul 20, 2024
1 parent 7913df8 commit 3a83781
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ private void PreferencesDataLoaded()
if (_previewDummy != null)
EntityManager.DeleteEntity(_previewDummy);

// Test moment
if (_stateManager.CurrentState is not LobbyState)
return;

_previewDummy =
EntityManager.SpawnEntity(
_prototypeManager.Index<SpeciesPrototype>(HumanoidCharacterProfile.DefaultWithSpecies().Species)
.DollPrototype, MapCoordinates.Nullspace);
_previewPanel?.SetSprite(_previewDummy.Value);

UpdateCharacterUI();
}

Expand Down Expand Up @@ -98,12 +88,25 @@ public void SetProfileEditor(HumanoidProfileEditor? editor)

public void UpdateCharacterUI()
{
// Test moment
if (_stateManager.CurrentState is not LobbyState)
return;

if (!_preferencesManager.ServerDataLoaded)
{
_previewPanel?.SetLoaded(false);
return;
}

if (_previewDummy == null)
{
_previewDummy =
EntityManager.SpawnEntity(
_prototypeManager.Index<SpeciesPrototype>(HumanoidCharacterProfile.DefaultWithSpecies().Species)
.DollPrototype, MapCoordinates.Nullspace);
_previewPanel?.SetSprite(_previewDummy.Value);
}

_previewPanel?.SetLoaded(true);

if (_preferencesManager.Preferences?.SelectedCharacter is not HumanoidCharacterProfile selectedCharacter)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Lobby/UI/LobbyCharacterPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void SetLoaded(bool value)

public void SetSummaryText(string value)
{
Summary.Text = string.Empty;
Summary.Text = value;
}

public void SetSprite(EntityUid uid)
Expand Down

0 comments on commit 3a83781

Please sign in to comment.