mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
[NO GBP] RCD & RTD ui updates when switching between root categories (#79021)
## About The Pull Request When switching between "Construction" & "Airlocks" tab the UI would not update unless you closed & reopened the UI. This was annoying so I fixed it & now the UI updates properly. Same applies for RTD when switching between floor types ## Changelog 🆑 fix: RCD & RTD ui updates when switching between root categories /🆑
This commit is contained in:
@@ -290,6 +290,7 @@
|
||||
data["root_categories"] = list()
|
||||
for(var/category in GLOB.rcd_designs)
|
||||
data["root_categories"] += category
|
||||
data["selected_root"] = root_category
|
||||
|
||||
data["categories"] = list()
|
||||
for(var/sub_category as anything in GLOB.rcd_designs[root_category])
|
||||
@@ -318,7 +319,6 @@
|
||||
var/list/data = ..()
|
||||
|
||||
//main categories
|
||||
data["selected_root"] = root_category
|
||||
data["selected_category"] = design_category
|
||||
data["selected_design"] = design_title
|
||||
|
||||
@@ -336,6 +336,7 @@
|
||||
var/new_root = params["root_category"]
|
||||
if(GLOB.rcd_designs[new_root] != null) //is a valid category
|
||||
root_category = new_root
|
||||
update_static_data_for_all_viewers()
|
||||
|
||||
if("design")
|
||||
//read and validate params from UI
|
||||
|
||||
@@ -171,6 +171,7 @@
|
||||
data["root_categories"] = list()
|
||||
for(var/category in GLOB.floor_designs)
|
||||
data["root_categories"] += category
|
||||
data["selected_root"] = root_category
|
||||
|
||||
data["categories"] = list()
|
||||
for(var/sub_category as anything in GLOB.floor_designs[root_category])
|
||||
@@ -188,19 +189,20 @@
|
||||
/obj/item/construction/rtd/ui_data(mob/user)
|
||||
var/list/data = ..()
|
||||
|
||||
data["selected_root"] = root_category
|
||||
data["selected_category"] = design_category
|
||||
selected_design.fill_ui_data(data)
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/construction/rtd/handle_ui_act(action, params, datum/tgui/ui, datum/ui_state/state)
|
||||
|
||||
var/floor_designs = GLOB.floor_designs
|
||||
switch(action)
|
||||
if("root_category")
|
||||
var/new_root = params["root_category"]
|
||||
if(floor_designs[new_root] != null) //is a valid category
|
||||
root_category = new_root
|
||||
update_static_data_for_all_viewers()
|
||||
|
||||
if("set_dir")
|
||||
var/direction = text2dir(params["dir"])
|
||||
|
||||
Reference in New Issue
Block a user