Skip to content

Commit

Permalink
fix event items after merge
Browse files Browse the repository at this point in the history
fix backpacks

replace NT flag

cryopod to new interface

Gemini lawyer chaged to iaa
  • Loading branch information
Werzet committed Dec 6, 2023
1 parent 15c5dfc commit 745e9e3
Show file tree
Hide file tree
Showing 22 changed files with 55 additions and 86 deletions.
61 changes: 23 additions & 38 deletions Content.Client/SS220/CryopodSSD/CryopodSSDBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,58 +1,45 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt

using Content.Client.Examine;
using Content.Client.Storage.UI;
using Content.Client.UserInterface.Controls;
using Content.Shared.Input;
using Content.Shared.SS220.CryopodSSD;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input;
using Content.Shared.Storage;
using Content.Client.Storage.Systems;

namespace Content.Client.SS220.CryopodSSD;

public sealed class CryopodSSDBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IEntityManager _entManager = default!;

private CryopodSSDWindow? _window = default!;
private StorageWindow? _storageWindow = default!;

private readonly StorageSystem _storage;

public CryopodSSDBoundUserInterface(EntityUid owner, Enum uikey) : base(owner, uikey)
{
IoCManager.InjectDependencies(this);

_storage = _entManager.System<StorageSystem>();
}

protected override void Open()
{
base.Open();

var entMan = IoCManager.Resolve<IEntityManager>();

_window = new CryopodSSDWindow();
_window.OnClose += Close;

_window.OpenCentered();

if (_storageWindow == null)
{
_storageWindow = new StorageWindow(entMan)
{
Title = entMan.GetComponent<MetaDataComponent>(Owner).EntityName
};

_storageWindow.EntityList.GenerateItem += _storageWindow.GenerateButton;
_storageWindow.EntityList.ItemPressed += InteractWithItem;

_storageWindow.OnClose += Close;
_storageWindow.OpenCenteredLeft();
}
else
if (_entManager.TryGetComponent<StorageComponent>(Owner, out var comp))
{
_storageWindow.Open();
_storage.OpenStorageUI(Owner, comp);
}

var entityMan = IoCManager.Resolve<IEntityManager>();
if (entityMan.TryGetComponent<StorageComponent>(Owner, out var storageComp))
_storageWindow?.BuildEntityList(Owner, storageComp);
}

public void InteractWithItem(BaseButton.ButtonEventArgs? args, ListData? cData)
Expand All @@ -62,7 +49,7 @@ public void InteractWithItem(BaseButton.ButtonEventArgs? args, ListData? cData)

var entMan = IoCManager.Resolve<IEntityManager>();

if (cData is not EntityListData {Uid: var entity})
if (cData is not EntityListData { Uid: var entity })
return;

if (args.Event.Function == EngineKeyFunctions.UIClick)
Expand All @@ -75,7 +62,7 @@ public void InteractWithItem(BaseButton.ButtonEventArgs? args, ListData? cData)
}
}

private void OnButtonPressed(GUIBoundKeyEventArgs args, EntityUid entity)
private static void OnButtonPressed(GUIBoundKeyEventArgs args, EntityUid entity)
{
var entitySys = IoCManager.Resolve<IEntitySystemManager>();

Expand All @@ -101,14 +88,19 @@ protected override void UpdateState(BoundUserInterfaceState state)
return;
}

if (_storageWindow is not null)
if (!castedState.HasAccess)
{
_storageWindow.Visible = castedState.HasAccess;
_storage.CloseStorageUI(Owner);
}

var entityMan = IoCManager.Resolve<IEntityManager>();
if (entityMan.TryGetComponent<StorageComponent>(Owner, out var storageComp))
_storageWindow?.BuildEntityList(Owner, storageComp);
//if (_storageWindow is not null)
//{
// _storageWindow.Visible = castedState.HasAccess;
//}

//var entityMan = IoCManager.Resolve<IEntityManager>();
//if (entityMan.TryGetComponent<StorageComponent>(Owner, out var storageComp))
// _storageWindow?.BuildEntityList(Owner, storageComp);
_window?.UpdateState(castedState);
}

Expand All @@ -121,15 +113,8 @@ protected override void Dispose(bool disposing)
return;
}

if (_storageWindow is not null)
{
_storageWindow.EntityList.GenerateItem -= _storageWindow.GenerateButton;
_storageWindow.EntityList.ItemPressed -= InteractWithItem;
_storageWindow.OnClose -= Close;
}
_storage.CloseStorageUI(Owner);

