Skip to content

Commit

Permalink
Latest changes from my repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr0maks committed Aug 7, 2023
1 parent 5373726 commit da56a76
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 83 deletions.
53 changes: 25 additions & 28 deletions Content.Client/Power/APC/UI/ApcMenu.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:style="clr-namespace:Content.Client.Stylesheets"
Expand All @@ -22,6 +22,30 @@
<BoxContainer Orientation="Horizontal" MinWidth="90">
<Button Name="BreakerButton" Text="{Loc 'apc-menu-breaker-button'}" HorizontalExpand="True"/>
</BoxContainer>
<!-- Cover Locked/Unlocked -->
<Label Text="{Loc 'apc-menu-cover-label'}" HorizontalExpand="True"
StyleClasses="StatusFieldTitle" MinWidth="120"/>
<BoxContainer Orientation="Horizontal" MinWidth="90">
<Button Name="CoverButton" Text="{Loc 'apc-menu-cover-button'}" HorizontalExpand="True"/>
</BoxContainer>
<!-- Channel panel mode -->
<Label Name="CEquipmentLabel" Text="{Loc 'apc-menu-equipment'}" HorizontalExpand="True"
StyleClasses="StatusFieldTitle" MinWidth="120"/>
<BoxContainer Orientation="Horizontal" MinWidth="90">
<OptionButton Name="CEquipmentButton" HorizontalExpand="True"/>
</BoxContainer>
<Label Name="CLightingLabel" Text="{Loc 'apc-menu-lighting'}" HorizontalExpand="True"
StyleClasses="StatusFieldTitle" MinWidth="120"/>
<BoxContainer Orientation="Horizontal" MinWidth="90">
<OptionButton Name="CLightingButton" HorizontalExpand="True"/>
</BoxContainer>
<Label Name="CEnvironmentLabel" Text="{Loc 'apc-menu-environment'}" HorizontalExpand="True"
StyleClasses="StatusFieldTitle" MinWidth="120"/>
<BoxContainer Orientation="Horizontal" MinWidth="90">
<OptionButton Name="CEnvironmentButton" HorizontalExpand="True"/>
</BoxContainer>
<Label Name="CTotalLabel" Text="{Loc 'apc-menu-environment'}" HorizontalExpand="True"
StyleClasses="StatusFieldTitle" MinWidth="120"/>
<!--Charging Status-->
<Label Text="{Loc 'apc-menu-external-label'}" StyleClasses="StatusFieldTitle" MinWidth="120" />
<Label Name="ExternalPowerStateLabel" Text="{Loc 'apc-menu-power-state-good'}" />
Expand Down Expand Up @@ -55,32 +79,5 @@
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/>
</BoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'apc-menu-breaker-label'}"/>
<Button Name="BreakerButton" Text="{Loc 'apc-menu-breaker-button-blank'}"></Button>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'apc-menu-external-label'}"/>
<Label Name="ExternalPowerStateLabel" Text="{Loc 'apc-menu-power-state-good'}"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'apc-menu-cover-label'}"/>
<Button Name="CoverButton" Text="{Loc 'apc-menu-cover-button-blank'}"></Button>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Name = "CEquipmentLabel" Text="{Loc 'apc-menu-equipment-blank'}" Margin="0 0 2 0" />
<OptionButton Name="CEquipmentButton" HorizontalExpand="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Name = "CLightingLabel" Text="{Loc 'apc-menu-lighting-blank'}" Margin="0 0 2 0" />
<OptionButton Name="CLightingButton" HorizontalExpand="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Name = "CEnvironmentLabel" Text="{Loc 'apc-menu-environment-blank'}" Margin="0 0 2 0" />
<OptionButton Name="CEnvironmentButton" HorizontalExpand="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Name = "CTotalLabel" Text="{Loc 'apc-menu-total-blank'}" Margin="0 0 2 0" />
</BoxContainer>
</BoxContainer>
</controls:FancyWindow>
4 changes: 4 additions & 0 deletions Content.Client/Power/APC/UI/ApcMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using FancyWindow = Content.Client.UserInterface.Controls.FancyWindow;

namespace Content.Client.Power.APC.UI
Expand Down
22 changes: 9 additions & 13 deletions Content.Server/Power/EntitySystems/ApcSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.APC;
using Content.Shared.Containers.ItemSlots;
*/
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.APC;
Expand Down Expand Up @@ -400,7 +400,6 @@ public void ApcChangeEnvironmentChannel(EntityUid uid, ApcPowerChannelState news
SoundSystem.Play(apc.OnReceiveMessageSound.GetSound(), Filter.Pvs(uid), uid, AudioParams.Default.WithVolume(-2f));
}

