From 5bfaea4e099368a065b58413b4dfecdb101447e3 Mon Sep 17 00:00:00 2001 From: NullFag Date: Sun, 28 Jul 2024 18:17:08 +0200 Subject: [PATCH 1/4] WHAT DO YOU MEAN ITS A 86 FILE PR --- code/__DEFINES/~~~splurt_defines/hud.dm | 12 ++++++++ code/modules/mob/living/living_defense.dm | 4 +++ modular_zzplurt/code/modules/hud/_hud.dm | 8 ++++++ .../code/modules/hud/screen_objects.dm | 28 +++++++++++++++++++ .../modules/mob/living/carbon/human/human.dm | 3 ++ .../mob/living/carbon/human/human_defense.dm | 20 +++++++++++++ tgstation.dme | 3 ++ 7 files changed, 78 insertions(+) create mode 100644 code/__DEFINES/~~~splurt_defines/hud.dm create mode 100644 modular_zzplurt/code/modules/mob/living/carbon/human/human.dm create mode 100644 modular_zzplurt/code/modules/mob/living/carbon/human/human_defense.dm diff --git a/code/__DEFINES/~~~splurt_defines/hud.dm b/code/__DEFINES/~~~splurt_defines/hud.dm new file mode 100644 index 0000000000000..ce1cfce1a8e80 --- /dev/null +++ b/code/__DEFINES/~~~splurt_defines/hud.dm @@ -0,0 +1,12 @@ +//redefines +#undef ui_combat_toggle +#undef ui_crafting +#undef ui_building +#undef ui_language_menu +#undef ui_navigate_menu + +#define ui_combat_toggle "EAST-4:24,SOUTH:5" +#define ui_crafting "EAST-5:22,SOUTH:5" +#define ui_building "EAST-5:22,SOUTH:21" +#define ui_language_menu "EAST-5:6,SOUTH:21" +#define ui_navigate_menu "EAST-5:22,SOUTH:5" diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 375d82f5b69e6..63d2d20ab9000 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -160,6 +160,8 @@ set_combat_indicator(TRUE) else set_combat_indicator(FALSE) + //SPLURT EDIT START + /* face_mouse = (client?.prefs?.read_preference(/datum/preference/toggle/face_cursor_combat_mode) && combat_mode) ? TRUE : FALSE //SKYRAT EDIT ADDITION END @@ -169,6 +171,8 @@ SEND_SOUND(src, sound('sound/misc/ui_togglecombat.ogg', volume = 25)) //Sound from interbay! else SEND_SOUND(src, sound('sound/misc/ui_toggleoffcombat.ogg', volume = 25)) //Slightly modified version of the above + */ + //SPLURT EDIT END /mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) if(!isitem(AM)) diff --git a/modular_zzplurt/code/modules/hud/_hud.dm b/modular_zzplurt/code/modules/hud/_hud.dm index 8d8cd6c86278f..9d33c74413385 100644 --- a/modular_zzplurt/code/modules/hud/_hud.dm +++ b/modular_zzplurt/code/modules/hud/_hud.dm @@ -1,3 +1,6 @@ +/datum/hud + var/atom/movable/screen/focus_toggle + /datum/hud/human/New(mob/living/carbon/human/owner) . = ..() var/index = static_inventory.Find(action_intent) @@ -6,3 +9,8 @@ action_intent = new /atom/movable/screen/intent_toggle(null, src) static_inventory[index] = action_intent + + focus_toggle = new /atom/movable/screen/focus_toggle(null, src) + focus_toggle.icon = ui_style + focus_toggle.update_appearance() + static_inventory += focus_toggle diff --git a/modular_zzplurt/code/modules/hud/screen_objects.dm b/modular_zzplurt/code/modules/hud/screen_objects.dm index f6fff0f273162..20bedf864a2d6 100644 --- a/modular_zzplurt/code/modules/hud/screen_objects.dm +++ b/modular_zzplurt/code/modules/hud/screen_objects.dm @@ -1,3 +1,4 @@ + /atom/movable/screen/intent_toggle name = "intent" icon_state = "help" @@ -24,3 +25,30 @@ target_mob.set_combat_mode(INTENT_GRAB, silent = TRUE) else target_mob.set_combat_mode(INTENT_DISARM, silent = TRUE) + + +/atom/movable/screen/focus_toggle + name = "toggle combat mode" + icon = 'icons/hud/screen_midnight.dmi' + icon_state = "combat_off" + screen_loc = "EAST-3:24,SOUTH:5" + +/atom/movable/screen/focus_toggle/Initialize(mapload, datum/hud/hud_owner) + . = ..() + update_appearance() + +/atom/movable/screen/focus_toggle/Click() + if(!ishuman(usr)) + return + + var/mob/living/carbon/human/owner = usr + owner.set_combat_focus(!owner.focus_mode, FALSE) + update_appearance() + +/atom/movable/screen/focus_toggle/update_icon_state() + var/mob/living/carbon/human/user = hud?.mymob + if(!istype(user) || !user.client) + return ..() + + icon_state = user.focus_mode ? "combat" : "combat_off" + return ..() diff --git a/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm b/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm new file mode 100644 index 0000000000000..3f005a2cb58cc --- /dev/null +++ b/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm @@ -0,0 +1,3 @@ +/mob/living/carbon/human + /// Are we currently in combat focus? + var/focus_mode = FALSE diff --git a/modular_zzplurt/code/modules/mob/living/carbon/human/human_defense.dm b/modular_zzplurt/code/modules/mob/living/carbon/human/human_defense.dm new file mode 100644 index 0000000000000..8858d7a430205 --- /dev/null +++ b/modular_zzplurt/code/modules/mob/living/carbon/human/human_defense.dm @@ -0,0 +1,20 @@ +/mob/living/carbon/human/proc/set_combat_focus(new_mode, silent = TRUE) + if(focus_mode == new_mode) + return + + . = focus_mode + focus_mode = new_mode + hud_used?.focus_toggle?.update_appearance() + + var/focus_sound = client?.prefs.read_preference(/datum/preference/toggle/sound_combatmode) + if(focus_mode) + face_mouse = !!client?.prefs?.read_preference(/datum/preference/toggle/face_cursor_combat_mode) + set_combat_indicator(TRUE) + if(focus_sound) + SEND_SOUND(src, sound('sound/misc/ui_togglecombat.ogg', volume = 25)) //Sound from interbay! + else + face_mouse = FALSE + set_combat_indicator(FALSE) + if(focus_sound) + SEND_SOUND(src, sound('sound/misc/ui_toggleoffcombat.ogg', volume = 25)) //Slightly modified version of the above + diff --git a/tgstation.dme b/tgstation.dme index 7542753ad49e0..0a26446eb8f16 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -512,6 +512,7 @@ #include "code\__DEFINES\~~~splurt_defines\intents.dm" #include "code\__DEFINES\~~~splurt_defines\keybinding.dm" #include "code\__DEFINES\~~~splurt_defines\traits\declarations.dm" +#include "code\__DEFINES\~~~splurt_defines\hud.dm" #include "code\__HELPERS\_auxtools_api.dm" #include "code\__HELPERS\_lists.dm" #include "code\__HELPERS\_planes.dm" @@ -9188,6 +9189,8 @@ #include "modular_zzplurt\code\modules\mob\dead\new_player\new_player.dm" #include "modular_zzplurt\code\modules\mob\living\living.dm" #include "modular_zzplurt\code\modules\mob\living\living_defines.dm" +#include "modular_zzplurt\code\modules\mob\living\carbon\human\human.dm" +#include "modular_zzplurt\code\modules\mob\living\carbon\human\human_defense.dm" #include "modular_zzplurt\code\modules\reagents\chemistry\machinery\chem_dispenser.dm" #include "modular_zzplurt\code\modules\wiremod\core\integrated_circuit.dm" // END_INCLUDE From 1268fce03ab9edf369d75d2e49188b857b7d1aad Mon Sep 17 00:00:00 2001 From: NullFag Date: Sun, 28 Jul 2024 19:43:56 +0200 Subject: [PATCH 2/4] DAMN YOU UNINTENTIONALLY WORKING CODE --- modular_zzplurt/code/modules/hud/screen_objects.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_zzplurt/code/modules/hud/screen_objects.dm b/modular_zzplurt/code/modules/hud/screen_objects.dm index 20bedf864a2d6..7b33e16f069b2 100644 --- a/modular_zzplurt/code/modules/hud/screen_objects.dm +++ b/modular_zzplurt/code/modules/hud/screen_objects.dm @@ -2,7 +2,7 @@ /atom/movable/screen/intent_toggle name = "intent" icon_state = "help" - screen_loc = ui_acti + screen_loc = ui_combat_toggle /atom/movable/screen/intent_toggle/update_icon_state() . = ..() From 071646058e421f6df84b12fb2f544efc55cd543a Mon Sep 17 00:00:00 2001 From: NullFag Date: Mon, 29 Jul 2024 21:42:12 +0200 Subject: [PATCH 3/4] oh yeah im a contractor now --- modular_zzplurt/code/datums/keybinding/living.dm | 6 ++++++ modular_zzplurt/code/modules/hud/screen_objects.dm | 4 ++-- .../code/modules/mob/living/carbon/human/human.dm | 2 +- .../code/modules/mob/living/carbon/human/human_defense.dm | 8 ++++---- tgstation.dme | 1 + 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 modular_zzplurt/code/datums/keybinding/living.dm diff --git a/modular_zzplurt/code/datums/keybinding/living.dm b/modular_zzplurt/code/datums/keybinding/living.dm new file mode 100644 index 0000000000000..490fc2ab3ffc9 --- /dev/null +++ b/modular_zzplurt/code/datums/keybinding/living.dm @@ -0,0 +1,6 @@ +/datum/keybinding/living/combat_indicator/down(client/user) + . = ..() + var/mob/living/carbon/human/humie = user.mob + if(. && istype(humie)) + return + humie.set_combat_focus(!humie.combat_focus) diff --git a/modular_zzplurt/code/modules/hud/screen_objects.dm b/modular_zzplurt/code/modules/hud/screen_objects.dm index 7b33e16f069b2..aa64e4eeebc61 100644 --- a/modular_zzplurt/code/modules/hud/screen_objects.dm +++ b/modular_zzplurt/code/modules/hud/screen_objects.dm @@ -42,7 +42,7 @@ return var/mob/living/carbon/human/owner = usr - owner.set_combat_focus(!owner.focus_mode, FALSE) + owner.set_combat_focus(!owner.combat_focus, FALSE) update_appearance() /atom/movable/screen/focus_toggle/update_icon_state() @@ -50,5 +50,5 @@ if(!istype(user) || !user.client) return ..() - icon_state = user.focus_mode ? "combat" : "combat_off" + icon_state = user.combat_focus ? "combat" : "combat_off" return ..() diff --git a/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm b/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm index 3f005a2cb58cc..7992e19f25052 100644 --- a/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm +++ b/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm @@ -1,3 +1,3 @@ /mob/living/carbon/human /// Are we currently in combat focus? - var/focus_mode = FALSE + var/combat_focus = FALSE diff --git a/modular_zzplurt/code/modules/mob/living/carbon/human/human_defense.dm b/modular_zzplurt/code/modules/mob/living/carbon/human/human_defense.dm index 8858d7a430205..11916604722dc 100644 --- a/modular_zzplurt/code/modules/mob/living/carbon/human/human_defense.dm +++ b/modular_zzplurt/code/modules/mob/living/carbon/human/human_defense.dm @@ -1,13 +1,13 @@ /mob/living/carbon/human/proc/set_combat_focus(new_mode, silent = TRUE) - if(focus_mode == new_mode) + if(combat_focus == new_mode) return - . = focus_mode - focus_mode = new_mode + . = combat_focus + combat_focus = new_mode hud_used?.focus_toggle?.update_appearance() var/focus_sound = client?.prefs.read_preference(/datum/preference/toggle/sound_combatmode) - if(focus_mode) + if(combat_focus) face_mouse = !!client?.prefs?.read_preference(/datum/preference/toggle/face_cursor_combat_mode) set_combat_indicator(TRUE) if(focus_sound) diff --git a/tgstation.dme b/tgstation.dme index 0a26446eb8f16..cefd9f4510420 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9170,6 +9170,7 @@ #include "modular_zzplurt\code\controllers\subsystem\discord.dm" #include "modular_zzplurt\code\datums\components\crafting\crafting.dm" #include "modular_zzplurt\code\datums\keybinding\human.dm" +#include "modular_zzplurt\code\datums\keybinding\living.dm" #include "modular_zzplurt\code\game\objects\items\devices\transfer_valve.dm" #include "modular_zzplurt\code\modules\admin\player_panel.dm" #include "modular_zzplurt\code\modules\admin\playtimes.dm" From 488f6cbdd58c89bb01731b27fe7ed0f011e8bcdd Mon Sep 17 00:00:00 2001 From: Mosley <93835010+MosleyTheMalO@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:33:05 -0500 Subject: [PATCH 4/4] Update tgstation.dme --- tgstation.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgstation.dme b/tgstation.dme index 49105ad49c44d..38833a19ac089 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -509,10 +509,10 @@ #include "code\__DEFINES\~~bubber_defines\transport.dm" #include "code\__DEFINES\~~bubber_defines\___HELPERS\global_lists.dm" #include "code\__DEFINES\~~bubber_defines\research\techweb_nodes.dm" +#include "code\__DEFINES\~~~splurt_defines\hud.dm" #include "code\__DEFINES\~~~splurt_defines\intents.dm" #include "code\__DEFINES\~~~splurt_defines\keybinding.dm" #include "code\__DEFINES\~~~splurt_defines\traits\declarations.dm" -#include "code\__DEFINES\~~~splurt_defines\hud.dm" #include "code\__HELPERS\_auxtools_api.dm" #include "code\__HELPERS\_lists.dm" #include "code\__HELPERS\_planes.dm"