_storageWindow?.Dispose();
_storageWindow = null;
_window?.Close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ent-NTFlag = настенный флаг NanoTrasen
.desc = Синий флаг с логотипом NanoTrasen.
ent-BlankFlag = белый флаг
.desc = Кусок белой ткани. ОПРЕДЕЛЁННО не флаг Франции.
ent-SyndieFlag = флаг Синдиката
.desc = Воняет кровью. Смерть НТ!
ent-PirateFlag = пиратский флаг
.desc = Поднять Весёлого Роджера, бездельники!
2 changes: 1 addition & 1 deletion Resources/Maps/220_delta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212987,7 +212987,7 @@ entities:
pos: 29.5,-18.5
parent: 13307
type: Transform
- proto: SignNtFlag
- proto: NTFlag
entities:
- uid: 38546
components:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Maps/nox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185197,7 +185197,7 @@ entities:
- pos: -18.5,66.5
parent: 2
type: Transform
- proto: SignNtFlag
- proto: NTFlag
entities:
- uid: 27603
components:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Maps/ss220-box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162344,7 +162344,7 @@ entities:
- pos: 64.5,-36.5
parent: 8364
type: Transform
- proto: SignNtFlag
- proto: NTFlag
entities:
- uid: 29654
components:
Expand Down
4 changes: 2 additions & 2 deletions Resources/Maps/ss220_gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174271,7 +174271,7 @@ entities:
[color=blue][head=2] ArctiBio Haven [/head][/color]


Добро пожаловать в мир инноваций, где холод – лишь иллюзия! Воплотив в жизнь самые передовые технологии, мы создали окружение, где термометры стоят на уровне -10 градусов, но это не имеет никакого значения для вашего благополучия.
Добро пожаловать в мир инноваций, где холод – лишь иллюзия! Воплотив в жизнь самые передовые технологии, мы создали окружение, где термометры стоят на уровне -10 градусов, но это не имеет никакого значения для вашего благополучия.


Однако, несмотря на прорывы науки, мы все же рекомендуем поддерживать чувство комфорта: уютная теплая одежда станет вашим надежным союзником в борьбе с возможными болезнями.
Expand Down Expand Up @@ -198196,7 +198196,7 @@ entities:
pos: 2.5,-0.5
parent: 37842
type: Transform
- proto: SignNtFlag
- proto: NTFlag
entities:
- uid: 12924
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
components:
- type: Sprite
sprite: Corvax/Back/Backpacks/military.rsi
- type: Storage
maxTotalWeight: 32 # SS220 backpack-fix

- type: entity
parent: ClothingBackpack
Expand All @@ -17,8 +15,6 @@
components:
- type: Sprite
sprite: Corvax/Back/Backpacks/deathsquad-backpack.rsi
- type: Storage
maxTotalWeight: 60 # SS220 backpack-fix

- type: entity
parent: ClothingBackpack
Expand All @@ -28,5 +24,3 @@
components:
- type: Sprite
sprite: Corvax/Back/Backpacks/ce.rsi
- type: Storage
maxTotalWeight: 28 # SS220 backpack-fix
4 changes: 0 additions & 4 deletions Resources/Prototypes/Corvax/Entities/Clothing/Back/duffel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
components:
- type: Sprite
sprite: Corvax/Back/Duffels/military.rsi
- type: Storage
maxTotalWeight: 44 # SS220 backpack-fix

- type: entity
parent: ClothingBackpackDuffel
Expand All @@ -17,5 +15,3 @@
components:
- type: Sprite
sprite: Corvax/Back/Duffels/ce.rsi
- type: Storage
maxTotalWeight: 40 # SS220 backpack-fix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
components:
- type: Sprite
sprite: Corvax/Back/Satchels/military.rsi
- type: Storage
maxTotalWeight: 32 # SS220 backpack-fix