private void OnEmagged(EntityUid uid, ApcComponent comp, GotEmaggedEvent args)
private void OnEmagged(EntityUid uid, ApcComponent comp, ref GotEmaggedEvent args)
{
// no fancy conditions
Expand Down Expand Up @@ -515,9 +514,6 @@ public ApcChargeState CalcChargeState(EntityUid uid,
if (!Resolve(uid, ref apc))
return ApcChargeState.Lack;

if (apc != null && HasComp<EmaggedComponent>(uid))
return ApcChargeState.Emag;

if(!_cellSystem.TryGetBatteryFromSlot(uid, out battery))
return ApcChargeState.Lack;

Expand Down Expand Up @@ -559,21 +555,21 @@ public ApcExternalPowerState CalcExtPowerState(EntityUid uid,
return ApcExternalPowerState.Good;
}

public static ApcPanelState GetPanelState(ApcComponent apc)
public static ApcPanelState GetPanelState(EntityUid uid, ApcComponent apc)
{
if (apc.MaintaincePanelOpened)
return ApcPanelState.Maintaince;

if(apc.Emagged)
/*
if (HasComp<EmaggedComponent>(apc.Owner))
return ApcPanelState.Emag;

*/
if (apc.IsApcOpen)
return ApcPanelState.Open;
else
return ApcPanelState.Closed;
}

public static ApcLockState GetLockState(ApcComponent apc)
public static ApcLockState GetLockState(EntityUid uid, ApcComponent apc)
{
return apc.MaintaincePanelUnlocked switch
{
Expand All @@ -584,7 +580,7 @@ public static ApcLockState GetLockState(ApcComponent apc)

private void OnApcAltVerb(EntityUid uid, ApcComponent component, GetVerbsEvent<AlternativeVerb> args)
{
if(component.MaintaincePanelUnlocked)
if (component.MaintaincePanelUnlocked)
{
args.Verbs.Add(new AlternativeVerb()
{
Expand Down Expand Up @@ -642,11 +638,11 @@ private void UpdatePanelAppearance(EntityUid uid, AppearanceComponent? appearanc
if (!Resolve(uid, ref appearance, ref apc, false))
return;

_appearance.SetData(uid, ApcVisuals.PanelState, GetPanelState(apc));
_appearance.SetData(uid, ApcVisuals.PanelState, GetPanelState(uid, apc));
_appearance.SetData(uid, ApcVisuals.EquipmentChannelState, apc.EquipmentChannelState);
_appearance.SetData(uid, ApcVisuals.LightingChannelState, apc.LightingChannelState);
_appearance.SetData(uid, ApcVisuals.EnvironmentChannelState, apc.EnvironmentChannelState);
_appearance.SetData(uid, ApcVisuals.LockState, GetLockState(apc));
_appearance.SetData(uid, ApcVisuals.LockState, GetLockState(uid, apc));
}

private sealed class ApcToolFinishedEvent : EntityEventArgs
Expand Down
28 changes: 11 additions & 17 deletions Resources/Locale/en-US/ui/power-apc.ftl
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
apc-menu-title = APC
apc-menu-breaker-label = Main Breaker:{" "}
apc-menu-breaker-label = Main Breaker
apc-menu-breaker-button = Toggle
apc-menu-breaker-button-on = On
apc-menu-breaker-button-off = Off
apc-menu-breaker-button-blank = Error
apc-menu-cover-label = Cover Lock:{" "}
apc-menu-cover-label = Cover Lock
apc-menu-cover-button = Toggle
apc-menu-cover-button-engaged = Engaged
apc-menu-cover-button-disengaged = Disengaged
apc-menu-cover-button-blank = Error
apc-menu-equipment = Equipment: { POWERWATTS($power) }
apc-menu-lighting = Lighting: { POWERWATTS($power) }
apc-menu-environment = Environment: { POWERWATTS($power) }
apc-menu-total = Total: { POWERWATTS($power) }
apc-menu-modes-on = On
apc-menu-modes-off = Off
apc-menu-modes-auto = Auto
apc-menu-equipment = Equipment: { POWERWATTS($power) } { " " }
apc-menu-equipment-blank = Equipment: { "" } { " " }
apc-menu-lighting = Lighting: { POWERWATTS($power) } { " " }
apc-menu-lighting-blank = Lighting: { "" } { " " }
apc-menu-environment = Environment: { POWERWATTS($power) } { " " }
apc-menu-environment-blank = Environment: { " " } { " " }
apc-menu-total = Total: { POWERWATTS($power) }
apc-menu-total-blank = Total: { " " }
apc-menu-external-label = External Power:{" "}
apc-menu-charge-label = Charge:{" "}
#New
apc-menu-breaker-label = Main Breaker
apc-menu-breaker-button = Toggle
apc-menu-power-label = Battery Power
apc-menu-external-label = External Power
apc-menu-charge-label = {$percent} Charged
Expand Down
44 changes: 23 additions & 21 deletions Resources/Locale/ru-RU/ui/power-apc.ftl
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
apc-menu-title = ЛКП
apc-menu-breaker-label = Рубильник:{ " " }
apc-menu-title = APC
apc-menu-breaker-label = Main Breaker
apc-menu-breaker-button = Toggle
apc-menu-breaker-button-on = On
apc-menu-breaker-button-off = Off
apc-menu-breaker-button-blank = Error
apc-menu-cover-label = Cover Lock:{" "}
apc-menu-cover-label = Cover Lock
apc-menu-cover-button = Toggle
apc-menu-cover-button-engaged = Engaged
apc-menu-cover-button-disengaged = Disengaged
apc-menu-cover-button-blank = Error
apc-menu-equipment = Equipment: { POWERWATTS($power) }
apc-menu-lighting = Lighting: { POWERWATTS($power) }
apc-menu-environment = Environment: { POWERWATTS($power) }
apc-menu-total = Total: { POWERWATTS($power) }
apc-menu-modes-on = On
apc-menu-modes-off = Off
apc-menu-modes-auto = Auto
apc-menu-equipment = Equipment: { POWERWATTS($power) } { " " }
apc-menu-equipment-blank = Equipment: { "" } { " " }
apc-menu-lighting = Lighting: { POWERWATTS($power) } { " " }
apc-menu-lighting-blank = Lighting: { "" } { " " }
apc-menu-environment = Environment: { POWERWATTS($power) } { " " }
apc-menu-environment-blank = Environment: { " " } { " " }
apc-menu-total = Total: { POWERWATTS($power) }
apc-menu-total-blank = Total: { " " }
apc-menu-breaker-button = Переключить
apc-menu-power-label = Питание: { $power } Вт
apc-menu-external-label = Внешнее питание:{ " " }
apc-menu-charge-label = Заряд:{ " " }
apc-menu-power-label = Battery Power
apc-menu-external-label = External Power
apc-menu-charge-label = {$percent} Charged
# For the power state label

apc-menu-power-state-good = Хорошее
apc-menu-power-state-low = Слабое
apc-menu-power-state-none = Отсутствует
apc-menu-flavor-left = Свяжитесь с инженером для помощи.
apc-menu-power-state-good = Good
apc-menu-power-state-low = Low
apc-menu-power-state-none = None
# For the flavor text on the footer

apc-menu-flavor-left = Contact an engineer for assistance.
apc-menu-flavor-right = v1.1
16 changes: 12 additions & 4 deletions Resources/Prototypes/Entities/Objects/Power/powercells.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
- type: Sprite
layers:
- map: [ "enum.PowerCellVisualLayers.Base" ]
state: small
state: cell
- map: [ "enum.PowerCellVisualLayers.Unshaded" ]
state: o2
shader: unshaded
Expand Down Expand Up @@ -110,7 +110,7 @@
- type: Sprite
layers:
- map: [ "enum.PowerCellVisualLayers.Base" ]
state: medium
state: hcell
- map: [ "enum.PowerCellVisualLayers.Unshaded" ]
state: o2
shader: unshaded
Expand Down Expand Up @@ -154,7 +154,7 @@
- type: Sprite
layers:
- map: [ "enum.PowerCellVisualLayers.Base" ]
state: high
state: scell
- map: [ "enum.PowerCellVisualLayers.Unshaded" ]
state: o2
shader: unshaded
Expand Down Expand Up @@ -196,7 +196,7 @@
- type: Sprite
layers:
- map: [ "enum.PowerCellVisualLayers.Base" ]
state: hyper
state: hpcell
- map: [ "enum.PowerCellVisualLayers.Unshaded" ]
state: o2
shader: unshaded
Expand Down Expand Up @@ -230,6 +230,14 @@
suffix: Empty
parent: PowerCellBluespace
components:
- type: Sprite
layers:
- map: [ "enum.PowerCellVisualLayers.Base" ]
state: bscell
- map: [ "enum.PowerCellVisualLayers.Unshaded" ]
state: o2
shader: unshaded
visible: false
- type: Battery
maxCharge: 40000
chargeRate: 4000
Expand Down

0 comments on commit da56a76

Please sign in to comment.