Adds job icons to the job list.

This commit is contained in:
Pieter-Jan Briers
2020-01-24 16:31:18 +01:00
parent 1dd4a5b48b
commit f95c5b7921
52 changed files with 370 additions and 9 deletions

View File

@@ -3,17 +3,21 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Content.Client.GameObjects.Components; using Content.Client.GameObjects.Components;
using Content.Client.Interfaces; using Content.Client.Interfaces;
using Content.Client.Utility;
using Content.Shared; using Content.Shared;
using Content.Shared.Jobs; using Content.Shared.Jobs;
using Content.Shared.Preferences; using Content.Shared.Preferences;
using Robust.Client.Graphics.Drawing; using Robust.Client.Graphics.Drawing;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.Utility;
using Robust.Shared.Interfaces.Random; using Robust.Shared.Interfaces.Random;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using static Content.Client.StaticIoC;
namespace Content.Client.UserInterface namespace Content.Client.UserInterface
{ {
@@ -148,19 +152,13 @@ namespace Content.Client.UserInterface
Text = localization.GetString("Male"), Text = localization.GetString("Male"),
Group = sexButtonGroup Group = sexButtonGroup
}; };
_sexMaleButton.OnPressed += args => _sexMaleButton.OnPressed += args => { SetSex(Sex.Male); };
{
SetSex(Sex.Male);
};
_sexFemaleButton = new Button _sexFemaleButton = new Button
{ {
Text = localization.GetString("Female"), Text = localization.GetString("Female"),
Group = sexButtonGroup Group = sexButtonGroup
}; };
_sexFemaleButton.OnPressed += args => _sexFemaleButton.OnPressed += args => { SetSex(Sex.Female); };
{
SetSex(Sex.Female);
};
hBox.AddChild(sexLabel); hBox.AddChild(sexLabel);
hBox.AddChild(_sexMaleButton); hBox.AddChild(_sexMaleButton);
hBox.AddChild(_sexFemaleButton); hBox.AddChild(_sexFemaleButton);
@@ -502,10 +500,23 @@ namespace Content.Client.UserInterface
PriorityChanged?.Invoke(Priority); PriorityChanged?.Invoke(Priority);
}; };
var icon = new TextureRect
{
TextureScale = (2, 2),
Stretch = TextureRect.StretchMode.KeepCentered
};
if (job.Icon != null)
{
var specifier = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/job_icons.rsi"), job.Icon);
icon.Texture = specifier.Frame0();
}
AddChild(new HBoxContainer AddChild(new HBoxContainer
{ {
Children = Children =
{ {
icon,
new Label {Text = job.Name, CustomMinimumSize = (175, 0)}, new Label {Text = job.Name, CustomMinimumSize = (175, 0)},
_optionButton _optionButton
} }

View File

@@ -3,7 +3,6 @@ using Content.Client.GameObjects;
using Content.Client.GameObjects.Components.Mobs; using Content.Client.GameObjects.Components.Mobs;
using Content.Client.Interfaces; using Content.Client.Interfaces;
using Content.Shared; using Content.Shared;
using Content.Shared.GameObjects.Components.Inventory;
using Content.Shared.Jobs; using Content.Shared.Jobs;
using Content.Shared.Preferences; using Content.Shared.Preferences;
using Robust.Client.Interfaces.GameObjects.Components; using Robust.Client.Interfaces.GameObjects.Components;

View File

@@ -39,6 +39,8 @@ namespace Content.Shared.Jobs
public string StartingGear { get; private set; } public string StartingGear { get; private set; }
public string Icon { get; private set; }
public IReadOnlyCollection<string> Department { get; private set; } public IReadOnlyCollection<string> Department { get; private set; }
public IReadOnlyCollection<string> Access { get; private set; } public IReadOnlyCollection<string> Access { get; private set; }
@@ -72,6 +74,11 @@ namespace Content.Shared.Jobs
{ {
Access = Array.Empty<string>(); Access = Array.Empty<string>();
} }
if (mapping.TryGetNode("icon", out var iconNode))
{
Icon = iconNode.AsString();
}
} }
} }
} }

View File

@@ -6,3 +6,6 @@
startingGear: AssistantGear startingGear: AssistantGear
department: department:
- Cargo - Cargo
icon: "CargoTechnician"

View File

@@ -6,6 +6,8 @@
department: department:
- Civilian - Civilian
icon: "Assistant"
access: access:
- maintenance - maintenance

View File

@@ -6,6 +6,8 @@
department: department:
- Civilian - Civilian
icon: "Clown"
- type: startingGear - type: startingGear
id: ClownGear id: ClownGear
equipment: equipment:

View File

@@ -6,6 +6,8 @@
department: department:
- Civilian - Civilian
icon: "Janitor"
access: access:
- service - service
- maintenance - maintenance

View File

@@ -7,6 +7,8 @@
department: department:
- Command - Command
icon: "Captain"
access: access:
# All of em. # All of em.
# Could probably do with some kind of wildcard or whatever to automate this. # Could probably do with some kind of wildcard or whatever to automate this.

View File

@@ -8,6 +8,8 @@
- Command - Command
- Civilian - Civilian
icon: "HeadOfPersonnel"
access: access:
- command - command
- idCard - idCard

View File

@@ -8,6 +8,8 @@
- Command - Command
- Engineering - Engineering
icon: "ChiefEngineer"
access: access:
- maintenance - maintenance
- engineering - engineering

View File

@@ -7,6 +7,8 @@
department: department:
- Engineering - Engineering
icon: "StationEngineer"
access: access:
- maintenance - maintenance
- engineering - engineering

View File

@@ -10,6 +10,8 @@
- Command - Command
- Medical - Medical
icon: "ChiefMedicalOfficer"
access: access:
- medical - medical
- command - command

View File

@@ -7,5 +7,7 @@
department: department:
- Medical - Medical
icon: "MedicalDoctor"
access: access:
- medical - medical

View File

@@ -8,6 +8,8 @@
- Command - Command
- Science - Science
icon: "ResearchDirector"
access: access:
- research - research
- command - command

View File

@@ -7,5 +7,7 @@
department: department:
- Science - Science
icon: "Scientist"
access: access:
- research - research

View File

@@ -8,6 +8,8 @@
- Command - Command
- Security - Security
icon: "HeadOfSecurity"
access: access:
- command - command
- security - security

View File

@@ -7,6 +7,8 @@
department: department:
- Security - Security
icon: "SecurityOfficer"
access: access:
- security - security
- maintenance - maintenance

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

View File

@@ -0,0 +1,315 @@
{
"version": 1,
"size": {
"x": 8,
"y": 8
},
"states": [
{
"name": "Detective",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "QuarterMaster",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Botanist",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "AtmosphericTechnician",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Nanotrasen",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Prisoner",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Janitor",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Chemist",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "StationEngineer",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "SecurityOfficer",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "NoId",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "ChiefMedicalOfficer",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Roboticist",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Chaplain",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Lawyer",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Unknown",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Librarian",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "CargoTechnician",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Scientist",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Geneticist",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Clown",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Captain",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "HeadOfPersonnel",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Virologist",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "ShaftMiner",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Assistant",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "ChiefEngineer",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Bartender",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "HeadOfSecurity",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "MedicalDoctor",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Chef",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Warden",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "ResearchDirector",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "Mime",
"directions": 1,
"delays": [
[
1.0
]
]
}
]
}