Skip to content

Commit

Permalink
does the things
Browse files Browse the repository at this point in the history
  • Loading branch information
sunofang committed Jul 24, 2024
1 parent 04f3175 commit 166e5ac
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions code/modules/admin/game_master/extra_buttons/fire_support_menu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,36 @@ 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)
ui = new(user, src, "GameMasterFireSupportMenu", "Fire Support Menu")
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()

Check failure on line 41 in code/modules/admin/game_master/extra_buttons/fire_support_menu.dm

View workflow job for this annotation

GitHub Actions / Run Linters

got '{', expected one of: operator, field access, as, 'in', ',', ';'

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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 166e5ac

Please sign in to comment.