Skip to content

Commit a77b1d5

Browse files
Merge branch 'master' into wizden-cherrypick-2
2 parents 66cdaba + f82ad18 commit a77b1d5

File tree

31 files changed

+1824
-1342
lines changed

31 files changed

+1824
-1342
lines changed

.github/workflows/update-credits.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
# Hey there fork dev! If you like to include your own contributors in this then you can probably just change this to your own repo
1212
# Do this in dump_github_contributors.ps1 too into your own repo
13-
if: github.repository == 'DeltaV-Station/Delta-v'
13+
if: github.repository == 'Simple-Station/Einstein-Engines'
1414

1515
steps:
1616
- uses: actions/[email protected]
@@ -47,6 +47,6 @@ jobs:
4747
with:
4848
commit-message: Update Credits
4949
title: Update Credits
50-
body: This is an automated Pull Request. This PR updates the github contributors in the credits section.
51-
author: DeltaV-Bot <[email protected]>
50+
body: This is an automated Pull Request. This PR updates the GitHub contributors in the credits section.
51+
author: ${{ vars.CHANGELOG_USER }} <${{ vars.CHANGELOG_EMAIL }}>
5252
branch: automated/credits-${{env.NOW}}

Content.Client/Preferences/UI/HumanoidProfileEditor.xaml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<BoxContainer HorizontalExpand="True">
5959
<Label Text="{Loc 'humanoid-profile-editor-species-label'}" />
6060
<Control HorizontalExpand="True"/>
61+
<TextureButton Name="SpeciesInfoButton" Scale="0.3 0.3" VerticalAlignment="Center"></TextureButton>
6162
<OptionButton Name="CSpeciesButton" HorizontalAlignment="Right" />
6263
</BoxContainer>
6364
<!-- Age -->

Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs

+44
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using System.Linq;
22
using System.Numerics;
3+
using Content.Client.Guidebook;
34
using Content.Client.Humanoid;
45
using Content.Client.Lobby.UI;
56
using Content.Client.Message;
67
using Content.Client.Players.PlayTimeTracking;
78
using Content.Client.Stylesheets;
89
using Content.Client.UserInterface.Controls;
10+
using Content.Client.UserInterface.Systems.Guidebook;
911
using Content.Shared.CCVar;
1012
using Content.Shared.GameTicking;
1113
using Content.Shared.Humanoid;
@@ -116,6 +118,8 @@ public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IProt
116118
_configurationManager = configurationManager;
117119
_markingManager = IoCManager.Resolve<MarkingManager>();
118120

121+
SpeciesInfoButton.ToolTip = Loc.GetString("humanoid-profile-editor-guidebook-button-tooltip");
122+
119123
#region Left
120124

121125
#region Randomize
@@ -523,10 +527,30 @@ public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IProt
523527

524528
preferencesManager.OnServerDataLoaded += LoadServerData;
525529

530+
SpeciesInfoButton.OnPressed += OnSpeciesInfoButtonPressed;
531+
532+
UpdateSpeciesGuidebookIcon();
526533

527534
IsDirty = false;
528535
}
529536

537+
private void OnSpeciesInfoButtonPressed(BaseButton.ButtonEventArgs args)
538+
{
539+
var guidebookController = UserInterfaceManager.GetUIController<GuidebookUIController>();
540+
var species = Profile?.Species ?? SharedHumanoidAppearanceSystem.DefaultSpecies;
541+
var page = "Species";
542+
if (_prototypeManager.HasIndex<GuideEntryPrototype>(species))
543+
page = species;
544+
545+
if (_prototypeManager.TryIndex<GuideEntryPrototype>("Species", out var guideRoot))
546+
{
547+
var dict = new Dictionary<string, GuideEntry>();
548+
dict.Add("Species", guideRoot);
549+
//TODO: Don't close the guidebook if its already open, just go to the correct page
550+
guidebookController.ToggleGuidebook(dict, includeChildren:true, selected: page);
551+
}
552+
}
553+
530554
private void ToggleClothes(BaseButton.ButtonEventArgs obj)
531555
{
532556
RebuildSpriteView();
@@ -822,6 +846,7 @@ private void SetSpecies(string newSpecies)
822846
CMarkings.SetSpecies(newSpecies); // Repopulate the markings tab as well.
823847
UpdateSexControls(); // update sex for new species
824848
RebuildSpriteView(); // they might have different inv so we need a new dummy
849+
UpdateSpeciesGuidebookIcon();
825850
IsDirty = true;
826851
_needUpdatePreview = true;
827852
}
@@ -973,6 +998,25 @@ private void UpdateSkinColor()
973998

