From a8be340925e0e5722b5271bd91f414ae23ec665d Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 3 Jan 2024 22:46:19 -0300 Subject: [PATCH] fix constructs follow-up pr --- code/_onclick/hud/hud.dm | 8 +++++++- code/modules/mob/living/simple_animal/constructs.dm | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 740174138d..798acad4aa 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -340,6 +340,11 @@ GLOBAL_LIST_INIT(available_ui_styles, list( return /datum/hud/proc/position_action(atom/movable/screen/movable/action_button/button, position) + // This is kinda a hack, I'm sorry. + // Basically, FLOATING is never a valid position to pass into this proc. It exists as a generic marker for manually positioned buttons + // Not as a position to target + if(position == SCRN_OBJ_FLOATING) + return if(button.location != SCRN_OBJ_DEFAULT) hide_action(button) switch(position) @@ -429,7 +434,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list( if(!button) action.ShowTo(mymob) button = action.viewers[src] - position_action(button, button.location) + else + position_action(button, button.location) /datum/action_group /// The hud we're owned by diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index a65e7a71da..5f6c7a8bb2 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -63,6 +63,8 @@ spellnum++ if(runetype) var/pos = 2+spellnum*31 + if(construct_spells.len >= 4) + pos -= 31*(construct_spells.len - 4) our_rune = new runetype(src) our_rune.default_button_position = "6:[pos],4:-2" // Set the default position to this random position our_rune.Grant(src)