Skip to content

Commit

Permalink
ui & fixture fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirus59 committed Jan 4, 2025
1 parent 065be24 commit 76c3695
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt -->
<!-- © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt -->
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
Title="{Loc 'cooking-machine-menu-title'}"
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/SS220/SupaKitchen/CookingMachineSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@ public void StartCooking(EntityUid uid, CookingMachineComponent component, Entit
_audio.PlayPvs(component.BeginCookingSound, uid);
component.CookTimeRemaining = component.CookingTimer * component.CookTimeMultiplier;
component.CurrentlyCookingRecipe = portionedRecipe;
UpdateUserInterfaceState(uid, component);

SetAppearance(uid, CookingMachineVisualState.Cooking, component);

var audioStream = _audio.PlayPvs(component.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5));
component.PlayingStream = audioStream?.Entity;

component.Active = true;
UpdateUserInterfaceState(uid, component);
}

public void StopCooking(EntityUid uid, CookingMachineComponent component)
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/UserInterface/ActivatableUIComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ public sealed partial class ActivatableUIComponent : Component
// SS220 Alternative-open-verb
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool AltentativeOnly = false;
public bool AltentativeVerbOnly = false;
}
}
15 changes: 9 additions & 6 deletions Content.Shared/UserInterface/ActivatableUISystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public override void Initialize()
SubscribeLocalEvent<ActivatableUIComponent, GotUnequippedHandEvent>(OnHandUnequipped);
SubscribeLocalEvent<ActivatableUIComponent, BoundUIClosedEvent>(OnUIClose);
SubscribeLocalEvent<ActivatableUIComponent, GetVerbsEvent<ActivationVerb>>(GetActivationVerb);
SubscribeLocalEvent<ActivatableUIComponent, GetVerbsEvent<AlternativeVerb>>(GetAlternativeVerb); // SS220 Alternative-open-verb
SubscribeLocalEvent<ActivatableUIComponent, GetVerbsEvent<Verb>>(GetVerb);

