mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 06:58:30 +01:00
moves robot decals and animations to an ui (#18641)
* moves robot decals and animations to an ui * Update robot_ui_decals.dm * self cleanup * move it to subsystems * . * urg * . * .
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
var/list/species_whitelist = list(),
|
||||
var/list/species_blacklist = list(),
|
||||
var/datum/tgui_state/state = GLOB.tgui_self_state)
|
||||
var/datum/tgui_module/appearance_changer/AC = new(src, src, check_species_whitelist, species_whitelist, species_blacklist)
|
||||
var/datum/tgui_module/appearance_changer/self_deleting/AC = new(src, src, check_species_whitelist, species_whitelist, species_blacklist)
|
||||
AC.flags = flags
|
||||
AC.tgui_interact(user, custom_state = state)
|
||||
|
||||
|
||||
@@ -489,50 +489,6 @@
|
||||
handle_light()
|
||||
update_icon()
|
||||
|
||||
/mob/living/silicon/robot/verb/toggle_robot_decals() // loads overlay UNDER lights.
|
||||
set category = "Abilities.Settings"
|
||||
set name = "Toggle Extra Decals"
|
||||
|
||||
if(!sprite_datum)
|
||||
return
|
||||
if(!LAZYLEN(sprite_datum.sprite_decals))
|
||||
to_chat(src, span_warning("This module does not support decals."))
|
||||
return
|
||||
|
||||
var/extra_message = "Enabled decals:\n"
|
||||
for(var/decal in robotdecal_on)
|
||||
extra_message += decal + "\n"
|
||||
|
||||
var/decal_to_toggle = tgui_input_list(src, "Please select which decal you want to toggle\n[extra_message]", "Decal Toggle", sprite_datum.sprite_decals)
|
||||
if(!decal_to_toggle)
|
||||
return
|
||||
|
||||
decal_to_toggle = lowertext(decal_to_toggle)
|
||||
|
||||
if(robotdecal_on.Find(decal_to_toggle))
|
||||
robotdecal_on -= decal_to_toggle
|
||||
to_chat(src, span_filter_notice("You disable your \"[decal_to_toggle]\" extra apperances."))
|
||||
else
|
||||
robotdecal_on += decal_to_toggle
|
||||
to_chat(src, span_filter_notice("You enable your \"[decal_to_toggle]\" extra apperances."))
|
||||
update_icon()
|
||||
|
||||
/mob/living/silicon/robot/verb/flick_robot_animation()
|
||||
set category = "Abilities.Settings"
|
||||
set name = "Flick Animation"
|
||||
|
||||
if(!sprite_datum)
|
||||
return
|
||||
if(!LAZYLEN(sprite_datum.sprite_animations))
|
||||
to_chat(src, span_warning("This module does not support animations."))
|
||||
return
|
||||
|
||||
var/animation_to_play = tgui_input_list(src, "Please select which decal you want to flick", "Flick Decal", sprite_datum.sprite_animations)
|
||||
if(!animation_to_play)
|
||||
return
|
||||
|
||||
flick("[sprite_datum.sprite_icon_state]-[animation_to_play]", src)
|
||||
|
||||
/mob/living/silicon/robot/verb/toggle_glowy_stomach()
|
||||
set category = "Abilities.Settings"
|
||||
set name = "Toggle Glowing Stomach & Accents"
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
// Robot decal and animation control
|
||||
/datum/tgui_module/robot_ui_decals
|
||||
name = "Robot Decal & Animation Control"
|
||||
tgui_id = "RobotDecals"
|
||||
|
||||
/datum/tgui_module/robot_ui_decals/tgui_state(mob/user)
|
||||
return GLOB.tgui_self_state
|
||||
|
||||
/datum/tgui_module/robot_ui_decals/tgui_static_data()
|
||||
var/list/data = ..()
|
||||
|
||||
var/mob/living/silicon/robot/R = host
|
||||
|
||||
if(!R.sprite_datum)
|
||||
return data
|
||||
|
||||
data["all_decals"] = R.sprite_datum.sprite_decals
|
||||
data["all_animations"] = R.sprite_datum.sprite_animations
|
||||
|
||||
return data
|
||||
|
||||
/datum/tgui_module/robot_ui_decals/tgui_data()
|
||||
var/list/data = ..()
|
||||
|
||||
var/mob/living/silicon/robot/R = host
|
||||
data["active_decals"] = R.robotdecal_on
|
||||
|
||||
var/robot_theme = R.get_ui_theme()
|
||||
if(robot_theme)
|
||||
data["theme"] = robot_theme
|
||||
|
||||
return data
|
||||
|
||||
/datum/tgui_module/robot_ui_decals/tgui_act(action, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
var/mob/living/silicon/robot/R = host
|
||||
if(!R.sprite_datum)
|
||||
return FALSE
|
||||
|
||||
switch(action)
|
||||
if("toggle_decal")
|
||||
if(!LAZYLEN(R.sprite_datum.sprite_decals))
|
||||
return FALSE
|
||||
var/decal_to_toggle = lowertext(params["value"])
|
||||
if(!(decal_to_toggle in R.sprite_datum.sprite_decals))
|
||||
return FALSE
|
||||
if(R.robotdecal_on.Find(decal_to_toggle))
|
||||
R.robotdecal_on -= decal_to_toggle
|
||||
else
|
||||
R.robotdecal_on += decal_to_toggle
|
||||
R.update_icon()
|
||||
. = TRUE
|
||||
if("flick_animation")
|
||||
if(!LAZYLEN(R.sprite_datum.sprite_animations))
|
||||
return FALSE
|
||||
var/animation_to_flick = lowertext(params["value"])
|
||||
if(!(animation_to_flick in R.sprite_datum.sprite_animations))
|
||||
return FALSE
|
||||
R.cut_overlays()
|
||||
R.ImmediateOverlayUpdate()
|
||||
flick("[R.sprite_datum.sprite_icon_state]-[animation_to_flick]", R)
|
||||
R.update_icon()
|
||||
. = TRUE
|
||||
@@ -14,6 +14,7 @@
|
||||
if(isrobot(user))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
R.selecting_module = FALSE
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/robot_ui_module/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui)
|
||||
. = ..()
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
QDEL_NULL(idcard)
|
||||
if(laws)
|
||||
QDEL_NULL(laws)
|
||||
clear_subsystems()
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/proc/init_id()
|
||||
|
||||
@@ -46,6 +46,15 @@
|
||||
AH.register_alarm(src, /mob/living/silicon/proc/receive_alarm)
|
||||
queued_alarms[AH] = list() // Makes sure alarms remain listed in consistent order
|
||||
|
||||
/mob/living/silicon/proc/clear_subsystems()
|
||||
QDEL_NULL(alarm_monitor)
|
||||
QDEL_NULL(atmos_control)
|
||||
QDEL_NULL(crew_monitor)
|
||||
QDEL_NULL(crew_manifest)
|
||||
QDEL_NULL(law_manager)
|
||||
QDEL_NULL(power_monitor)
|
||||
QDEL_NULL(rcon)
|
||||
|
||||
/********************
|
||||
* Alarm Monitor *
|
||||
********************/
|
||||
@@ -108,3 +117,23 @@
|
||||
set name = "RCON"
|
||||
|
||||
rcon.tgui_interact(src)
|
||||
|
||||
/mob/living/silicon/robot
|
||||
var/datum/tgui_module/robot_ui_decals/decal_control
|
||||
|
||||
/mob/living/silicon/robot/init_subsystems()
|
||||
..()
|
||||
decal_control = new(src)
|
||||
|
||||
/mob/living/silicon/robot/clear_subsystems()
|
||||
QDEL_NULL(decal_control)
|
||||
..()
|
||||
|
||||
/mob/living/silicon/robot/verb/toggle_robot_decals()
|
||||
set category = "Abilities.Settings"
|
||||
set name = "Control Robot Decals & Animations"
|
||||
|
||||
if(!sprite_datum)
|
||||
return
|
||||
|
||||
decal_control.tgui_interact(src)
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
var/number_pages = 0
|
||||
|
||||
/datum/tgui_module/player_notes/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/player_notes/proc/filter_ckeys(var/page, var/filter)
|
||||
var/savefile/S=new("data/player_notes.sav")
|
||||
var/list/note_keys
|
||||
@@ -106,6 +110,10 @@
|
||||
|
||||
var/key = null
|
||||
|
||||
/datum/tgui_module/player_notes_info/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/player_notes_info/tgui_state(mob/user)
|
||||
return ADMIN_STATE(R_ADMIN|R_EVENT|R_DEBUG)
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
name = "Admin Shuttle Controller"
|
||||
tgui_id = "AdminShuttleController"
|
||||
|
||||
/datum/tgui_module/admin_shuttle_controller/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/admin_shuttle_controller/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
var/list/data = ..()
|
||||
|
||||
|
||||
@@ -1024,6 +1024,10 @@
|
||||
return STATUS_CLOSE
|
||||
return ..()
|
||||
|
||||
/datum/tgui_module/appearance_changer/vore/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/appearance_changer/vore/update_active_camera_screen()
|
||||
cam_screen.vis_contents = list(owner)
|
||||
cam_background.icon_state = "clear"
|
||||
@@ -1066,6 +1070,10 @@
|
||||
flags = APPEARANCE_ALL_COSMETIC
|
||||
customize_usr = TRUE
|
||||
|
||||
/datum/tgui_module/appearance_changer/cocoon/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/appearance_changer/cocoon/tgui_status(mob/user, datum/tgui_state/state)
|
||||
if(!istype(owner.loc, /obj/item/holder/micro))
|
||||
return STATUS_CLOSE
|
||||
@@ -1079,6 +1087,10 @@
|
||||
flags = APPEARANCE_ALL_COSMETIC
|
||||
customize_usr = TRUE
|
||||
|
||||
/datum/tgui_module/appearance_changer/superpower/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/appearance_changer/superpower/tgui_status(mob/user, datum/tgui_state/state)
|
||||
var/datum/gene/G = get_gene_from_trait(/datum/trait/positive/superpower_morph)
|
||||
if(!owner.dna.GetSEState(G.block))
|
||||
@@ -1093,6 +1105,10 @@
|
||||
flags = APPEARANCE_ALL_COSMETIC
|
||||
customize_usr = TRUE
|
||||
|
||||
/datum/tgui_module/appearance_changer/innate/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/appearance_changer/innate/tgui_status(mob/user, datum/tgui_state/state)
|
||||
if(owner.stat != CONSCIOUS)
|
||||
return STATUS_CLOSE
|
||||
@@ -1148,3 +1164,8 @@
|
||||
// Add listeners back
|
||||
owner.AddComponent(/datum/component/recursive_move)
|
||||
RegisterSignal(owner, COMSIG_OBSERVER_MOVED, PROC_REF(update_active_camera_screen), TRUE)
|
||||
|
||||
/datum/tgui_module/appearance_changer/self_deleting
|
||||
/datum/tgui_module/appearance_changer/self_deleting/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
@@ -217,3 +217,7 @@
|
||||
/datum/tgui_module/law_manager/admin
|
||||
/datum/tgui_module/law_manager/admin/tgui_state(mob/user)
|
||||
return ADMIN_STATE(R_ADMIN|R_EVENT|R_DEBUG)
|
||||
|
||||
/datum/tgui_module/law_manager/admin/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
@@ -166,6 +166,10 @@
|
||||
/datum/tgui_module/ship/fullmonty/tgui_state(mob/user)
|
||||
return ADMIN_STATE(R_ADMIN|R_EVENT|R_DEBUG)
|
||||
|
||||
/datum/tgui_module/ship/fullmonty/tgui_close(mob/user)
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/datum/tgui_module/ship/fullmonty/New(host, obj/effect/overmap/visitable/ship/new_linked)
|
||||
. = ..()
|
||||
if(!istype(new_linked))
|
||||
|
||||
Reference in New Issue
Block a user