Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds neck UI slot and rearranges inventory UI. #1130

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,31 +203,30 @@ void AddButton(Slots slot, string textureName, Vector2 position)
buttonDict.Add(slot, button);
}

const int size = ButtonSize;
const int sep = ButtonSeparation;
const int rSep = RightSeparation;
const int sizep = (ButtonSize + ButtonSeparation);

// Left column.
AddButton(Slots.EYES, "glasses", (0, size + sep));
AddButton(Slots.INNERCLOTHING, "uniform", (0, 2 * (size + sep)));
AddButton(Slots.EXOSUITSLOT1, "suit_storage", (0, 3 * (size + sep)));
AddButton(Slots.EYES, "glasses", (0, 0));
AddButton(Slots.NECK, "neck", (0, sizep));
AddButton(Slots.INNERCLOTHING, "uniform", (0, 2 * sizep));

// Middle column.
AddButton(Slots.HEAD, "head", (size + sep, 0));
AddButton(Slots.MASK, "mask", (size + sep, size + sep));
AddButton(Slots.OUTERCLOTHING, "suit", (size + sep, 2 * (size + sep)));
AddButton(Slots.SHOES, "shoes", (size + sep, 3 * (size + sep)));
AddButton(Slots.HEAD, "head", (sizep, 0));
AddButton(Slots.MASK, "mask", (sizep, sizep));
AddButton(Slots.OUTERCLOTHING, "suit", (sizep, 2 * sizep));
AddButton(Slots.SHOES, "shoes", (sizep, 3 * sizep));

// Right column
AddButton(Slots.EARS, "ears", (2 * (size + sep), 0));
AddButton(Slots.IDCARD, "id", (2 * (size + sep), size + sep));
AddButton(Slots.GLOVES, "gloves", (2 * (size + sep), 2 * (size + sep)));
AddButton(Slots.EARS, "ears", (2 * sizep, 0));
AddButton(Slots.IDCARD, "id", (2 * sizep, sizep));
AddButton(Slots.EXOSUITSLOT1, "suit_storage", (2 * sizep, 2 * sizep));
AddButton(Slots.POCKET1, "pocket", (2 * sizep, 3 * sizep));

// Far right column.
AddButton(Slots.BACKPACK, "back", (rSep + 3 * (size + sep), 0));
AddButton(Slots.BELT, "belt", (rSep + 3 * (size + sep), size + sep));
AddButton(Slots.POCKET1, "pocket", (rSep + 3 * (size + sep), 2 * (size + sep)));
AddButton(Slots.POCKET2, "pocket", (rSep + 3 * (size + sep), 3 * (size + sep)));
AddButton(Slots.BACKPACK, "back", (3 * sizep, 0));
AddButton(Slots.BELT, "belt", (3 * sizep, sizep));
AddButton(Slots.GLOVES, "gloves", (3 * sizep, 2 * sizep));
AddButton(Slots.POCKET2, "pocket", (3 * sizep, 3 * sizep));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public enum Slots
MASK,
OUTERCLOTHING,
INNERCLOTHING,
NECK,
BACKPACK,
BELT,
GLOVES,
Expand Down Expand Up @@ -69,17 +70,18 @@ public enum SlotFlags
MASK = 1 << 4,
OUTERCLOTHING = 1 << 5,
INNERCLOTHING = 1 << 6,
BACK = 1 << 7,
BACKPACK = 1 << 7,
BELT = 1 << 8,
GLOVES = 1 << 9,
HAND = 1 << 9,
IDCARD = 1 << 10,
POCKET = 1 << 11,
LEGS = 1 << 12,
SHOES = 1 << 13,
FEET = 1 << 13,
EXOSUITSTORAGE = 1 << 14
NECK = 1 << 7,
BACK = 1 << 8,
BACKPACK = 1 << 8,
BELT = 1 << 9,
GLOVES = 1 << 10,
HAND = 1 << 10,
IDCARD = 1 << 11,
POCKET = 1 << 12,
LEGS = 1 << 13,
SHOES = 1 << 14,
FEET = 1 << 14,
EXOSUITSTORAGE = 1 << 15
}

public static readonly IReadOnlyDictionary<Slots, string> SlotNames = new Dictionary<Slots, string>()
Expand All @@ -90,6 +92,7 @@ public enum SlotFlags
{Slots.MASK, "Mask"},
{Slots.OUTERCLOTHING, "Outer Clothing"},
{Slots.INNERCLOTHING, "Inner Clothing"},
{Slots.NECK, "Neck"},
{Slots.BACKPACK, "Backpack"},
{Slots.BELT, "Belt"},
{Slots.GLOVES, "Gloves"},
Expand Down Expand Up @@ -117,6 +120,7 @@ public enum SlotFlags
{Slots.MASK, SlotFlags.MASK},
{Slots.OUTERCLOTHING, SlotFlags.OUTERCLOTHING},
{Slots.INNERCLOTHING, SlotFlags.INNERCLOTHING},
{Slots.NECK, SlotFlags.NECK},
{Slots.BACKPACK, SlotFlags.BACK},
{Slots.BELT, SlotFlags.BELT},
{Slots.GLOVES, SlotFlags.GLOVES},
Expand All @@ -140,6 +144,7 @@ public enum SlotFlags
"Inventory_MASK",
"Inventory_OUTERCLOTHING",
"Inventory_INNERCLOTHING",
"Inventory_NECK",
"Inventory_BACKPACK",
"Inventory_BELT",
"Inventory_GLOVES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ public class HumanInventory : Inventory

