From d8cd5903191f192906b02fef40ab267d628f93da Mon Sep 17 00:00:00 2001 From: Netzach Date: Mon, 19 Jan 2026 06:42:43 +0900 Subject: [PATCH 1/4] =?UTF-8?q?DAUUUUM=20=D0=BF=D0=BB=D1=8E=D1=88=D0=B5?= =?UTF-8?q?=D0=B2=D0=B0=D1=8F=20=D0=B8=D0=B3=D1=80=D1=83=D1=88=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=B8=20=D0=BF=D0=BE=D1=80=D1=82=D0=B0=D1=82=D0=B8=D0=B2?= =?UTF-8?q?=D0=BD=D1=8B=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=81=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=83=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=88=D0=B0=D1=82=D1=82=D0=BB=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit хакс дай нам _Shitmed хирургию --- .../Shuttles/UI/ShuttleConsoleWindow.xaml.cs | 11 +- .../Shuttles/Systems/ShuttleConsoleSystem.cs | 111 +++++++++++++++++- .../_Lua/Tools/Systems/ShuttleTabletSystem.cs | 63 ++++++++++ .../ShuttleBoundUserInterfaceState.cs | 10 +- .../Components/ShuttleTabletComponent.cs | 20 ++++ .../entities/Objects/Tools/shuttletablet.ftl | 27 +++++ .../Entities/Objects/Tools/shuttletablet.yml | 88 ++++++++++++++ .../handheldshuttleconsole.rsi/default.png | Bin 0 -> 550 bytes .../handheldshuttleconsole.rsi/meta.json | 23 ++++ .../handheldshuttleconsole.rsi/salvage.png | Bin 0 -> 546 bytes .../handheldshuttleconsole.rsi/security.png | Bin 0 -> 555 bytes .../handheldshuttleconsole.rsi/syndicate.png | Bin 0 -> 544 bytes 12 files changed, 344 insertions(+), 9 deletions(-) create mode 100644 Content.Server/_Lua/Tools/Systems/ShuttleTabletSystem.cs create mode 100644 Content.Shared/_Lua/Tools/Components/ShuttleTabletComponent.cs create mode 100644 Resources/Locale/ru-RU/_Lua/entities/Objects/Tools/shuttletablet.ftl create mode 100644 Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml create mode 100644 Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/default.png create mode 100644 Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/meta.json create mode 100644 Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/salvage.png create mode 100644 Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/security.png create mode 100644 Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/syndicate.png diff --git a/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml.cs b/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml.cs index 2b4684d1136..12153d68413 100644 --- a/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml.cs +++ b/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml.cs @@ -182,17 +182,18 @@ public enum ShuttleConsoleMode : byte public void UpdateState(EntityUid owner, ShuttleBoundUserInterfaceState cState) { - var coordinates = _entManager.GetCoordinates(cState.NavState.Coordinates); - NavContainer.SetShuttle(coordinates?.EntityId); + //var coordinates = _entManager.GetCoordinates(cState.NavState.Coordinates); // Lua + var shuttle = _entManager.GetEntity(cState.Shuttle); // Lua + NavContainer.SetShuttle(shuttle); // Lua NavContainer.SetConsole(owner); - MapContainer.SetShuttle(coordinates?.EntityId); + MapContainer.SetShuttle(shuttle); // Lua MapContainer.SetConsole(owner); - StarMapContainer.SetShuttle(coordinates?.EntityId); + StarMapContainer.SetShuttle(shuttle); // Lua StarMapContainer.SetConsole(owner); NavContainer.UpdateState(cState.NavState); MapContainer.UpdateState(cState.MapState); StarMapContainer.UpdateState(cState.StarMapState); - DockContainer.UpdateState(coordinates?.EntityId, cState.DockState); + DockContainer.UpdateState(shuttle, cState.DockState); } } diff --git a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs index 3407a0df1b8..32cf261ccd4 100644 --- a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs @@ -4,6 +4,10 @@ using Content.Server.Shuttles.Components; using Content.Server.Shuttles.Events; using Content.Server.Station.Systems; +using Content.Server.PowerCell; // Lua +using Content.Server.Power.Components; // Lua +using Content.Shared.Containers.ItemSlots; // Lua +using Content.Shared._Lua.Tools.Components; // Lua using Content.Shared._Lua.Starmap; using Content.Shared._NF.Shipyard.Components; using Content.Shared._NF.Shuttles.Events; // Frontier @@ -55,6 +59,10 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem [Dependency] private readonly IConfigurationManager _cfg = default!; // Lua [Dependency] private readonly ILogManager _log = default!; [Dependency] private readonly CrewedShuttleSystem _crewedShuttle = default!; + [Dependency] private readonly PowerCellSystem _cell = default!; // Lua + [Dependency] private readonly ItemSlotsSystem _slots = default!; // Lua + + private const string StructureTag = "Structure"; // Lua private ISawmill _sawmill = default!; @@ -136,6 +144,13 @@ private void OnStarMapVisibilityMessage(EntityUid uid, ShuttleConsoleComponent c private void OnConsoleGetVerbs(EntityUid uid, ShuttleConsoleComponent comp, GetVerbsEvent args) { + // Lua start + if (HasComp(uid)) + { + return; + } + // Lua end + AddPanicButtonVerb(uid, comp, args); AddPreventRemoverVerb(uid, comp, args); } @@ -255,12 +270,44 @@ private bool TryPilot(EntityUid user, EntityUid uid) if (!_tags.HasTag(user, CanPilotTag) || !TryComp(uid, out var component) || !this.IsPowered(uid, EntityManager) || - !Transform(uid).Anchored || + //!Transform(uid).Anchored || // Lua !_blocker.CanInteract(user, uid)) { return false; } + // Lua start + if (_tags.HasTag(uid, StructureTag) + && !Transform(uid).Anchored) + { + return false; + } + + if (!_cell.TryUseActivatableCharge(uid)) + { + return false; + } + + if (TryComp(uid, out var shuttleTabletComp)) + { + var card = _slots.GetItemOrNull(uid, "IDContainer"); + + if (card == null) + { + _popup.PopupEntity(Loc.GetString("shuttle-tablet-no-id"), uid); + return false; + } + + if (!TryComp(card, out var deedComp) + || deedComp == null) + { + _popup.PopupEntity(Loc.GetString("shuttle-tablet-no-deed"), uid); + return false; + } + } + // Lua end + + if (!_access.IsAllowed(user, uid)) // Frontier: check access return false; // Frontier @@ -436,6 +483,33 @@ private void UpdateState(EntityUid consoleUid, ref DockingInterfaceState? dockSt { EntityUid? entity = consoleUid; + // Lua start + if (_cell.HasActivatableCharge(consoleUid) + && !_cell.HasDrawCharge(consoleUid)) + { + _ui.CloseUi(consoleUid, ShuttleConsoleUiKey.Key); + return; + } + + if (TryComp(consoleUid, out var shuttleTabletComp)) + { + var card = _slots.GetItemOrNull(consoleUid, "IDContainer"); + + if (card == null) + { + _popup.PopupEntity(Loc.GetString("shuttle-tablet-no-id"), consoleUid); + return; + } + + if (!TryComp(card, out var deedComp) + || deedComp == null) + { + _popup.PopupEntity(Loc.GetString("shuttle-tablet-no-deed"), consoleUid); + return; + } + } + // Lua end + var getShuttleEv = new ConsoleShuttleEvent { Console = entity, @@ -470,7 +544,7 @@ private void UpdateState(EntityUid consoleUid, ref DockingInterfaceState? dockSt { var currentMap = consoleXform?.MapID ?? MapId.Nullspace; var starMapState = GetStarMapState(currentMap, shuttleGridUid, consoleUid); - _ui.SetUiState(consoleUid, ShuttleConsoleUiKey.Key, new ShuttleBoundUserInterfaceState(navState, mapState, dockState, starMapState)); + _ui.SetUiState(consoleUid, ShuttleConsoleUiKey.Key, new ShuttleBoundUserInterfaceState(navState, mapState, dockState, starMapState, GetNetEntity(shuttleGridUid))); // Lua } } @@ -527,6 +601,8 @@ public void AddPilot(EntityUid uid, EntityUid entity, ShuttleConsoleComponent co ActionBlockerSystem.UpdateCanMove(entity); pilotComponent.Position = Comp(entity).Coordinates; Dirty(entity, pilotComponent); + DockingInterfaceState? dockState = null; // Lua + UpdateState(uid, ref dockState); // Lua } public void RemovePilot(EntityUid pilotUid, PilotComponent pilotComponent) @@ -584,10 +660,39 @@ public NavInterfaceState GetNavState(Entity(); + var consoleFound = false; + + while (consoleQuery.MoveNext(out _, out var consoleTransform, out var receiverComp)) + { + if (consoleTransform.GridUid == gridUid && receiverComp.Powered) + { + coordinates = consoleTransform.Coordinates; + consoleFound = true; + break; + } + } + + if (!consoleFound) + { + _popup.PopupEntity(Loc.GetString("shuttle-tablet-no-remote-console"), entity); + } + } + // Lua end + return GetNavState( entity, docks, - entity.Comp2.Coordinates, + coordinates, // Lua entity.Comp2.LocalRotation, portNames); } diff --git a/Content.Server/_Lua/Tools/Systems/ShuttleTabletSystem.cs b/Content.Server/_Lua/Tools/Systems/ShuttleTabletSystem.cs new file mode 100644 index 00000000000..58e6c0fb9d6 --- /dev/null +++ b/Content.Server/_Lua/Tools/Systems/ShuttleTabletSystem.cs @@ -0,0 +1,63 @@ +// LuaWorld - This file is licensed under AGPLv3 +// Copyright (c) 2026 LuaWorld Contributors +// See AGPLv3.txt for details. + +using Robust.Server.GameObjects; +using Content.Shared._NF.GridAccess; +using Content.Shared._Lua.Tools.Components; +using Content.Shared.Containers.ItemSlots; +using Content.Shared._NF.Shipyard.Components; +using Content.Server.Shuttles.Components; + +namespace Content.Server._Lua.Tools.Systems; + +public sealed class ShuttleTabletSystem : EntitySystem +{ + [Dependency] private readonly TransformSystem _transformSystem = default!; + [Dependency] private readonly ItemSlotsSystem _slots = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnComponentInit); + SubscribeLocalEvent(OnComponentRemove); + } + + private void OnComponentInit(EntityUid uid, ShuttleTabletComponent component, ComponentInit args) + { + EnsureComp(uid); + EnsureComp(uid); + _slots.AddItemSlot(uid, "IDContainer", component.IDContainerSlot); + } + + private void OnComponentRemove(EntityUid uid, ShuttleTabletComponent component, ComponentRemove args) + { + RemComp(uid); + RemComp(uid); + _slots.TryEjectToHands(uid, component.IDContainerSlot, null); + _slots.RemoveItemSlot(uid, component.IDContainerSlot); + } + + public override void Update(float frameTime) + { + var query = EntityQueryEnumerator(); + + while (query.MoveNext(out var entity, out _, out var gridAccessComp, out var transformComp)) + { + var card = _slots.GetItemOrNull(entity, "IDContainer"); + + if (card == null) + { + continue; + } + + if (!TryComp(card, out var deedComp)) + { + continue; + } + + _transformSystem.SetGridId(entity, transformComp, deedComp.ShuttleUid); + } + } +} diff --git a/Content.Shared/Shuttles/BUIStates/ShuttleBoundUserInterfaceState.cs b/Content.Shared/Shuttles/BUIStates/ShuttleBoundUserInterfaceState.cs index b5c83588ed3..ed3bc9a4a41 100644 --- a/Content.Shared/Shuttles/BUIStates/ShuttleBoundUserInterfaceState.cs +++ b/Content.Shared/Shuttles/BUIStates/ShuttleBoundUserInterfaceState.cs @@ -11,12 +11,20 @@ public sealed class ShuttleBoundUserInterfaceState : BoundUserInterfaceState public ShuttleMapInterfaceState MapState; public DockingInterfaceState DockState; public StarmapConsoleBoundUserInterfaceState StarMapState; + public NetEntity? Shuttle; // Lua - public ShuttleBoundUserInterfaceState(NavInterfaceState navState, ShuttleMapInterfaceState mapState, DockingInterfaceState dockState, StarmapConsoleBoundUserInterfaceState starMapState) + public ShuttleBoundUserInterfaceState( + NavInterfaceState navState, + ShuttleMapInterfaceState mapState, + DockingInterfaceState dockState, + StarmapConsoleBoundUserInterfaceState starMapState, + NetEntity? shuttle // Lua + ) { NavState = navState; MapState = mapState; DockState = dockState; StarMapState = starMapState; + Shuttle = shuttle; // Lua } } diff --git a/Content.Shared/_Lua/Tools/Components/ShuttleTabletComponent.cs b/Content.Shared/_Lua/Tools/Components/ShuttleTabletComponent.cs new file mode 100644 index 00000000000..cbfc7547598 --- /dev/null +++ b/Content.Shared/_Lua/Tools/Components/ShuttleTabletComponent.cs @@ -0,0 +1,20 @@ +// LuaWorld - This file is licensed under AGPLv3 +// Copyright (c) 2026 LuaWorld Contributors +// See AGPLv3.txt for details. + +using Content.Shared.Containers.ItemSlots; + +namespace Content.Shared._Lua.Tools.Components; + +[RegisterComponent] +public sealed partial class ShuttleTabletComponent : Component +{ + [DataField] + public ItemSlot IDContainerSlot = new() + { + Whitelist = new() + { + Components = ["IdCard"] + } + }; +} diff --git a/Resources/Locale/ru-RU/_Lua/entities/Objects/Tools/shuttletablet.ftl b/Resources/Locale/ru-RU/_Lua/entities/Objects/Tools/shuttletablet.ftl new file mode 100644 index 00000000000..6f2d8f5dacc --- /dev/null +++ b/Resources/Locale/ru-RU/_Lua/entities/Objects/Tools/shuttletablet.ftl @@ -0,0 +1,27 @@ +ent-ShuttleControlTablet = планшет управления шаттла + .desc = Портативный планшет для удалённого управления шаттла. Имеет слот под ID карту. Для функционирования на шаттле должна находится хотя бы одна запитанная консоль. + +ent-ShuttleControlTabletEmpty = {ent-ShuttleControlTablet} + .desc = {ent-ShuttleControlTablet.desc} + .suffix = Без батареи + +ent-ShuttleControlTabletMicroreactor = {ent-ShuttleControlTablet} + .desc = {ent-ShuttleControlTablet.desc} + .suffix = Микрореакторная батарея + +ent-ShuttleControlTabletSalvage = {ent-ShuttleControlTablet} + .desc = {ent-ShuttleControlTablet.desc} + .suffix = Утилизаторский + +ent-ShuttleControlTabletSecurity = {ent-ShuttleControlTablet} + .desc = {ent-ShuttleControlTablet.desc} + .suffix = Служба безопасности + +ent-ShuttleControlTabletSyndicate = {ent-ShuttleControlTablet} + .desc = {ent-ShuttleControlTablet.desc} + .suffix = Синдикат + +shuttle-tablet-no-remote-console = На шаттле не найдена запитанная консоль. +shuttle-tablet-no-id = Вставьте ID карту. +shuttle-tablet-no-deed = На карте должен быть судовой акт на шаттл. +shuttle-tablet-no-power = Недостаточно питания. diff --git a/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml b/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml new file mode 100644 index 00000000000..52e1620bcc6 --- /dev/null +++ b/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml @@ -0,0 +1,88 @@ +# LuaWorld - This file is licensed under AGPLv3 +# Copyright (c) 2026 LuaWorld Contributors +# See AGPLv3.txt for details. + +- type: entity + name: shuttle control tablet + parent: BaseHandheldComputer + id: ShuttleControlTablet + description: A portable tablet for shuttle control. Has a slot for ID card. To function at least one powered console must be present at the shuttle. + components: + - type: Item + sprite: _Lua/Objects/Tools/handheldshuttleconsole.rsi + state: default + - type: Sprite + sprite: _Lua/Objects/Tools/handheldshuttleconsole.rsi + state: default + - type: ShuttleTablet + - type: ShuttleConsoleLock + locked: false + - type: ActivatableUI + key: enum.ShuttleConsoleUiKey.Key + - type: UserInterface + interfaces: + enum.ShuttleConsoleUiKey.Key: + type: ShuttleConsoleBoundUserInterface + - type: RadarConsole + maxRange: 512 + maxIffRange: 512 + - type: DetectionRangeMultiplier + infraredMultiplier: 2 + visualMultiplier: 16 + infraredOutlinePortion: 1.0 + - type: Appearance + - type: PowerCellDraw + drawRate: 1.5 + - type: StaticPrice + price: 250 + +- type: entity + id: ShuttleControlTabletMicroreactor + parent: ShuttleControlTablet + suffix: Microreactor + components: + - type: ItemSlots + slots: + cell_slot: + name: power-cell-slot-component-slot-name-default + startingItem: PowerCellMicroreactor + +- type: entity + id: ShuttleControlTabletEmpty + parent: ShuttleControlTablet + suffix: Empty + components: + - type: ItemSlots + slots: + cell_slot: + name: power-cell-slot-component-slot-name-default + +- type: entity + parent: ShuttleControlTablet + id: ShuttleControlTabletSalvage + suffix: Salvage + components: + - type: Item + state: salvage + - type: Sprite + state: salvage + +- type: entity + parent: ShuttleControlTablet + id: ShuttleControlTabletSecurity + suffix: Security + components: + - type: Item + state: security + - type: Sprite + state: security + +- type: entity + parent: ShuttleControlTablet + id: ShuttleControlTabletSyndicate + suffix: Syndicate + components: + - type: Item + state: syndicate + - type: Sprite + state: syndicate diff --git a/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/default.png b/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/default.png new file mode 100644 index 0000000000000000000000000000000000000000..65b7d076116bfadff543e2c8e7f388a66cd4562f GIT binary patch literal 550 zcmV+>0@?kEP)Px$;7LS5R9J=Wl`%-eP!NXysL(LgP~a zKI(j*x4D|{$39)07RoE!KxljlePa`@KIvc^&m9p*tSBvBPFa>2Aq0kDSXz(yhDW6r zk4i6k%r{GanOkw(H4FoU5XiFZxj&u_000tepp;sst|pOB9qBD#XH-iBR9gi z8frk(v^wo-e-r?)ytE2LhJ?QKwN#p(u(&i*1;QZJ4<0-u1lu8~y~+d(bou z>t@x|bsf=Y)N+&B**P3S|7CSqTL-ICvM+B#4HSz-i802q+3ZijiwD=(@8Wg}g#!0; zEW87sw>iB2b~ceprBJC<5C{aEXIB7~r)$gJ+S!7AYF_X^ oL^fQDyPW@_>AzziAD^c41>~`+B+80R>i_@%07*qoM6N<$g6D1ZaR2}S literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/meta.json b/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/meta.json new file mode 100644 index 00000000000..41048a78d14 --- /dev/null +++ b/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/meta.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "Made by discord: not_so_big_chungus", + "states": [ + { + "name": "salvage" + }, + { + "name": "security" + }, + { + "name": "syndicate" + }, + { + "name": "default" + } + ] +} diff --git a/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/salvage.png b/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/salvage.png new file mode 100644 index 0000000000000000000000000000000000000000..17b97ed4e82cbb4e79b79ed607c24d56d19bbad1 GIT binary patch literal 546 zcmV+-0^R+IP)Px$+(|@1R9Hu2WEfz;IKcKZj5=U61V%$(XoSGjsZ;-xQ(k0eXA|@wK?NYo4Gatz zczJojZs6eH!0VPDKYoDaKY#wraN)uQ211S?+5y2E4>E9@*#4&iav=U%e|zdW zAny4;200T;tPWsIa$~sX8V;9ZR@GuyB*{d%148t~z;PefGKZn?mmt^y(!ZWC?6I=| zTjp};1jAD{83vF8_I2%JP}n^aEDmx&KihkTMKvj4{+dg#aE3JAC;&NtM}Upt%ZFbK z=j+yj9RRY-&dv^O@S#J882-=O1s1D)^9C%I7?}-rfMHWG157VP4p32KXSj3!CyE2Y z!^0WU($W~5ot@zh0EGYyC_gw1b^uH-)g7>R?_P$LD_1hinl%gIfbhKt2M8abtph+I z00JOK;EMvPgaEcQ01AOimo70B78b%CusZ%3JOs?RXHzc?pyz_;9y%ylQF6x>a3b8> z^^rkwcN%qb0mw8^Nhm8T3(tnw3Ic5904N(ie*Bm^B_YTGX-BS*R1(gz(V?ybK)(6@ z{X4_YpFbJc+1c^Z0s;aIAV*U*1VDy;`0#7L%ffV0BE2 kVdSVCb--u{40s3t0I#wqFcR~U2mk;807*qoM6N<$g4%1|p#T5? literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/security.png b/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/security.png new file mode 100644 index 0000000000000000000000000000000000000000..5147f233e284e6eec9d7f576f438e4b6bde34f3a GIT binary patch literal 555 zcmV+`0@VG9P)Px$K5j7*TO>%m=$ce`C-{rfVPTb9M2!2kd=mrIPl==TA5kj(-Fq9%k5jOo01 zg<7dHnBluVIz+8hW486Npdz6CD`fpST)U1 zTOM6p+BcBg#&+{l03ZZTMJ0BHQo_uuxxVHw4e4efI^Z#pL%l9+7t_NB~Grs(s89Tl_ z%KODd;qO>_2d<9}>D=a9e}=kd#bUKvVkZ$k7P_tnnx-)v4yhK4T=e^xxm@Dexw>MU tBbtD438TndE_$pcnfr5`l9Doa{sJkTs9#CXT}S``002ovPDHLkV1fw?2o3-M literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/syndicate.png b/Resources/Textures/_Lua/Objects/Tools/handheldshuttleconsole.rsi/syndicate.png new file mode 100644 index 0000000000000000000000000000000000000000..7d14f1e28ce3413bdac570bcd318932696c1ab52 GIT binary patch literal 544 zcmV+*0^j|KP)Px$+DSw~R9J=WmA^|PK@`V7d$<}sIhI3YQ`xLwII_nb7OBJ^op9xq7Dia?t&bGv zzi=F+h#Xgi>+LjRtq4hLiZr=V(kpf)TRfoXm>+2`qYQ0X@bpiM*1Sh@^ zfOQ6Hd9b(H?Q-b4xS)g(|1E>|1RTd zW8)skhatc3?h@y|G@G%y=flu6>UlN>cKq i@g Date: Mon, 19 Jan 2026 07:38:58 +0900 Subject: [PATCH 2/4] Update shuttletablet.yml --- .../_Lua/Entities/Objects/Tools/shuttletablet.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml b/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml index 52e1620bcc6..a81213920b9 100644 --- a/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml +++ b/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml @@ -10,7 +10,6 @@ components: - type: Item sprite: _Lua/Objects/Tools/handheldshuttleconsole.rsi - state: default - type: Sprite sprite: _Lua/Objects/Tools/handheldshuttleconsole.rsi state: default @@ -62,8 +61,6 @@ id: ShuttleControlTabletSalvage suffix: Salvage components: - - type: Item - state: salvage - type: Sprite state: salvage @@ -72,8 +69,6 @@ id: ShuttleControlTabletSecurity suffix: Security components: - - type: Item - state: security - type: Sprite state: security @@ -82,7 +77,5 @@ id: ShuttleControlTabletSyndicate suffix: Syndicate components: - - type: Item - state: syndicate - type: Sprite state: syndicate From 2153991b4b96601365b79cb88d451326e0741894 Mon Sep 17 00:00:00 2001 From: Netzach Date: Mon, 19 Jan 2026 23:24:36 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Shuttles/Systems/ShuttleConsoleSystem.cs | 36 +++++++++++------ .../_Lua/Tools/Systems/ShuttleTabletSystem.cs | 28 ++----------- .../Components/ShuttleTabletComponent.cs | 14 +------ .../entities/Objects/Tools/shuttletablet.ftl | 7 +++- .../Entities/Objects/Tools/shuttletablet.yml | 40 +++++++++++++++++++ 5 files changed, 74 insertions(+), 51 deletions(-) diff --git a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs index 759d84c3525..ad6fd8ed293 100644 --- a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs @@ -290,7 +290,7 @@ private bool TryPilot(EntityUid user, EntityUid uid) if (TryComp(uid, out var shuttleTabletComp)) { - var card = _slots.GetItemOrNull(uid, "IDContainer"); + var card = _slots.GetItemOrNull(uid, "id_container"); if (card == null) { @@ -307,7 +307,6 @@ private bool TryPilot(EntityUid user, EntityUid uid) } // Lua end - if (!_access.IsAllowed(user, uid)) // Frontier: check access return false; // Frontier @@ -493,7 +492,7 @@ private void UpdateState(EntityUid consoleUid, ref DockingInterfaceState? dockSt if (TryComp(consoleUid, out var shuttleTabletComp)) { - var card = _slots.GetItemOrNull(consoleUid, "IDContainer"); + var card = _slots.GetItemOrNull(consoleUid, "id_container"); if (card == null) { @@ -662,28 +661,41 @@ public NavInterfaceState GetNavState(Entity(entity.Owner, out _)) { var consoleQuery = EntityQueryEnumerator(); var consoleFound = false; - while (consoleQuery.MoveNext(out _, out var consoleTransform, out var receiverComp)) + while (consoleQuery.MoveNext(out var consoleUid, out _, out var consoleTransform, out var receiverComp)) { - if (consoleTransform.GridUid == gridUid && receiverComp.Powered) + if (consoleTransform.GridUid == entity.Comp2.GridUid && receiverComp.Powered) { - coordinates = consoleTransform.Coordinates; consoleFound = true; - break; + + if (!TryComp(consoleUid, out var lockComp) + || !lockComp.EmergencyLocked) + { + coordinates = consoleTransform.Coordinates; + break; + } + + if (consoleComp != null) + { + ClearPilots(consoleComp); + } + + _popup.PopupEntity(Loc.GetString("shuttle-tablet-emergency-locked"), entity); } } if (!consoleFound) { + if (consoleComp != null) + { + ClearPilots(consoleComp); + } + _popup.PopupEntity(Loc.GetString("shuttle-tablet-no-remote-console"), entity); } } diff --git a/Content.Server/_Lua/Tools/Systems/ShuttleTabletSystem.cs b/Content.Server/_Lua/Tools/Systems/ShuttleTabletSystem.cs index 58e6c0fb9d6..9ea17b92b0a 100644 --- a/Content.Server/_Lua/Tools/Systems/ShuttleTabletSystem.cs +++ b/Content.Server/_Lua/Tools/Systems/ShuttleTabletSystem.cs @@ -3,11 +3,9 @@ // See AGPLv3.txt for details. using Robust.Server.GameObjects; -using Content.Shared._NF.GridAccess; -using Content.Shared._Lua.Tools.Components; using Content.Shared.Containers.ItemSlots; +using Content.Shared._Lua.Tools.Components; using Content.Shared._NF.Shipyard.Components; -using Content.Server.Shuttles.Components; namespace Content.Server._Lua.Tools.Systems; @@ -19,33 +17,15 @@ public sealed class ShuttleTabletSystem : EntitySystem public override void Initialize() { base.Initialize(); - - SubscribeLocalEvent(OnComponentInit); - SubscribeLocalEvent(OnComponentRemove); - } - - private void OnComponentInit(EntityUid uid, ShuttleTabletComponent component, ComponentInit args) - { - EnsureComp(uid); - EnsureComp(uid); - _slots.AddItemSlot(uid, "IDContainer", component.IDContainerSlot); - } - - private void OnComponentRemove(EntityUid uid, ShuttleTabletComponent component, ComponentRemove args) - { - RemComp(uid); - RemComp(uid); - _slots.TryEjectToHands(uid, component.IDContainerSlot, null); - _slots.RemoveItemSlot(uid, component.IDContainerSlot); } public override void Update(float frameTime) { - var query = EntityQueryEnumerator(); + var query = EntityQueryEnumerator(); - while (query.MoveNext(out var entity, out _, out var gridAccessComp, out var transformComp)) + while (query.MoveNext(out var entity, out _, out var transformComp)) { - var card = _slots.GetItemOrNull(entity, "IDContainer"); + var card = _slots.GetItemOrNull(entity, "id_container"); if (card == null) { diff --git a/Content.Shared/_Lua/Tools/Components/ShuttleTabletComponent.cs b/Content.Shared/_Lua/Tools/Components/ShuttleTabletComponent.cs index cbfc7547598..fbdb19cfbe6 100644 --- a/Content.Shared/_Lua/Tools/Components/ShuttleTabletComponent.cs +++ b/Content.Shared/_Lua/Tools/Components/ShuttleTabletComponent.cs @@ -2,19 +2,7 @@ // Copyright (c) 2026 LuaWorld Contributors // See AGPLv3.txt for details. -using Content.Shared.Containers.ItemSlots; - namespace Content.Shared._Lua.Tools.Components; [RegisterComponent] -public sealed partial class ShuttleTabletComponent : Component -{ - [DataField] - public ItemSlot IDContainerSlot = new() - { - Whitelist = new() - { - Components = ["IdCard"] - } - }; -} +public sealed partial class ShuttleTabletComponent : Component; diff --git a/Resources/Locale/ru-RU/_Lua/entities/Objects/Tools/shuttletablet.ftl b/Resources/Locale/ru-RU/_Lua/entities/Objects/Tools/shuttletablet.ftl index 6f2d8f5dacc..6d1cd451e9b 100644 --- a/Resources/Locale/ru-RU/_Lua/entities/Objects/Tools/shuttletablet.ftl +++ b/Resources/Locale/ru-RU/_Lua/entities/Objects/Tools/shuttletablet.ftl @@ -1,5 +1,5 @@ -ent-ShuttleControlTablet = планшет управления шаттла - .desc = Портативный планшет для удалённого управления шаттла. Имеет слот под ID карту. Для функционирования на шаттле должна находится хотя бы одна запитанная консоль. +ent-ShuttleControlTablet = планшет управления шаттлом + .desc = Портативный планшет для удалённого управления шаттлом. Имеет слот под ID карту. Для функционирования на шаттле должна находится хотя бы одна запитанная консоль. ent-ShuttleControlTabletEmpty = {ent-ShuttleControlTablet} .desc = {ent-ShuttleControlTablet.desc} @@ -21,7 +21,10 @@ ent-ShuttleControlTabletSyndicate = {ent-ShuttleControlTablet} .desc = {ent-ShuttleControlTablet.desc} .suffix = Синдикат +shuttle-tablet-id-slot = Слот ID карты + shuttle-tablet-no-remote-console = На шаттле не найдена запитанная консоль. shuttle-tablet-no-id = Вставьте ID карту. shuttle-tablet-no-deed = На карте должен быть судовой акт на шаттл. shuttle-tablet-no-power = Недостаточно питания. +shuttle-tablet-emergency-locked = Консоль аварийно заблокирована. diff --git a/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml b/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml index a81213920b9..dd9a69e870f 100644 --- a/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml +++ b/Resources/Prototypes/_Lua/Entities/Objects/Tools/shuttletablet.yml @@ -14,6 +14,8 @@ sprite: _Lua/Objects/Tools/handheldshuttleconsole.rsi state: default - type: ShuttleTablet + - type: ShuttleConsole + zoom: 1.0, 1.0 - type: ShuttleConsoleLock locked: false - type: ActivatableUI @@ -30,6 +32,32 @@ visualMultiplier: 16 infraredOutlinePortion: 1.0 - type: Appearance + - type: ItemSlots + slots: + id_container: + name: shuttle-tablet-id-slot + priority: 3 + whitelist: + components: + - IdCard + cell_slot: + name: power-cell-slot-component-slot-name-default + startingItem: PowerCellSmall + - type: ContainerContainer + containers: + id_container: !type:ContainerSlot + cell_slot: !type:ContainerSlot + - type: DeviceLinkSource + ports: + - device-button-1 + - device-button-2 + - device-button-3 + - device-button-4 + - device-button-5 + - device-button-6 + - device-button-7 + - device-button-8 + range: 3 - type: PowerCellDraw drawRate: 1.5 - type: StaticPrice @@ -42,6 +70,12 @@ components: - type: ItemSlots slots: + id_container: + name: shuttle-tablet-id-slot + priority: 3 + whitelist: + components: + - IdCard cell_slot: name: power-cell-slot-component-slot-name-default startingItem: PowerCellMicroreactor @@ -53,6 +87,12 @@ components: - type: ItemSlots slots: + id_container: + name: shuttle-tablet-id-slot + priority: 3 + whitelist: + components: + - IdCard cell_slot: name: power-cell-slot-component-slot-name-default From 3ca63f96299b992d8f5df667a5d75fa4baf679fb Mon Sep 17 00:00:00 2001 From: HacksLua Date: Sat, 31 Jan 2026 21:07:41 +0700 Subject: [PATCH 4/4] =?UTF-8?q?=D0=9F=D0=B0=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B4=D0=B5=D0=B1=D0=B0=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/PowerCell/PowerCellSystem.cs | 4 ++-- runall.bat | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Server/PowerCell/PowerCellSystem.cs b/Content.Server/PowerCell/PowerCellSystem.cs index 5a1019f023f..20f2705b6a4 100644 --- a/Content.Server/PowerCell/PowerCellSystem.cs +++ b/Content.Server/PowerCell/PowerCellSystem.cs @@ -252,8 +252,8 @@ private void OnCellEmpAttempt(EntityUid uid, PowerCellComponent component, EmpAt private void OnCellSlotExamined(EntityUid uid, PowerCellSlotComponent component, ExaminedEvent args) { - TryGetBatteryFromSlot(uid, out var battery); - OnBatteryExamined(uid, battery, args); + if (TryGetBatteryFromSlot(uid, out var batteryEnt, out var battery) && batteryEnt != null && battery != null) OnBatteryExamined(batteryEnt.Value, battery, args); + else OnBatteryExamined(uid, null, args); } public void OnBatteryExamined(EntityUid uid, BatteryComponent? component, ExaminedEvent args) // WD EDIT diff --git a/runall.bat b/runall.bat index 38ea1e598bd..47940b8595a 100644 --- a/runall.bat +++ b/runall.bat @@ -2,6 +2,6 @@ set PDIR=%~dp0 cd %PDIR%Bin\Content.Server start Content.Server.exe cd %PDIR%Bin\Content.Client -start Content.Client.exe +call Content.Client.exe cd %PDIR% set PDIR= \ No newline at end of file