974999
}
9751000

1001+
public void UpdateSpeciesGuidebookIcon()
1002+
{
1003+
SpeciesInfoButton.StyleClasses.Clear();
1004+
1005+
var species = Profile?.Species;
1006+
if (species is null)
1007+
return;
1008+
1009+
if (!_prototypeManager.TryIndex<SpeciesPrototype>(species, out var speciesProto))
1010+
return;
1011+
1012+
// Don't display the info button if no guide entry is found
1013+
if (!_prototypeManager.HasIndex<GuideEntryPrototype>(species))
1014+
return;
1015+
1016+
var style = speciesProto.GuideBookIcon;
1017+
SpeciesInfoButton.StyleClasses.Add(style);
1018+
}
1019+
9761020
private void UpdateMarkings()
9771021
{
9781022
if (Profile == null)

Content.Client/Stylesheets/StyleNano.cs

+8
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,14 @@ public StyleNano(IResourceCache resCache) : base(resCache)
13921392
.Prop(Control.StylePropertyModulateSelf, Color.FromHex("#753131")),
13931393
// ---
13941394

1395+
// Profile Editor
1396+
Element<TextureButton>().Class("SpeciesInfoDefault")
1397+
.Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
1398+
1399+
Element<TextureButton>().Class("SpeciesInfoWarning")
1400+
.Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/info.svg.192dpi.png"))
1401+
.Prop(Control.StylePropertyModulateSelf, Color.FromHex("#eeee11")),
1402+
13951403
// The default look of paper in UIs. Pages can have components which override this
13961404
Element<PanelContainer>().Class("PaperDefaultBorder")
13971405
.Prop(PanelContainer.StylePropertyPanel, paperBackground),

Content.Server/Light/EntitySystems/LightReplacerSystem.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public bool TryInsertBulbsFromStorage(EntityUid replacerUid, EntityUid storageUi
233233
// show some message if success
234234
if (insertedBulbs > 0 && userUid != null)
235235
{
236-
var msg = Loc.GetString("comp-light-replacer-refill-from-storage", ("light-replacer", storageUid));
236+
var msg = Loc.GetString("comp-light-replacer-refill-from-storage", ("light-replacer", replacerUid));
237237
_popupSystem.PopupEntity(msg, replacerUid, userUid.Value, PopupType.Medium);
238238
}
239239

Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs

+23-17
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ public sealed partial class SpeciesPrototype : IPrototype
1515
/// <summary>
1616
/// User visible name of the species.
1717
/// </summary>
18-
[DataField("name", required: true)]
18+
[DataField(required: true)]
1919
public string Name { get; private set; } = default!;
2020

2121
/// <summary>
2222
/// Descriptor. Unused...? This is intended
2323
/// for an eventual integration into IdentitySystem
2424
/// (i.e., young human person, young lizard person, etc.)
2525
/// </summary>
26-
[DataField("descriptor")]
26+
[DataField]
2727
public string Descriptor { get; private set; } = "humanoid";
2828

2929
/// <summary>
3030
/// Whether the species is available "at round start" (In the character editor)
3131
/// </summary>
32-
[DataField("roundStart", required: true)]
32+
[DataField(required: true)]
3333
public bool RoundStart { get; private set; } = false;
3434

3535
// The below two are to avoid fetching information about the species from the entity
@@ -47,14 +47,14 @@ public sealed partial class SpeciesPrototype : IPrototype
4747
/// <summary>
4848
/// Default skin tone for this species. This applies for non-human skin tones.
4949
/// </summary>
50-
[DataField("defaultSkinTone")]
50+
[DataField]
5151
public Color DefaultSkinTone { get; private set; } = Color.White;
5252

5353
/// <summary>
5454
/// Default human skin tone for this species. This applies for human skin tones.
5555
/// See <see cref="SkinColor.HumanSkinTone"/> for the valid range of skin tones.
5656
/// </summary>
57-
[DataField("defaultHumanSkinTone")]
57+
[DataField]
5858
public int DefaultHumanSkinTone { get; private set; } = 20;
5959

6060
/// <summary>
@@ -66,60 +66,66 @@ public sealed partial class SpeciesPrototype : IPrototype
6666
/// <summary>
6767
/// Humanoid species variant used by this entity.
6868
/// </summary>
69-
[DataField("prototype", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
69+
[DataField(required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
7070
public string Prototype { get; private set; } = default!;
7171

7272
/// <summary>
7373
/// Prototype used by the species for the dress-up doll in various menus.
7474
/// </summary>
75-
[DataField("dollPrototype", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
75+
[DataField(required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
7676
public string DollPrototype { get; private set; } = default!;
7777

7878
/// <summary>
7979
/// Method of skin coloration used by the species.
8080
/// </summary>
81-
[DataField("skinColoration", required: true)]
81+
[DataField(required: true)]
8282
public HumanoidSkinColor SkinColoration { get; private set; }
8383

84-
[DataField("maleFirstNames")]
84+
[DataField]
8585
public string MaleFirstNames { get; private set; } = "names_first_male";
8686

87-
[DataField("femaleFirstNames")]
87+
[DataField]
8888
public string FemaleFirstNames { get; private set; } = "names_first_female";
8989

90-
[DataField("lastNames")]
90+
[DataField]
9191
public string LastNames { get; private set; } = "names_last";
9292

93-
[DataField("naming")]
93+
[DataField]
9494
public SpeciesNaming Naming { get; private set; } = SpeciesNaming.FirstLast;
9595

96-
[DataField("sexes")]
96+
[DataField]
9797
public List<Sex> Sexes { get; private set; } = new() { Sex.Male, Sex.Female };
9898

9999
/// <summary>
100100
/// Characters younger than this are too young to be hired by Nanotrasen.
101101
/// </summary>
102-
[DataField("minAge")]
102+
[DataField]
103103
public int MinAge = 18;
104104

105105
/// <summary>
106106
/// Characters younger than this appear young.
107107
/// </summary>
108-
[DataField("youngAge")]
108+
[DataField]
109109
public int YoungAge = 30;
110110

111111
/// <summary>
112112
/// Characters older than this appear old. Characters in between young and old age appear middle aged.
113113
/// </summary>
114-
[DataField("oldAge")]
114+
[DataField]
115115
public int OldAge = 60;
116116

117117
/// <summary>
118118
/// Characters cannot be older than this. Only used for restrictions...
119119
/// although imagine if ghosts could age people WYCI...
120120
/// </summary>
121-
[DataField("maxAge")]
121+
[DataField]
122122
public int MaxAge = 120;
123+
124+
/// <summary>
125+
/// The Style used for the guidebook info link in the character profile editor
126+
/// </summary>
127+
[DataField]
128+
public string GuideBookIcon = "SpeciesInfoDefault";
123129
}
124130

125131
public enum SpeciesNaming : byte

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Einstein Engines
22

3-
<p align="center"><img src="https://raw.githubusercontent.com/Simple-Station/Einstein-Engines/master/Resources/Textures/Logo/splashlogo.png" width="1080px" /></p>
3+
<p align="center"><img src="https://raw.githubusercontent.com/Simple-Station/Einstein-Engines/master/Resources/Textures/Logo/splashlogo.png" width="512px" /></p>
44

55
---
66

0 commit comments

Comments
 (0)