private static readonly Dictionary<Slots, int> _slotDrawingOrder = new Dictionary<Slots, int>
{
{Slots.POCKET1, 12},
{Slots.POCKET2, 11},
{Slots.HEAD, 10},
{Slots.MASK, 9},
{Slots.EARS, 8},
{Slots.POCKET1, 13},
{Slots.POCKET2, 12},
{Slots.HEAD, 11},
{Slots.MASK, 10},
{Slots.EARS, 9},
{Slots.NECK, 8},
{Slots.BACKPACK, 7},
{Slots.EYES, 6},
{Slots.OUTERCLOTHING, 5},
Expand All @@ -46,9 +47,10 @@ public class HumanInventory : Inventory
public override IReadOnlyList<Slots> SlotMasks { get; } = new List<Slots>()
{
Slots.EYES, Slots.HEAD, Slots.EARS,
Slots.OUTERCLOTHING, Slots.MASK, Slots.INNERCLOTHING,
Slots.OUTERCLOTHING, Slots.MASK, Slots.INNERCLOTHING,
Slots.BACKPACK, Slots.BELT, Slots.GLOVES,
Slots.NONE, Slots.SHOES, Slots.IDCARD, Slots.POCKET1, Slots.POCKET2
Slots.NONE, Slots.SHOES, Slots.IDCARD, Slots.POCKET1, Slots.POCKET2,
Slots.NECK
};

public override int SlotDrawingOrder(Slots slot)
Expand Down
17 changes: 13 additions & 4 deletions Resources/Prototypes/Entities/Items/Clothing/cloaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Size: 10
QuickEquip: true
Slots:
- back
- neck
sprite: Clothing/cloak.rsi

- type: entity
Expand Down Expand Up @@ -42,7 +42,6 @@
- type: Clothing
HeldPrefix: hoscloak


- type: entity
parent: CloakClothing
id: CeCloak
Expand All @@ -55,7 +54,6 @@
- type: Clothing
HeldPrefix: cecloak


- type: entity
parent: CloakClothing
id: CmoCloak
Expand All @@ -80,7 +78,6 @@
- type: Clothing
HeldPrefix: rdcloak


- type: entity
parent: CloakClothing
id: QmCloak
Expand All @@ -104,3 +101,15 @@
state: hopcloak
- type: Clothing
HeldPrefix: hopcloak

- type: entity
parent: CloakClothing
id: HeraldCloak
name: Herald's cloak
components:
- type: Sprite
state: heraldcloak
- type: Icon
state: heraldcloak
- type: Clothing
HeldPrefix: heraldcloak
134 changes: 134 additions & 0 deletions Resources/Prototypes/Entities/Items/Clothing/neck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
- type: entity
parent: Clothing
id: NeckClothing
abstract: true
name: neck
description:
components:
- type: Sprite
sprite: Clothing/neck.rsi
- type: Icon
sprite: Clothing/neck.rsi
- type: Clothing
Size: 10
QuickEquip: true
Slots:
- neck
sprite: Clothing/neck.rsi

- type: entity
parent: NeckClothing
id: HeadPhonesOn
name: headphones
description:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No description of these from an existing codebase?

components:
- type: Sprite
state: headphones_on
- type: Icon
state: headphones_on
- type: Clothing
HeldPrefix: headphones_on

- type: entity
parent: NeckClothing
id: RedTie
name: red-tie
description:
components:
- type: Sprite
state: redtie
- type: Icon
state: redtie
- type: Clothing
HeldPrefix: redtie

- type: entity
parent: NeckClothing
id: DetTie
name: detective's tie
description:
components:
- type: Sprite
state: dettie
- type: Icon
state: dettie
- type: Clothing
HeldPrefix: dettie

- type: entity
parent: NeckClothing
id: Stethoscope
name: stethoscope
description:
components:
- type: Sprite
state: stethoscope
- type: Icon
state: stethoscope
- type: Clothing
HeldPrefix: stethoscope

- type: entity
parent: NeckClothing
id: StripedRedScarf
name: striped red scarf
description:
components:
- type: Sprite
state: stripedredscarf
- type: Icon
state: stripedredscarf
- type: Clothing
HeldPrefix: stripedredscarf

- type: entity
parent: NeckClothing
id: StripedBlueScarf
name: striped blue scarf
description:
components:
- type: Sprite
state: stripedbluescarf
- type: Icon
state: stripedbluescarf
- type: Clothing
HeldPrefix: stripedbluescarf

- type: entity
parent: NeckClothing
id: StripedGreenScarf
name: striped green scarf
description:
components:
- type: Sprite
state: stripedgreenscarf
- type: Icon
state: stripedgreenscarf
- type: Clothing
HeldPrefix: stripedgreenscarf

- type: entity
parent: NeckClothing
id: ZebraScarf
name: zebra scarf
description:
components:
- type: Sprite
state: zebrascarf
- type: Icon
state: zebrascarf
- type: Clothing
HeldPrefix: zebrascarf

- type: entity
parent: NeckClothing
id: Bling
name: bling
description:
components:
- type: Sprite
state: bling
- type: Icon
state: bling
- type: Clothing
HeldPrefix: bling
19 changes: 19 additions & 0 deletions Resources/Prototypes/Entities/Items/Consumables/food.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2988,3 +2988,22 @@
sprite: Objects/Food/stew.rsi
- type: Icon
sprite: Objects/Food/stew.rsi

- type: entity
parent: FoodBase
id: MilkApe
name: Milk Ape
# Milk Ape's a proper noun you fuck
description: He sighed for your grins.
components:
- type: Food
trash: TrashSnackBowl
- type: Solution
contents:
reagents:
- ReagentId: chem.Nutriment
Quantity: 20
- type: Sprite
sprite: Objects/Food/milkape.rsi
- type: Icon
sprite: Objects/Food/milkape.rsi
Loading