Skip to content

Commit

Permalink
Force players onto cryosleep
Browse files Browse the repository at this point in the history
  • Loading branch information
Just-a-Unity-Dev committed Mar 30, 2024
1 parent c4bbf16 commit c76332a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@
<OptionButton Name="CBackpackButton" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Spawn Priority -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-spawn-priority-label'}" />
<Control HorizontalExpand="True"/>
<OptionButton Name="CSpawnPriorityButton" HorizontalAlignment="Right" />
</BoxContainer>
<!-- <BoxContainer HorizontalExpand="True"> -->
<!-- <Label Text="{Loc 'humanoid-profile-editor-spawn-priority-label'}" /> -->
<!-- <Control HorizontalExpand="True"/> -->
<!-- <OptionButton Name="CSpawnPriorityButton" HorizontalAlignment="Right" /> -->
<!-- </BoxContainer> -->
<!-- Height -->
<!-- <BoxContainer HorizontalExpand="True"> -->
<!-- <Label Text="{Loc 'humanoid-profile-editor-height-label'}" /> -->
Expand Down
24 changes: 12 additions & 12 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public sealed partial class HumanoidProfileEditor : Control
private Slider _skinColor => CSkin;
private OptionButton _clothingButton => CClothingButton;
private OptionButton _backpackButton => CBackpackButton;
private OptionButton _spawnPriorityButton => CSpawnPriorityButton;
// private OptionButton _spawnPriorityButton => CSpawnPriorityButton;
private SingleMarkingPicker _hairPicker => CHairStylePicker;
private SingleMarkingPicker _facialHairPicker => CFacialHairPicker;
private EyeColorPicker _eyesPicker => CEyeColorPicker;
Expand Down Expand Up @@ -364,16 +364,16 @@ public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IProt

#region SpawnPriority

foreach (var value in Enum.GetValues<SpawnPriorityPreference>())
{
_spawnPriorityButton.AddItem(Loc.GetString($"humanoid-profile-editor-preference-spawn-priority-{value.ToString().ToLower()}"), (int) value);
}

_spawnPriorityButton.OnItemSelected += args =>
{
_spawnPriorityButton.SelectId(args.Id);
SetSpawnPriority((SpawnPriorityPreference) args.Id);
};
// foreach (var value in Enum.GetValues<SpawnPriorityPreference>())
// {
// _spawnPriorityButton.AddItem(Loc.GetString($"humanoid-profile-editor-preference-spawn-priority-{value.ToString().ToLower()}"), (int) value);
// }
//
// _spawnPriorityButton.OnItemSelected += args =>
// {
// _spawnPriorityButton.SelectId(args.Id);
// SetSpawnPriority((SpawnPriorityPreference) args.Id);
// };

#endregion SpawnPriority

Expand Down Expand Up @@ -1042,7 +1042,7 @@ private void UpdateSpawnPriorityControls()
return;
}

_spawnPriorityButton.SelectId((int) Profile.SpawnPriority);
// _spawnPriorityButton.SelectId((int) Profile.SpawnPriority);
}

private void UpdateHairPickers()
Expand Down
8 changes: 4 additions & 4 deletions Content.Shared/Preferences/HumanoidCharacterProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public HumanoidCharacterProfile WithBackpackPreference(BackpackPreference backpa
}
public HumanoidCharacterProfile WithSpawnPriorityPreference(SpawnPriorityPreference spawnPriority)
{
return new(this) { SpawnPriority = spawnPriority };
return new(this) { SpawnPriority = SpawnPriorityPreference.Cryosleep };
}
public HumanoidCharacterProfile WithJobPriorities(IEnumerable<KeyValuePair<string, JobPriority>> jobPriorities)
{
Expand Down Expand Up @@ -487,10 +487,10 @@ public void EnsureValid()

var spawnPriority = SpawnPriority switch
{
SpawnPriorityPreference.None => SpawnPriorityPreference.None,
SpawnPriorityPreference.Arrivals => SpawnPriorityPreference.Arrivals,
SpawnPriorityPreference.None => SpawnPriorityPreference.Cryosleep,
SpawnPriorityPreference.Arrivals => SpawnPriorityPreference.Cryosleep,
SpawnPriorityPreference.Cryosleep => SpawnPriorityPreference.Cryosleep,
_ => SpawnPriorityPreference.None // Invalid enum values.
_ => SpawnPriorityPreference.Cryosleep // Invalid enum values.
};

var priorities = new Dictionary<string, JobPriority>(JobPriorities
Expand Down

0 comments on commit c76332a

Please sign in to comment.