SubscribeLocalEvent<UserInterfaceComponent, OpenUiActionEvent>(OnActionPerform);
Expand Down Expand Up @@ -87,7 +88,7 @@ private void GetActivationVerb(EntityUid uid, ActivatableUIComponent component,
return;

// SS220 Alternative-open-verb
if (component.AltentativeOnly)
if (component.AltentativeVerbOnly)
return;

args.Verbs.Add(new ActivationVerb
Expand All @@ -105,7 +106,7 @@ private void GetVerb(EntityUid uid, ActivatableUIComponent component, GetVerbsEv
return;

// SS220 Alternative-open-verb
if (component.AltentativeOnly)
if (component.AltentativeVerbOnly)
return;

args.Verbs.Add(new Verb
Expand All @@ -120,10 +121,10 @@ private void GetVerb(EntityUid uid, ActivatableUIComponent component, GetVerbsEv
// SS220 Alternative-open-verb begin
private void GetAlternativeVerb(EntityUid uid, ActivatableUIComponent component, GetVerbsEvent<AlternativeVerb> args)
{
if (!component.VerbOnly || !ShouldAddVerb(uid, component, args))
if (component.VerbOnly || !ShouldAddVerb(uid, component, args))
return;

if (!component.AltentativeOnly)
if (!component.AltentativeVerbOnly)
return;

args.Verbs.Add(new AlternativeVerb
Expand Down Expand Up @@ -181,7 +182,8 @@ private void OnActivate(EntityUid uid, ActivatableUIComponent component, Activat
if (args.Handled || !args.Complex)
return;

if (component.VerbOnly)
if (component.VerbOnly ||
component.AltentativeVerbOnly) // SS220 Alternative-open-verb
return;

if (component.RequiredItems != null)
Expand All @@ -195,7 +197,8 @@ private void OnInteractUsing(EntityUid uid, ActivatableUIComponent component, In
if (args.Handled)
return;

if (component.VerbOnly)
if (component.VerbOnly ||
component.AltentativeVerbOnly) // SS220 Alternative-open-verb
return;

if (component.RequiredItems == null)
Expand Down
110 changes: 110 additions & 0 deletions Resources/Prototypes/Entities/Structures/Machines/microwave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,113 @@
# - RecipeBaguetteSword
# - RecipeThrowingCroissant
#SS220 remove default microwave end

- type: entity
id: KitchenMicrowaveOld
parent: [ BaseMachinePowered, SmallConstructibleMachine ]
name: microwave
description: It's magic.
components:
- type: Microwave #SS220 remove default microwave
capacity: 10
- type: Appearance
- type: GenericVisualizer
visuals:
enum.MicrowaveVisualState.Bloody:
bloody:
True: { visible: true }
False: { visible: false }
bloodyunshaded:
True: { visible: true }
False: { visible: false }
enum.PowerDeviceVisuals.VisualState:
enum.CookingMachineVisualizerLayers.Base:
Idle: { state: "mw" }
Broken: { state: "mwb" }
Cooking: { state: "mw" }
enum.CookingMachineVisualizerLayers.BaseUnlit:
Idle: { state: "mw_unlit" }
Broken: { state: "mw_unlit" }
Cooking: { state: "mw_running_unlit" }
bloodyunshaded:
Idle: { visible: false }
Broken: { visible: false }
enum.PowerDeviceVisuals.Powered:
enum.CookingMachineVisualizerLayers.BaseUnlit:
True: { visible: true }
False: { visible: false }
- type: ActivatableUI
key: enum.MicrowaveUiKey.Key
- type: DeviceLinkSink
ports:
- On
- type: DeviceNetwork
deviceNetId: Wireless
receiveFrequencyId: BasicDevice
- type: WirelessNetworkConnection
range: 200
- type: UserInterface
interfaces:
enum.MicrowaveUiKey.Key:
type: MicrowaveBoundUserInterface
- type: Physics
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.3,-0.16,0.3,0.16"
density: 190
mask:
- TabletopMachineMask
layer:
- TabletopMachineLayer
- type: Sprite
sprite: Structures/Machines/microwave.rsi
drawdepth: SmallObjects
snapCardinals: true
layers:
- state: mw0
map: ["enum.CookingMachineVisualizerLayers.Base"]
- state: mw_unlit
shader: unshaded
map: ["enum.CookingMachineVisualizerLayers.BaseUnlit"]
- state: mwbloody0
map: ["bloody"]
visible: false
- state: mwbloody1
shader: unshaded
map: ["bloodyunshaded"]
visible: false
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 100
behaviors:
- !type:DoActsBehavior
acts: ["Breakage"]
- type: Explosive
explosionType: Default
maxIntensity: 10
totalIntensity: 5
intensitySlope: 5
canCreateVacuum: false
deleteAfterExplosion: false
- type: ApcPowerReceiver
powerLoad: 400
- type: Machine
board: MicrowaveMachineCircuitboard
- type: ContainerContainer
containers:
# microwave_entity_container: !type:Container
cooking_machine_entity_container: !type:Container #SS220 supa kitchen
machine_board: !type:Container
machine_parts: !type:Container
- type: EmptyOnMachineDeconstruct
containers:
- microwave_entity_container
- type: GuideHelp
guides:
- Chef
- FoodRecipes
6 changes: 3 additions & 3 deletions Resources/Prototypes/SS220/SupaKitchen/Machines/grill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.3,-0.16,0.3,0.16"
bounds: "-0.4,-0.4,0.4,0.4"
density: 190
mask:
- TabletopMachineMask
- MachineMask
layer:
- TabletopMachineLayer
- MachineLayer
- type: Sprite
sprite: SS220/Structures/Machines/grill.rsi
snapCardinals: true
Expand Down
11 changes: 5 additions & 6 deletions Resources/Prototypes/SS220/SupaKitchen/Machines/oven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
components:
- type: Transform
noRot: true

# Make it behave like a closet
- type: EntityStorage
- type: EntityStorageVisuals
Expand All @@ -16,7 +15,6 @@
- type: PlaceableSurface
placeCentered: true
isPlaceable: false

- type: CookingInstrument
instrumentType: oven
- type: CookingMachine
Expand All @@ -26,7 +24,7 @@
useEntityStorage: true
- type: ActivatableUI
key: enum.CookingMachineUiKey.Key
altentativeOnly: true
altentativeVerbOnly: true
- type: UserInterface
interfaces:
enum.CookingMachineUiKey.Key:
Expand Down Expand Up @@ -57,12 +55,12 @@
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.3,-0.16,0.3,0.16"
bounds: "-0.4,-0.4,0.4,0.4"
density: 190
mask:
- TabletopMachineMask
- MachineMask
layer:
- TabletopMachineLayer
- MachineLayer
- type: Sprite
sprite: SS220/Structures/Machines/oven.rsi
offset: 0,-0.5
Expand All @@ -75,6 +73,7 @@
- state: oven_off
map: ["oven_toggle"]
- state: oven_on_unshaded
visible: false
map: ["oven_toggle_unshaded"]
shader: unshaded
- type: Destructible
Expand Down

0 comments on commit 76c3695

Please sign in to comment.