OPFOR Panel Fixes (#3761)

## About The Pull Request

- Change some text areas to have `fluid` so they're not small
- Move information that was on a hover button into the placeholder text
for the text area for two inputs
- Bump window height slightly so it doesn't get scrollbary
- Change some `onChange` to `onBlur` so it doesn't hammer the server
with `ui_act` calls literally every single time someone types a
character
- Fix the intensity slider just saying NaN
- Change the intensity slider so the slider itself colors to what
"interval" of intensity you're in, uses the color of the button below it
- Remove a line in the backstory placeholder text that says to check a
discord channel we don't have
- Moved some stuff in `ui_data` to `ui_static_data` that absolutely did
not need to get sent every update
- Fixed an incorrect variable in `export_json` that made it fail to
export equipment properly

## Why It's Good For The Game

Fixes #3758 

## Proof Of Testing
<details>
<summary>Screenshots/Videos</summary>


![image](https://github.com/user-attachments/assets/2cd9ea6c-f5ca-4c82-9fe7-d118bd8bdda6)

</details>

## Changelog
🆑
fix: OPFOR should no longer eat all inputs
fix: OPFOR panel should now correctly export to JSON
/🆑
This commit is contained in:
Roxy
2025-05-08 14:50:35 -07:00
committed by GitHub
parent 6490bee9ef
commit f73da55b45
5 changed files with 44 additions and 71 deletions
@@ -184,22 +184,6 @@
data["equipment_issued"] = equipment_issued
data["equipment_list"] = list()
for(var/equipment_category in SSopposing_force.equipment_list)
var/category_items = list()
for(var/datum/opposing_force_equipment/opfor_equipment as anything in SSopposing_force.equipment_list[equipment_category])
category_items += list(list(
"ref" = REF(opfor_equipment),
"name" = opfor_equipment.name,
"description" = opfor_equipment.description,
"equipment_category" = opfor_equipment.category,
"admin_note" = opfor_equipment.admin_note,
))
data["equipment_list"] += list(list(
"category" = equipment_category,
"items" = category_items,
))
data["selected_equipment"] = list()
for(var/datum/opposing_force_selected_equipment/equipment as anything in selected_equipment)
var/list/equipment_data = list(
@@ -218,6 +202,25 @@
return data
/datum/opposing_force/ui_static_data(mob/user)
. = ..()
.["equipment_list"] = list()
for(var/equipment_category in SSopposing_force.equipment_list)
var/category_items = list()
for(var/datum/opposing_force_equipment/opfor_equipment as anything in SSopposing_force.equipment_list[equipment_category])
category_items += list(list(
"ref" = REF(opfor_equipment),
"name" = opfor_equipment.name,
"description" = opfor_equipment.description,
"equipment_category" = opfor_equipment.category,
"admin_note" = opfor_equipment.admin_note,
))
.["equipment_list"] += list(list(
"category" = equipment_category,
"items" = category_items,
))
/datum/opposing_force/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
@@ -964,7 +967,7 @@
)
for(var/datum/opposing_force_selected_equipment/iterating_equipment as anything in selected_equipment)
exported_data["selected_equipment"]["[objectives.Find(iterating_equipment)]"] = list(
exported_data["selected_equipment"]["[selected_equipment.Find(iterating_equipment)]"] = list(
"equipment_name" = iterating_equipment.opposing_force_equipment.name,
"equipment_parent_category" = iterating_equipment.opposing_force_equipment.category,
"equipment_parent_type" = iterating_equipment.opposing_force_equipment.type,
@@ -986,22 +989,6 @@
fdel(to_write_file)
/datum/action/opfor
name = "Open Opposing Force Panel"
button_icon_state = "round_end"
/datum/action/opfor/Trigger(trigger_flags)
. = ..()
if(!.)
return
owner.opposing_force()
/datum/action/opfor/IsAvailable(feedback = FALSE)
if(!target)
return FALSE
return ..()
/obj/effect/statclick/opfor_specific
var/datum/opposing_force/opfor
@@ -195,9 +195,3 @@ SUBSYSTEM_DEF(opposing_force)
returned_html += " - [opposing_force.build_html_panel_entry()]"
return returned_html.Join("<br>")
/// Gives a mind the opfor action button, which calls the opfor verb when pressed
/datum/controller/subsystem/opposing_force/proc/give_opfor_button(mob/living/carbon/human/player)
var/datum/action/opfor/info_button
info_button = new(src)
info_button.Grant(player)