From 1eb7e3b12b4d0099a972bca4ec983c38421eab74 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Wed, 3 Jul 2024 22:39:25 +0200 Subject: [PATCH 01/21] draft 1 lesgo bros --- code/modules/admin/admin_verbs.dm | 1 + .../extra_buttons/fire_support_menu.dm | 274 ++++++++++++++++++ .../interfaces/GameMasterFireSupportMenu.js | 36 +++ 3 files changed, 311 insertions(+) create mode 100644 code/modules/admin/game_master/extra_buttons/fire_support_menu.dm create mode 100644 tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 50cb19a7e9..94defce9c4 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -335,6 +335,7 @@ var/list/roundstart_mod_verbs = list( add_verb(src, /client/proc/game_master_rename_platoon) add_verb(src, /client/proc/toggle_vehicle_blockers) add_verb(src, /client/proc/toggle_rappel_menu) + add_verb(src, /client/proc/toggle_fire_support_menu) if(CLIENT_HAS_RIGHTS(src, R_SERVER)) add_verb(src, admin_verbs_server) if(CLIENT_HAS_RIGHTS(src, R_DEBUG)) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm new file mode 100644 index 0000000000..df43bea94c --- /dev/null +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -0,0 +1,274 @@ +GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) +#define FIRE_SUPPORT_CLICK_INTERCEPT_ACTION "fire_support_click_intercept_action" + +//Various ordnance selections +#define ORDNANCE_OPTIONS list("Holy HEFA", "Banshee Missile", "Harpoon Missile", "Keeper Missile", "Napalm Missile", "Thermobaric Missile", "Widowmaker Missile", "Laser", "Minirocket", "Incendiary Minirocket", "Sentry Drop", "GAU-21", "Heavy GAU-21", "High Explosive Bombardment", "Incendiary Bombardment", "Cluster Bombardment", "High Explosive Mortar", "Incendiary Mortar", "Fragmentation Mortar", "Flare Mortar") + +client/proc/toggle_fire_support_menu() + set name = "Fire Support Menu" + set category = "Game Master.Extras" + if(!check_rights(R_ADMIN)) + return + GLOB.fire_support_menu.tgui_interact(mob) + +/datum/fire_support_menu + var/fire_support_click_intercept = FALSE + var/selected_ordnance = "Holy HEFA" + var/soundCooldown = FALSE + var/obj/structure/mortar/abstract_mortar = new() + +/datum/fire_support_menu/tgui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "GameMasterFireSupportMenu", "Fire Support Menu") + ui.open() + user.client?.click_intercept = src + +/datum/fire_support_menu/ui_data(mob/user) + . = ..() + var/list/data = list() + + data["ordnance_options"] = ORDNANCE_OPTIONS + data["selected_ordnance"] = selected_ordnance + data["fire_support_click_intercept"] = fire_support_click_intercept + + return data + +/datum/fire_support_menu/ui_act(action, params) + . = ..() + switch(action) + if("toggle_click_fire_support") + fire_support_click_intercept = !fire_support_click_intercept + return + if("set_selected_ordnance") + selected_ordnance = params["new_ordnance"] + return + +/datum/fire_support_menu/ui_status(mob/user, datum/ui_state/state) + return UI_INTERACTIVE + +/datum/fire_support_menu/ui_close(mob/user) + var/client/user_client = user.client + if(user_client?.click_intercept == src) + user_client.click_intercept = null + + fire_support_click_intercept = FALSE + +/datum/fire_support_menu/proc/InterceptClickOn(mob/user, params, atom/object) + + var/turf/target_turf = get_turf(object) + if(fire_support_click_intercept) + switch(selected_ordnance) + if("Holy HEFA") + var/obj/item/explosive/grenade/high_explosive/frag/holyhefa = new(target_turf) + holyhefa.activate() + return TRUE + //PREMADE ORDNANCE + + //DS missiles + if("Banshee Missile") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/rocket/banshee/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Harpoon Missile") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/rocket/harpoon/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Keeper Missile") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/rocket/keeper/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Napalm Missile") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/rocket/napalm/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Thermobaric Missile") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/rocket/thermobaric/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Widowmaker Missile") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/rocket/widowmaker/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + //Misc DS ammo + if("Laser") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/laser_battery/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Minirocket") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/minirocket/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Incendiary Minirocket") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/minirocket/incendiary/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Sentry Drop") + if(istype(target_turf, /turf/closed)) + to_chat(user, SPAN_WARNING("The selected drop site is a sheer wall!")) + return FALSE + else + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/sentry/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("GAU-21") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/heavygun/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Heavy GAU-21") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/structure/ship_ammo/heavygun/antitank/ammo = new() + + HandleDropshipOrdnance(target_turf, ammo) + + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + //Orbital Bombardments + if("High Explosive Bombardment") + var/obj/structure/ob_ammo/warhead/explosive/ammo = new() + + HandleOrbitalOrdnance(target_turf, ammo) + return TRUE + + if("Incendiary Bombardment") + var/obj/structure/ob_ammo/warhead/incendiary/ammo = new() + + HandleOrbitalOrdnance(target_turf, ammo) + return TRUE + + if("Cluster Bombardment") + var/obj/structure/ob_ammo/warhead/cluster/ammo = new() + + HandleOrbitalOrdnance(target_turf, ammo) + return TRUE + + //Mortar Shelling + if("High Explosive Mortar") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/item/mortar_shell/he/ammo = new() + + abstract_mortar.handle_shell(target_turf, ammo) + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + + if("Incendiary Mortar") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/item/mortar_shell/incendiary/ammo = new() + + abstract_mortar.handle_shell(target_turf, ammo) + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + + if("Fragmentation Mortar") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/item/mortar_shell/frag/ammo = new() + + abstract_mortar.handle_shell(target_turf, ammo) + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + if("Flare Mortar") + var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) + var/obj/item/mortar_shell/flare/ammo = new() + + abstract_mortar.handle_shell(target_turf, ammo) + QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings + return TRUE + + else + to_chat(user, SPAN_ANNOUNCEMENT_HEADER_ADMIN("Invalid ordnance selection! If this appears, yell at a coder!")) + return TRUE + +/datum/fire_support_menu/proc/HandleDropshipSound(target_turf) + if(!soundCooldown) + playsound(target_turf, 'sound/weapons/dropship_sonic_boom.ogg', 100, 1, 60) + soundCooldown = TRUE + addtimer(VARSET_CALLBACK(src, soundCooldown, FALSE), 10 SECONDS) + + return + +/datum/fire_support_menu/proc/HandleDropshipOrdnance(turf/target_turf, obj/structure/ship_ammo/ammo) + addtimer(CALLBACK(src, PROC_REF(HandleDropshipSound), target_turf), 0.5 SECONDS) + if(!istype(ammo, /obj/structure/ship_ammo/heavygun/)) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound), target_turf, ammo.warning_sound, ammo.warning_sound_volume, 1, 15), 1.5 SECONDS) + addtimer(CALLBACK(ammo, TYPE_PROC_REF(/obj/structure/ship_ammo, detonate_on), target_turf), 2.5 SECONDS) + QDEL_IN(ammo, 5 SECONDS) + +/datum/fire_support_menu/proc/HandleOrbitalOrdnance(turf/target_turf, obj/structure/ob_ammo/warhead/ammo) + ammo.warhead_impact(target_turf) + +/* + Suno's Descent Into Madness. + + I hate TGUI. + Why would god let something like this exist? + + day 1. + clicky intercept doesnt work, life is pain. at least I got it to open. + + day 2. + i forgor to actually make a clicky intercept. oh well, it works at least. yippie!!!! + + day 3. success is in sight, I can now fire missiles, and even turrets at the AO. Now I just need to implement BRRT, lasers, minirockets, OB's, and the custom ammo types. + I am POWERFUL, all who oppose me shall fall to INFINITE HEFA grenades. + + day 5. expanded catalouge, reworking sound effects to make the missiles actually sound like something. Solaris shipyards will be the conniseurs in close air support armaments soon... + + day 7. where am I, what is my name. Is there anything other than /datum/fire_support_menu/proc/InterceptClickOn in the world? + at least I managed to refactor everything into a neat, cool proc to handle firing, and sound, so your ears dont get obliterated. + +*/ diff --git a/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js b/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js new file mode 100644 index 0000000000..ea5b4db0e1 --- /dev/null +++ b/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js @@ -0,0 +1,36 @@ +import { useBackend } from '../backend'; +import { Button, Dropdown, LabeledList, Section } from '../components'; +import { Window } from '../layouts'; + +export const GameMasterFireSupportMenu = (props, context) => { + const { act, data } = useBackend(context); + return ( + + +
+ + +
+
+
+ ); +}; From 297e6c4afc72fa810ea76710dbff8f3317964206 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Fri, 5 Jul 2024 14:29:30 +0200 Subject: [PATCH 02/21] Categorized menu wow --- .../extra_buttons/fire_support_menu.dm | 41 +++++++---- .../interfaces/GameMasterFireSupportMenu.js | 69 ++++++++++++++++--- 2 files changed, 84 insertions(+), 26 deletions(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index df43bea94c..0bceeba4f0 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -2,7 +2,11 @@ GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) #define FIRE_SUPPORT_CLICK_INTERCEPT_ACTION "fire_support_click_intercept_action" //Various ordnance selections -#define ORDNANCE_OPTIONS list("Holy HEFA", "Banshee Missile", "Harpoon Missile", "Keeper Missile", "Napalm Missile", "Thermobaric Missile", "Widowmaker Missile", "Laser", "Minirocket", "Incendiary Minirocket", "Sentry Drop", "GAU-21", "Heavy GAU-21", "High Explosive Bombardment", "Incendiary Bombardment", "Cluster Bombardment", "High Explosive Mortar", "Incendiary Mortar", "Fragmentation Mortar", "Flare Mortar") +#define ORDNANCE_OPTIONS list("Banshee Missile", "Harpoon Missile", "Keeper Missile", "Napalm Missile", "Thermobaric Missile", "Widowmaker Missile", "Laser", "Minirocket", "Incendiary Minirocket", "Sentry Drop", "GAU-21", "Heavy GAU-21", "High Explosive", "Incendiary", "Cluster", "High Explosive", "Incendiary", "Fragmentation", "Flare") +#define MISSILE_ORDNANCE list("Banshee Missile", "Harpoon Missile", "Keeper Missile", "Napalm Missile", "Thermobaric Missile", "Widowmaker Missile") +#define ORBITAL_ORDNANCE list("High Explosive OB", "Incendiary OB", "Cluster OB") +#define MORTAR_ORDNANCE list("High Explosive Shell", "Incendiary Shell", "Fragmentation Shell", "Flare Shell") +#define MISC_ORDNANCE list("Laser", "Minirocket", "Incendiary Minirocket", "Sentry Drop", "GAU-21", "Heavy GAU-21") client/proc/toggle_fire_support_menu() set name = "Fire Support Menu" @@ -29,6 +33,12 @@ client/proc/toggle_fire_support_menu() var/list/data = list() data["ordnance_options"] = ORDNANCE_OPTIONS + + data["missile_ordnance_options"] = MISSILE_ORDNANCE + data["orbital_ordnance_options"] = ORBITAL_ORDNANCE + data["mortar_ordnance_options"] = MORTAR_ORDNANCE + data["misc_ordnance_options"] = MISC_ORDNANCE + data["selected_ordnance"] = selected_ordnance data["fire_support_click_intercept"] = fire_support_click_intercept @@ -41,7 +51,7 @@ client/proc/toggle_fire_support_menu() fire_support_click_intercept = !fire_support_click_intercept return if("set_selected_ordnance") - selected_ordnance = params["new_ordnance"] + selected_ordnance = params["ordnance"] return /datum/fire_support_menu/ui_status(mob/user, datum/ui_state/state) @@ -59,10 +69,6 @@ client/proc/toggle_fire_support_menu() var/turf/target_turf = get_turf(object) if(fire_support_click_intercept) switch(selected_ordnance) - if("Holy HEFA") - var/obj/item/explosive/grenade/high_explosive/frag/holyhefa = new(target_turf) - holyhefa.activate() - return TRUE //PREMADE ORDNANCE //DS missiles @@ -180,40 +186,40 @@ client/proc/toggle_fire_support_menu() return TRUE //Orbital Bombardments - if("High Explosive Bombardment") + if("High Explosive OB") var/obj/structure/ob_ammo/warhead/explosive/ammo = new() HandleOrbitalOrdnance(target_turf, ammo) return TRUE - if("Incendiary Bombardment") + if("Incendiary OB") var/obj/structure/ob_ammo/warhead/incendiary/ammo = new() HandleOrbitalOrdnance(target_turf, ammo) return TRUE - if("Cluster Bombardment") + if("Cluster OB") var/obj/structure/ob_ammo/warhead/cluster/ammo = new() HandleOrbitalOrdnance(target_turf, ammo) return TRUE //Mortar Shelling - if("High Explosive Mortar") + if("High Explosive Shell") var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/item/mortar_shell/he/ammo = new() abstract_mortar.handle_shell(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings - if("Incendiary Mortar") + if("Incendiary Shell") var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/item/mortar_shell/incendiary/ammo = new() abstract_mortar.handle_shell(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings - if("Fragmentation Mortar") + if("Fragmentation Shell") var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/item/mortar_shell/frag/ammo = new() @@ -221,7 +227,7 @@ client/proc/toggle_fire_support_menu() QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE - if("Flare Mortar") + if("Flare Shell") var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/item/mortar_shell/flare/ammo = new() @@ -239,8 +245,6 @@ client/proc/toggle_fire_support_menu() soundCooldown = TRUE addtimer(VARSET_CALLBACK(src, soundCooldown, FALSE), 10 SECONDS) - return - /datum/fire_support_menu/proc/HandleDropshipOrdnance(turf/target_turf, obj/structure/ship_ammo/ammo) addtimer(CALLBACK(src, PROC_REF(HandleDropshipSound), target_turf), 0.5 SECONDS) if(!istype(ammo, /obj/structure/ship_ammo/heavygun/)) @@ -251,6 +255,12 @@ client/proc/toggle_fire_support_menu() /datum/fire_support_menu/proc/HandleOrbitalOrdnance(turf/target_turf, obj/structure/ob_ammo/warhead/ammo) ammo.warhead_impact(target_turf) +#undef ORDNANCE_OPTIONS +#undef DROPSHIP_ORDNANCE +#undef ORBITAL_ORDNANCE +#undef MORTAR_ORDNANCE +#undef MISC_ORDNANCE +#undef FIRE_SUPPORT_CLICK_INTERCEPT_ACTION /* Suno's Descent Into Madness. @@ -271,4 +281,5 @@ client/proc/toggle_fire_support_menu() day 7. where am I, what is my name. Is there anything other than /datum/fire_support_menu/proc/InterceptClickOn in the world? at least I managed to refactor everything into a neat, cool proc to handle firing, and sound, so your ears dont get obliterated. + day 10. I did it. It is complete. THE PROJECT IS COMPLETE. */ diff --git a/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js b/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js index ea5b4db0e1..8bccb62bc1 100644 --- a/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js +++ b/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js @@ -1,5 +1,5 @@ import { useBackend } from '../backend'; -import { Button, Dropdown, LabeledList, Section } from '../components'; +import { Button, Collapsible, LabeledList, Section } from '../components'; import { Window } from '../layouts'; export const GameMasterFireSupportMenu = (props, context) => { @@ -9,7 +9,7 @@ export const GameMasterFireSupportMenu = (props, context) => {
- +
From be1af0b92c620760d5e707497c1139bb2633c3e0 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Fri, 5 Jul 2024 14:31:39 +0200 Subject: [PATCH 03/21] feck I forgot to include it --- colonialmarines.dme | 1 + 1 file changed, 1 insertion(+) diff --git a/colonialmarines.dme b/colonialmarines.dme index d75338ecfe..d36f913bdd 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1389,6 +1389,7 @@ #include "code\modules\admin\game_master\game_master.dm" #include "code\modules\admin\game_master\game_master_submenu.dm" #include "code\modules\admin\game_master\sound_panel.dm" +#include "code\modules\admin\game_master\extra_buttons\fire_support_menu.dm" #include "code\modules\admin\game_master\extra_buttons\rappel_menu.dm" #include "code\modules\admin\game_master\extra_buttons\rename_platoon.dm" #include "code\modules\admin\game_master\extra_buttons\toggle_join_xeno.dm" From e80422ee27af5b7fa655cba082959e66aa2a6e54 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Fri, 5 Jul 2024 14:33:38 +0200 Subject: [PATCH 04/21] oopsie I forgot to clean it up. --- .../modules/admin/game_master/extra_buttons/fire_support_menu.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 0bceeba4f0..5c3eec59d5 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -256,7 +256,6 @@ client/proc/toggle_fire_support_menu() ammo.warhead_impact(target_turf) #undef ORDNANCE_OPTIONS -#undef DROPSHIP_ORDNANCE #undef ORBITAL_ORDNANCE #undef MORTAR_ORDNANCE #undef MISC_ORDNANCE From 4dc51d4e955526c3296706fadca5a834972fe794 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Fri, 5 Jul 2024 20:07:47 +0200 Subject: [PATCH 05/21] Styling upgrades --- .../extra_buttons/fire_support_menu.dm | 2 +- .../interfaces/GameMasterFireSupportMenu.js | 128 ++++++++++-------- 2 files changed, 69 insertions(+), 61 deletions(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 5c3eec59d5..e65d990cdc 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -17,7 +17,7 @@ client/proc/toggle_fire_support_menu() /datum/fire_support_menu var/fire_support_click_intercept = FALSE - var/selected_ordnance = "Holy HEFA" + var/selected_ordnance = "Banshee Missile" var/soundCooldown = FALSE var/obj/structure/mortar/abstract_mortar = new() diff --git a/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js b/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js index 8bccb62bc1..dee32ba4a0 100644 --- a/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js +++ b/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js @@ -1,81 +1,89 @@ +import { auto } from '@popperjs/core'; import { useBackend } from '../backend'; -import { Button, Collapsible, LabeledList, Section } from '../components'; +import { Button, Collapsible, Section, Stack } from '../components'; import { Window } from '../layouts'; export const GameMasterFireSupportMenu = (props, context) => { const { act, data } = useBackend(context); return ( - + -
- - +
+ +
From bde9b95bf2cc010b290d48f3cb5f88c37ff73850 Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Sat, 6 Jul 2024 00:14:33 +0200 Subject: [PATCH 06/21] Devlog was funny, but it doesnt add anything --- .../extra_buttons/fire_support_menu.dm | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index e65d990cdc..7f2771c238 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -260,25 +260,3 @@ client/proc/toggle_fire_support_menu() #undef MORTAR_ORDNANCE #undef MISC_ORDNANCE #undef FIRE_SUPPORT_CLICK_INTERCEPT_ACTION -/* - Suno's Descent Into Madness. - - I hate TGUI. - Why would god let something like this exist? - - day 1. - clicky intercept doesnt work, life is pain. at least I got it to open. - - day 2. - i forgor to actually make a clicky intercept. oh well, it works at least. yippie!!!! - - day 3. success is in sight, I can now fire missiles, and even turrets at the AO. Now I just need to implement BRRT, lasers, minirockets, OB's, and the custom ammo types. - I am POWERFUL, all who oppose me shall fall to INFINITE HEFA grenades. - - day 5. expanded catalouge, reworking sound effects to make the missiles actually sound like something. Solaris shipyards will be the conniseurs in close air support armaments soon... - - day 7. where am I, what is my name. Is there anything other than /datum/fire_support_menu/proc/InterceptClickOn in the world? - at least I managed to refactor everything into a neat, cool proc to handle firing, and sound, so your ears dont get obliterated. - - day 10. I did it. It is complete. THE PROJECT IS COMPLETE. -*/ From a3a838c5fb56137f6a0eba623d321645e10e58e4 Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:47:16 +0200 Subject: [PATCH 07/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> --- .../admin/game_master/extra_buttons/fire_support_menu.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 7f2771c238..134b351d9d 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -8,7 +8,7 @@ GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) #define MORTAR_ORDNANCE list("High Explosive Shell", "Incendiary Shell", "Fragmentation Shell", "Flare Shell") #define MISC_ORDNANCE list("Laser", "Minirocket", "Incendiary Minirocket", "Sentry Drop", "GAU-21", "Heavy GAU-21") -client/proc/toggle_fire_support_menu() +/client/proc/toggle_fire_support_menu() set name = "Fire Support Menu" set category = "Game Master.Extras" if(!check_rights(R_ADMIN)) From c60c8de1799f952076a3847c458fb218ee92be70 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Thu, 18 Jul 2024 12:56:51 +0200 Subject: [PATCH 08/21] there's a snake in my code! --- .../extra_buttons/fire_support_menu.dm | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index e65d990cdc..d54b1fb5a1 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -76,7 +76,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/rocket/banshee/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -85,7 +85,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/rocket/harpoon/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -94,7 +94,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/rocket/keeper/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -103,7 +103,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/rocket/napalm/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -112,7 +112,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/rocket/thermobaric/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -121,7 +121,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/rocket/widowmaker/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -131,7 +131,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/laser_battery/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -140,7 +140,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/minirocket/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -149,7 +149,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/minirocket/incendiary/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -162,7 +162,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/sentry/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -171,7 +171,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/heavygun/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -180,7 +180,7 @@ client/proc/toggle_fire_support_menu() var/obj/effect/overlay/temp/blinking_laser/target_lase = new(target_turf) var/obj/structure/ship_ammo/heavygun/antitank/ammo = new() - HandleDropshipOrdnance(target_turf, ammo) + handle_dropship_ordnance(target_turf, ammo) QDEL_IN(target_lase, 5 SECONDS) //to stop "unused var" warnings return TRUE @@ -189,19 +189,19 @@ client/proc/toggle_fire_support_menu() if("High Explosive OB") var/obj/structure/ob_ammo/warhead/explosive/ammo = new() - HandleOrbitalOrdnance(target_turf, ammo) + handle_orbital_ordnance(target_turf, ammo) return TRUE if("Incendiary OB") var/obj/structure/ob_ammo/warhead/incendiary/ammo = new() - HandleOrbitalOrdnance(target_turf, ammo) + handle_orbital_ordnance(target_turf, ammo) return TRUE if("Cluster OB") var/obj/structure/ob_ammo/warhead/cluster/ammo = new() - HandleOrbitalOrdnance(target_turf, ammo) + handle_orbital_ordnance(target_turf, ammo) return TRUE //Mortar Shelling @@ -239,20 +239,20 @@ client/proc/toggle_fire_support_menu() to_chat(user, SPAN_ANNOUNCEMENT_HEADER_ADMIN("Invalid ordnance selection! If this appears, yell at a coder!")) return TRUE -/datum/fire_support_menu/proc/HandleDropshipSound(target_turf) +/datum/fire_support_menu/proc/handle_dropship_sound(target_turf) if(!soundCooldown) playsound(target_turf, 'sound/weapons/dropship_sonic_boom.ogg', 100, 1, 60) soundCooldown = TRUE addtimer(VARSET_CALLBACK(src, soundCooldown, FALSE), 10 SECONDS) -/datum/fire_support_menu/proc/HandleDropshipOrdnance(turf/target_turf, obj/structure/ship_ammo/ammo) - addtimer(CALLBACK(src, PROC_REF(HandleDropshipSound), target_turf), 0.5 SECONDS) +/datum/fire_support_menu/proc/handle_dropship_ordnance(turf/target_turf, obj/structure/ship_ammo/ammo) + addtimer(CALLBACK(src, PROC_REF(handle_dropship_sound), target_turf), 0.5 SECONDS) if(!istype(ammo, /obj/structure/ship_ammo/heavygun/)) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound), target_turf, ammo.warning_sound, ammo.warning_sound_volume, 1, 15), 1.5 SECONDS) addtimer(CALLBACK(ammo, TYPE_PROC_REF(/obj/structure/ship_ammo, detonate_on), target_turf), 2.5 SECONDS) QDEL_IN(ammo, 5 SECONDS) -/datum/fire_support_menu/proc/HandleOrbitalOrdnance(turf/target_turf, obj/structure/ob_ammo/warhead/ammo) +/datum/fire_support_menu/proc/handle_orbital_ordnance(turf/target_turf, obj/structure/ob_ammo/warhead/ammo) ammo.warhead_impact(target_turf) #undef ORDNANCE_OPTIONS From b7add33b4263e4e77d59911ab702bce79354c9f2 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Mon, 22 Jul 2024 18:08:28 +0200 Subject: [PATCH 09/21] The documentation demon strikes again --- .../extra_buttons/fire_support_menu.dm | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index d54b1fb5a1..be8870210e 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -15,10 +15,12 @@ client/proc/toggle_fire_support_menu() return GLOB.fire_support_menu.tgui_interact(mob) +///The actual menu datum /datum/fire_support_menu var/fire_support_click_intercept = FALSE var/selected_ordnance = "Banshee Missile" - var/soundCooldown = FALSE + var/sound_cooldown = FALSE + ///Mortar to fire the abstract shells. var/obj/structure/mortar/abstract_mortar = new() /datum/fire_support_menu/tgui_interact(mob/user, datum/tgui/ui) @@ -64,6 +66,7 @@ client/proc/toggle_fire_support_menu() fire_support_click_intercept = FALSE +///Handles firing logic whenever the mouse is clicked, and the fire_support_click_intercept var is TRUE /datum/fire_support_menu/proc/InterceptClickOn(mob/user, params, atom/object) var/turf/target_turf = get_turf(object) @@ -239,12 +242,14 @@ client/proc/toggle_fire_support_menu() to_chat(user, SPAN_ANNOUNCEMENT_HEADER_ADMIN("Invalid ordnance selection! If this appears, yell at a coder!")) return TRUE +///Handles the dropship swooping sound effect, and makes sure it doesnt play 20 times a second. /datum/fire_support_menu/proc/handle_dropship_sound(target_turf) - if(!soundCooldown) + if(!sound_cooldown) playsound(target_turf, 'sound/weapons/dropship_sonic_boom.ogg', 100, 1, 60) - soundCooldown = TRUE - addtimer(VARSET_CALLBACK(src, soundCooldown, FALSE), 10 SECONDS) + sound_cooldown = TRUE + addtimer(VARSET_CALLBACK(src, sound_cooldown, FALSE), 10 SECONDS) +///Handles the noises and actual detonation of dropship ammo. Mainly it doesnt play the warning sound for ammo of the ship_ammo/heavygun/ type. /datum/fire_support_menu/proc/handle_dropship_ordnance(turf/target_turf, obj/structure/ship_ammo/ammo) addtimer(CALLBACK(src, PROC_REF(handle_dropship_sound), target_turf), 0.5 SECONDS) if(!istype(ammo, /obj/structure/ship_ammo/heavygun/)) @@ -255,30 +260,13 @@ client/proc/toggle_fire_support_menu() /datum/fire_support_menu/proc/handle_orbital_ordnance(turf/target_turf, obj/structure/ob_ammo/warhead/ammo) ammo.warhead_impact(target_turf) +///Deletes the mortar when the menu is closed so we dont make a thousand of them. +/datum/fire_support_menu/Destroy(force, ...) + QDEL_NULL(abstract_mortar) + . = ..() + #undef ORDNANCE_OPTIONS #undef ORBITAL_ORDNANCE #undef MORTAR_ORDNANCE #undef MISC_ORDNANCE #undef FIRE_SUPPORT_CLICK_INTERCEPT_ACTION -/* - Suno's Descent Into Madness. - - I hate TGUI. - Why would god let something like this exist? - - day 1. - clicky intercept doesnt work, life is pain. at least I got it to open. - - day 2. - i forgor to actually make a clicky intercept. oh well, it works at least. yippie!!!! - - day 3. success is in sight, I can now fire missiles, and even turrets at the AO. Now I just need to implement BRRT, lasers, minirockets, OB's, and the custom ammo types. - I am POWERFUL, all who oppose me shall fall to INFINITE HEFA grenades. - - day 5. expanded catalouge, reworking sound effects to make the missiles actually sound like something. Solaris shipyards will be the conniseurs in close air support armaments soon... - - day 7. where am I, what is my name. Is there anything other than /datum/fire_support_menu/proc/InterceptClickOn in the world? - at least I managed to refactor everything into a neat, cool proc to handle firing, and sound, so your ears dont get obliterated. - - day 10. I did it. It is complete. THE PROJECT IS COMPLETE. -*/ From a941e390e8003f9da0736bae2f6bd2f5b802263c Mon Sep 17 00:00:00 2001 From: SunoFang Date: Mon, 22 Jul 2024 18:19:49 +0200 Subject: [PATCH 10/21] linters give me lint --- .../admin/game_master/extra_buttons/fire_support_menu.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index d5c217c811..ec3576705c 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -57,7 +57,7 @@ GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) return /datum/fire_support_menu/ui_status(mob/user, datum/ui_state/state) - return UI_INTERACTIVE + return UI_INTERACTIVE /datum/fire_support_menu/ui_close(mob/user) var/client/user_client = user.client From 04f31751f3035f45bf32514eee49ef6062672802 Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:52:50 +0200 Subject: [PATCH 11/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com> --- .../admin/game_master/extra_buttons/fire_support_menu.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index ec3576705c..8a5b5647ae 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -263,7 +263,7 @@ GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) ///Deletes the mortar when the menu is closed so we dont make a thousand of them. /datum/fire_support_menu/Destroy(force, ...) QDEL_NULL(abstract_mortar) - . = ..() + return ..() #undef ORDNANCE_OPTIONS #undef ORBITAL_ORDNANCE From 166e5ac18cc16635854181798b1cf1096ea23148 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Wed, 24 Jul 2024 21:00:28 +0200 Subject: [PATCH 12/21] does the things --- .../extra_buttons/fire_support_menu.dm | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 8a5b5647ae..7fa847135d 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -23,6 +23,11 @@ GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) ///Mortar to fire the abstract shells. var/obj/structure/mortar/abstract_mortar = new() +///Deletes the mortar when the menu is closed so we dont make a thousand of them. +/datum/fire_support_menu/Destroy(force, ...) + QDEL_NULL(abstract_mortar) + return ..() + /datum/fire_support_menu/tgui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) @@ -30,16 +35,24 @@ GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) ui.open() user.client?.click_intercept = src -/datum/fire_support_menu/ui_data(mob/user) +///Input all the options for the ordnance panel. Only fires once, as the available ammo types shouldnt change. And if they do, something's very wrong +/datum/fire_support_menu/ui_static_data(mob/user) . = ..() var/list/data = list() - data["ordnance_options"] = ORDNANCE_OPTIONS + data["ordnance_options"] = ORDNANCE_OPTIONS + + data["missile_ordnance_options"] = MISSILE_ORDNANCE + data["orbital_ordnance_options"] = ORBITAL_ORDNANCE + data["mortar_ordnance_options"] = MORTAR_ORDNANCE + data["misc_ordnance_options"] = MISC_ORDNANCE - data["missile_ordnance_options"] = MISSILE_ORDNANCE - data["orbital_ordnance_options"] = ORBITAL_ORDNANCE - data["mortar_ordnance_options"] = MORTAR_ORDNANCE - data["misc_ordnance_options"] = MISC_ORDNANCE + return data + +//Input all the dynamic data, the selected ordnance, and whether it's armed or not. +/datum/fire_support_menu/ui_data(mob/user) + . = ..() + var/list/data = list() data["selected_ordnance"] = selected_ordnance data["fire_support_click_intercept"] = fire_support_click_intercept @@ -260,11 +273,6 @@ GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) /datum/fire_support_menu/proc/handle_orbital_ordnance(turf/target_turf, obj/structure/ob_ammo/warhead/ammo) ammo.warhead_impact(target_turf) -///Deletes the mortar when the menu is closed so we dont make a thousand of them. -/datum/fire_support_menu/Destroy(force, ...) - QDEL_NULL(abstract_mortar) - return ..() - #undef ORDNANCE_OPTIONS #undef ORBITAL_ORDNANCE #undef MORTAR_ORDNANCE From 15bb5ed5c3352c28f882fbcf65244508c86bbc83 Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:05:23 +0200 Subject: [PATCH 13/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm god damn indentation!!! Co-authored-by: Doubleumc --- .../game_master/extra_buttons/fire_support_menu.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 7fa847135d..66ba72c4f5 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -40,12 +40,12 @@ GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) . = ..() var/list/data = list() - data["ordnance_options"] = ORDNANCE_OPTIONS + data["ordnance_options"] = ORDNANCE_OPTIONS - data["missile_ordnance_options"] = MISSILE_ORDNANCE - data["orbital_ordnance_options"] = ORBITAL_ORDNANCE - data["mortar_ordnance_options"] = MORTAR_ORDNANCE - data["misc_ordnance_options"] = MISC_ORDNANCE + data["missile_ordnance_options"] = MISSILE_ORDNANCE + data["orbital_ordnance_options"] = ORBITAL_ORDNANCE + data["mortar_ordnance_options"] = MORTAR_ORDNANCE + data["misc_ordnance_options"] = MISC_ORDNANCE return data From 5db56f8eee4f3f71e6e1006c905a505d3dbf822f Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:11:34 +0200 Subject: [PATCH 14/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm Doubleumc wanted this. Co-authored-by: Doubleumc --- .../modules/admin/game_master/extra_buttons/fire_support_menu.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 66ba72c4f5..12d332da1e 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -1,4 +1,3 @@ -GLOBAL_DATUM_INIT(fire_support_menu, /datum/fire_support_menu, new) #define FIRE_SUPPORT_CLICK_INTERCEPT_ACTION "fire_support_click_intercept_action" //Various ordnance selections From 69f2d6c4364f617be1cd1a1ffedd9ed6e3e8cadf Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:11:45 +0200 Subject: [PATCH 15/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm Doubleumc wanted this. Co-authored-by: Doubleumc --- .../admin/game_master/extra_buttons/fire_support_menu.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 12d332da1e..6475b2fe17 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -12,7 +12,7 @@ set category = "Game Master.Extras" if(!check_rights(R_ADMIN)) return - GLOB.fire_support_menu.tgui_interact(mob) + new /datum/fire_support_menu(mob) ///The actual menu datum /datum/fire_support_menu From 5c7c12fd2ca026d8ff0f0d42f73c54678200b3f8 Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:11:57 +0200 Subject: [PATCH 16/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm Doubleumc wanted this. Co-authored-by: Doubleumc --- .../modules/admin/game_master/extra_buttons/fire_support_menu.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 6475b2fe17..a54a392f29 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -32,7 +32,6 @@ if(!ui) ui = new(user, src, "GameMasterFireSupportMenu", "Fire Support Menu") ui.open() - user.client?.click_intercept = src ///Input all the options for the ordnance panel. Only fires once, as the available ammo types shouldnt change. And if they do, something's very wrong /datum/fire_support_menu/ui_static_data(mob/user) From 1400934ed86a1e0cbd5e8b489e2583313ff9865b Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:12:05 +0200 Subject: [PATCH 17/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm Doubleumc wanted this. Co-authored-by: Doubleumc --- .../modules/admin/game_master/extra_buttons/fire_support_menu.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index a54a392f29..010630406d 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -25,6 +25,7 @@ ///Deletes the mortar when the menu is closed so we dont make a thousand of them. /datum/fire_support_menu/Destroy(force, ...) QDEL_NULL(abstract_mortar) + holder = null return ..() /datum/fire_support_menu/tgui_interact(mob/user, datum/tgui/ui) From 8941735a8db18f43d55dffb9eaa9c2a169697e93 Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:12:13 +0200 Subject: [PATCH 18/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm Doubleumc wanted this. Co-authored-by: Doubleumc --- .../game_master/extra_buttons/fire_support_menu.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 010630406d..7ea0f07636 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -21,6 +21,17 @@ var/sound_cooldown = FALSE ///Mortar to fire the abstract shells. var/obj/structure/mortar/abstract_mortar = new() + var/client/holder + +/datum/fire_support_menu/New(user) + if(isclient(user)) + holder = user + else + var/mob/mob = user + holder = mob.client + + holder.click_intercept = src + tgui_interact(holder.mob) ///Deletes the mortar when the menu is closed so we dont make a thousand of them. /datum/fire_support_menu/Destroy(force, ...) From 5a22285c8505717e7432678584b637060c544d8f Mon Sep 17 00:00:00 2001 From: sunofang <38206283+sunofang@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:12:36 +0200 Subject: [PATCH 19/21] Update code/modules/admin/game_master/extra_buttons/fire_support_menu.dm Doubleumc wanted this. Co-authored-by: Doubleumc --- .../modules/admin/game_master/extra_buttons/fire_support_menu.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm index 7ea0f07636..c3469071f3 100644 --- a/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm +++ b/code/modules/admin/game_master/extra_buttons/fire_support_menu.dm @@ -88,6 +88,7 @@ user_client.click_intercept = null fire_support_click_intercept = FALSE + qdel(src) ///Handles firing logic whenever the mouse is clicked, and the fire_support_click_intercept var is TRUE /datum/fire_support_menu/proc/InterceptClickOn(mob/user, params, atom/object) From 1249718df52953f32afab680be58c31ee9da738b Mon Sep 17 00:00:00 2001 From: SunoFang Date: Sat, 3 Aug 2024 22:07:09 +0200 Subject: [PATCH 20/21] It now also removes fire support menu --- code/modules/admin/admin_verbs.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 94defce9c4..52fbbd11d5 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -371,6 +371,7 @@ var/list/roundstart_mod_verbs = list( /client/proc/game_master_rename_platoon, /client/proc/toggle_vehicle_blockers, /client/proc/toggle_rappel_menu, + /client/proc/toggle_fire_support_menu, admin_verbs_admin, admin_verbs_ban, admin_verbs_minor_event, From bfe87d018982f1d6015f1cf0e2ebbba7860050f4 Mon Sep 17 00:00:00 2001 From: SunoFang Date: Wed, 7 Aug 2024 20:41:28 +0200 Subject: [PATCH 21/21] JSXifies fire support menu. Yippie! --- ...tMenu.js => GameMasterFireSupportMenu.jsx} | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) rename tgui/packages/tgui/interfaces/{GameMasterFireSupportMenu.js => GameMasterFireSupportMenu.jsx} (85%) diff --git a/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js b/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.jsx similarity index 85% rename from tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js rename to tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.jsx index dee32ba4a0..f8be7b7f95 100644 --- a/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.js +++ b/tgui/packages/tgui/interfaces/GameMasterFireSupportMenu.jsx @@ -1,10 +1,11 @@ import { auto } from '@popperjs/core'; + import { useBackend } from '../backend'; import { Button, Collapsible, Section, Stack } from '../components'; import { Window } from '../layouts'; export const GameMasterFireSupportMenu = (props, context) => { - const { act, data } = useBackend(context); + const { act, data } = useBackend(); return ( @@ -13,7 +14,8 @@ export const GameMasterFireSupportMenu = (props, context) => { title="Fire Support Menu" align="center" justify="center" - height={auto}> + height={auto} + > {data.missile_ordnance_options.map((ordnance, i) => ( ))} {data.orbital_ordnance_options.map((ordnance, i) => ( ))} {data.mortar_ordnance_options.map((ordnance, i) => ( ))} {data.misc_ordnance_options.map((ordnance, i) => ( ))}