1
1
using Content . Client . Info ;
2
2
using Content . Client . Info . PlaytimeStats ;
3
3
using Content . Client . Resources ;
4
+ using Content . Shared . CCVar ;
4
5
using Content . Shared . Preferences ;
5
6
using Robust . Client . AutoGenerated ;
6
7
using Robust . Client . Graphics ;
7
8
using Robust . Client . ResourceManagement ;
8
9
using Robust . Client . UserInterface ;
9
10
using Robust . Client . UserInterface . Controls ;
10
11
using Robust . Client . UserInterface . XAML ;
12
+ using Robust . Shared . Configuration ;
11
13
using Robust . Shared . Prototypes ;
12
14
13
15
namespace Content . Client . Lobby . UI
@@ -18,28 +20,23 @@ namespace Content.Client.Lobby.UI
18
20
[ GenerateTypedNameReferences ]
19
21
public sealed partial class CharacterSetupGui : Control
20
22
{
21
- private readonly IClientPreferencesManager _preferencesManager ;
22
- private readonly IEntityManager _entManager ;
23
- private readonly IPrototypeManager _protomanager ;
23
+ [ Dependency ] private readonly IClientPreferencesManager _preferencesManager = default ! ;
24
+ [ Dependency ] private readonly IEntityManager _entManager = default ! ;
25
+ [ Dependency ] private readonly IPrototypeManager _protomanager = default ! ;
26
+ [ Dependency ] private readonly IResourceCache _resourceCache = default ! ;
27
+ [ Dependency ] private readonly IConfigurationManager _cfg = default ! ;
24
28
25
29
private readonly Button _createNewCharacterButton ;
26
30
27
31
public event Action < int > ? SelectCharacter ;
28
32
public event Action < int > ? DeleteCharacter ;
29
33
30
- public CharacterSetupGui (
31
- IEntityManager entManager ,
32
- IPrototypeManager protoManager ,
33
- IResourceCache resourceCache ,
34
- IClientPreferencesManager preferencesManager ,
35
- HumanoidProfileEditor profileEditor )
34
+ public CharacterSetupGui ( HumanoidProfileEditor profileEditor )
36
35
{
37
36
RobustXamlLoader . Load ( this ) ;
38
- _preferencesManager = preferencesManager ;
39
- _entManager = entManager ;
40
- _protomanager = protoManager ;
37
+ IoCManager . InjectDependencies ( this ) ;
41
38
42
- var panelTex = resourceCache . GetTexture ( "/Textures/Interface/Nano/button.svg.96dpi.png" ) ;
39
+ var panelTex = _resourceCache . GetTexture ( "/Textures/Interface/Nano/button.svg.96dpi.png" ) ;
43
40
var back = new StyleBoxTexture
44
41
{
45
42
Texture = panelTex ,
@@ -56,7 +53,7 @@ public CharacterSetupGui(
56
53
57
54
_createNewCharacterButton . OnPressed += args =>
58
55
{
59
- preferencesManager . CreateCharacter ( HumanoidCharacterProfile . Random ( ) ) ;
56
+ _preferencesManager . CreateCharacter ( HumanoidCharacterProfile . Random ( ) ) ;
60
57
ReloadCharacterPickers ( ) ;
61
58
args . Event . Handle ( ) ;
62
59
} ;
@@ -65,6 +62,8 @@ public CharacterSetupGui(
65
62
RulesButton . OnPressed += _ => new RulesAndInfoWindow ( ) . Open ( ) ;
66
63
67
64
StatsButton . OnPressed += _ => new PlaytimeStatsWindow ( ) . OpenCentered ( ) ;
65
+
66
+ _cfg . OnValueChanged ( CCVars . SeeOwnNotes , p => AdminRemarksButton . Visible = p , true ) ;
68
67
}
69
68
70
69
/// <summary>
0 commit comments