- type: entity
parent: ClothingBackpackSatchel
Expand All @@ -18,5 +16,3 @@
- type: Sprite
sprite: Corvax/Back/Satchels/ce.rsi
state: icon
- type: Storage
maxTotalWeight: 28 # SS220 backpack-fix
2 changes: 0 additions & 2 deletions Resources/Prototypes/Entities/Clothing/Back/duffel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@
name: syndicate duffel bag
description: A large duffel bag for holding various traitor goods.
components:
- type: Storage
maxTotalWeight: 44
- type: Sprite
sprite: Clothing/Back/Duffels/syndicate.rsi

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Maps/gemini.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Janitor: [ 4, 4 ]
Chaplain: [ 1, 2 ]
Librarian: [ 1, 2 ]
Lawyer: [ 2, 3 ]
IAA: [ 2, 3 ] # Corvax-IAA
Zookeeper: [ 1, 1 ]
ServiceWorker: [ 4, 4 ]
#engineering
Expand Down
3 changes: 2 additions & 1 deletion Resources/Prototypes/SS220/CryopodSSD/CryopodSSD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
- type: Transform
anchored: true
- type: Storage
maxSlots: 9999
grid:
- 0,0,20,10
maxItemSize: Ginormous
clickInsert: false
- type: ActivatableUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
- type: Sprite
sprite: SS220/Clothing/Back/Backpacks/ussp.rsi
- type: Storage
maxTotalWeight: 60
grid:
- 0,0,8,3
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
sprite: SS220/Structures/Decorations/signs.rsi
state: rest

- type: entity
parent: BaseSign
id: SignNtFlag
name: настенный флаг NanoTrasen
description: Синий флаг с логотипом NanoTrasen.
components:
- type: Sprite
sprite: SS220/Structures/Decorations/signs.rsi
state: ntflag

- type: entity
parent: BaseSign
id: PictureBobRoss
Expand Down
3 changes: 2 additions & 1 deletion Resources/Prototypes/SS220/Entities/Weapons/Guns/hosgun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
parent: BaseStorageItem
components:
- type: Storage
maxSlots: 4
grid:
- 0,0,4,1
maxItemSize: Small
- type: Item
size: Large
Expand Down
11 changes: 6 additions & 5 deletions Resources/Prototypes/SS220/Shitspawn/Ebent/CustomItems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
suffix: Shitspawn, Ebent
components:
- type: Storage
maxTotalWeight: 60
grid:
- 0,0,12,3

- type: entity
parent: ClothingHeadsetAltSyndicate
Expand All @@ -49,7 +50,7 @@
- type: StorageFill
contents:
- id: WeaponRevolverPython

#USSP
- type: entity
name: "фонарик СССП"
Expand Down Expand Up @@ -85,12 +86,12 @@
walkModifier: 1
sprintModifier: 1
enabled: false

- type: entity
name: энергетическая сабля
name: энергетическая сабля
parent: BaseItem
id: EnergySaberNT
description: Передовое оружие NanoTrasen для ведения ближнего боя.
description: Передовое оружие NanoTrasen для ведения ближнего боя.
suffix: Shitspawn, Ebent
components:
- type: EnergySword
Expand Down
4 changes: 1 addition & 3 deletions Resources/Prototypes/SS220/Shitspawn/Ebent/JobsERT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
name: рюкзак офицера безопасности ОБР
description: Вместительный рюкзак с множеством карманов, который носят офицеры безопасности отряда быстрого реагирования.
components:
- type: Storage
maxTotalWeight: 60
- type: StorageFill
contents:
- id: Crowbar
Expand Down Expand Up @@ -349,7 +347,7 @@
- type: entity
parent: ERTLeaderPDA
name: КПК Главного Врача Специальных Операций
description: Имеет встроенный анализатор здоровья.
description: Имеет встроенный анализатор здоровья.
id: SpecOpsPDACMO
suffix: Shitspawn, Ebent, СпецОпер
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@
},
{
"name":"rest"
},
{
"name":"ntflag"
},
{
"name":"bobross"
}
]
}
}
Binary file not shown.
Binary file modified Resources/Textures/Structures/Wallmounts/flags.rsi/NT_flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Derived by sprites from tgstation at https://github.com/tgstation/tgstation/commit/d0d81185f09ca30d3b0856d476544240dba0de53 and adapted by Saveliy360",
"copyright": "Derived by sprites from tgstation at https://github.com/tgstation/tgstation/commit/d0d81185f09ca30d3b0856d476544240dba0de53 and adapted by Saveliy360. NT_flag taken from Skyrat-tg at commit https://github.com/Skyrat-SS13/Skyrat-tg/tree/724d11274bf173044330ddc5f230c3abd80df8d2.",
"size": {
"x": 32,
"y": 32
Expand Down
3 changes: 3 additions & 0 deletions Resources/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,6 @@ GeneratorUraniumMachineCircuitboard: PortableGeneratorSuperPacmanMachineCircuitb

# SS220 2023-10-09
SignPsych: SignPsychology

# SS220 2023-12-06
SignNtFlag: NTFlag

0 comments on commit 745e9e3

Please sign in to comment.