whitelist updates (#19288)

* whitelist updates

* migrate things to module

* .

* some more

* robot IDs are now handled by module

* special ids

* .

* .

* .

* .

* .

* .

* move that

* .

* initial

* admin whitelist TGUI

* .

* .

* lol
This commit is contained in:
Kashargul
2026-03-21 01:16:13 +01:00
committed by GitHub
parent a6b6ccb167
commit 418bc73c80
52 changed files with 742 additions and 378 deletions
+20 -12
View File
@@ -67,14 +67,14 @@
.["target"]["active_restrictions"] = target.restrict_modules_to
var/list/possible_restrictions = list()
for(var/entry in GLOB.robot_modules)
if(!target.restrict_modules_to.Find(entry))
if(!(target.restrict_modules_to?.Find(entry)))
possible_restrictions += entry
.["target"]["possible_restrictions"] = possible_restrictions
// Target section for options once a module has been selected
if(target.module)
.["target"]["active"] = target.icon_selected
.["target"]["sprite"] = sanitize_css_class_name("[target.sprite_datum.type]")
.["target"]["sprite_size"] = spritesheet.icon_size_id(.["target"]["sprite"] + "S")
.["target"]["sprite_size"] = spritesheet?.icon_size_id(.["target"]["sprite"] + "S")
.["target"]["modules"] = get_target_items(user)
var/list/module_options = list()
for(var/module in GLOB.robot_modules)
@@ -185,10 +185,16 @@
target.crisis_override = !target.crisis_override
return TRUE
if("add_restriction")
target.restrict_modules_to |= params["new_restriction"]
var/new_restriction = params["new_restriction"]
if(!(new_restriction in GLOB.robot_modules))
return FALSE
LAZYOR(target.restrict_modules_to, new_restriction)
return TRUE
if("remove_restriction")
target.restrict_modules_to -= params["rem_restriction"]
var/rem_restriction = params["rem_restriction"]
if(!(rem_restriction in GLOB.robot_modules))
return FALSE
LAZYREMOVE(target.restrict_modules_to, rem_restriction)
return TRUE
if("select_source")
if(source)
@@ -196,13 +202,15 @@
var/module_type = GLOB.robot_modules[params["new_source"]]
if(ispath(module_type, /obj/item/robot_module/robot/syndicate))
source = new /mob/living/silicon/robot/syndicate(null)
else if(ispath(module_type, /obj/item/robot_module/robot/malf))
source = new /mob/living/silicon/robot/malf(null)
else
source = new /mob/living/silicon/robot(null)
source.modtype = params["new_source"]
var/obj/item/robot_module/robot/robot_type = new module_type(source)
source.sprite_datum = pick(SSrobot_sprites.get_module_sprites(source.modtype, source))
source.update_icon()
source.emag_items = 1
source.emag_items = TRUE
if(!istype(robot_type, /obj/item/robot_module/robot))
QDEL_NULL(source)
return TRUE
@@ -291,7 +299,7 @@
new module_type(source)
source.sprite_datum = target.sprite_datum
source.update_icon()
source.emag_items = 1
source.emag_items = TRUE
// Target
target.uneq_all()
target.hud_used?.update_robot_modules_display(TRUE)
@@ -599,25 +607,25 @@
if(!our_ai)
our_ai = select_active_ai_with_fewest_borgs()
if(our_ai)
target.lawupdate = 1
target.lawupdate = TRUE
target.connect_to_ai(our_ai)
return TRUE
if("disconnect_ai")
if(target.is_slaved())
target.disconnect_from_ai()
target.lawupdate = 0
target.lawupdate = FALSE
return TRUE
if("toggle_emag")
if(target.emagged)
target.emagged = 0
target.emagged = FALSE
target.clear_supplied_laws()
target.clear_inherent_laws()
target.laws = new using_map.default_law_type
to_chat(target, span_danger("Laws updated!\n") + target.laws.get_formatted_laws())
target.hud_used?.update_robot_modules_display()
else
target.emagged = 1
target.lawupdate = 0
target.emagged = TRUE
target.lawupdate = FALSE
target.disconnect_from_ai()
target.clear_supplied_laws()
target.clear_inherent_laws()
@@ -639,7 +647,7 @@
var/list/source_list = list()
source_list["model"] = source.module
source_list["sprite"] = sanitize_css_class_name("[source.sprite_datum.type]")
source_list["sprite_size"] = spritesheet.icon_size_id(source_list["sprite"] + "S")
source_list["sprite_size"] = spritesheet?.icon_size_id(source_list["sprite"] + "S")
var/list/source_items = list()
for(var/obj/item in (source.module.modules | source.module.emag))
var/exists