Tgui input refresh (#64331)

This commit is contained in:
Jeremiah
2022-02-05 19:44:59 +02:00
committed by GitHub
parent cf1cfc74ee
commit 30253cf6a8
54 changed files with 444 additions and 420 deletions
+5 -7
View File
@@ -91,16 +91,15 @@
to_chat(user, span_notice("New sound file set to [sound_file]."), confidential = TRUE)
if(href_list["edit_volume"])
var/new_volume = tgui_input_number(user, "Choose a volume", "Sound Emitter", sound_volume, 100)
if(isnull(new_volume))
if(!new_volume)
return
new_volume = clamp(new_volume, 0, 100)
sound_volume = new_volume
to_chat(user, span_notice("Volume set to [sound_volume]%."), confidential = TRUE)
if(href_list["edit_mode"])
var/new_mode
var/mode_list = list("Local (normal sound)" = SOUND_EMITTER_LOCAL, "Direct (not affected by environment/location)" = SOUND_EMITTER_DIRECT)
new_mode = tgui_input_list(user, "Choose a new mode", "Sound Emitter", mode_list)
if(isnull(new_mode))
if(!new_mode)
return
motus_operandi = mode_list[new_mode]
to_chat(user, span_notice("Mode set to [motus_operandi]."), confidential = TRUE)
@@ -108,15 +107,14 @@
var/new_range
var/range_list = list("Radius (all mobs within a radius)" = SOUND_EMITTER_RADIUS, "Z-Level (all mobs on the same z)" = SOUND_EMITTER_ZLEVEL, "Global (all players)" = SOUND_EMITTER_GLOBAL)
new_range = tgui_input_list(user, "Choose a new range", "Sound Emitter", range_list)
if(isnull(new_range))
if(!new_range)
return
emitter_range = range_list[new_range]
to_chat(user, span_notice("Range set to [emitter_range]."), confidential = TRUE)
if(href_list["edit_radius"])
var/new_radius = tgui_input_number(user, "Choose a radius.", "Sound Emitter", sound_volume, 127)
if(isnull(new_radius))
var/new_radius = tgui_input_number(user, "Choose a radius", "Sound Emitter", sound_volume, 127)
if(!new_radius)
return
new_radius = clamp(new_radius, 0, 127)
play_radius = new_radius
to_chat(user, span_notice("Audible radius set to [play_radius]."), confidential = TRUE)
if(href_list["play"])
+2 -2
View File
@@ -85,9 +85,9 @@
switch (action)
if ("set_charge")
var/newcharge = tgui_input_number(usr, "Set new charge", borg.name, borg.cell.charge, borg.cell.maxcharge)
if (isnull(newcharge))
if(isnull(newcharge))
return
borg.cell.charge = clamp(newcharge, 0, borg.cell.maxcharge)
borg.cell.charge = newcharge
message_admins("[key_name_admin(user)] set the charge of [ADMIN_LOOKUPFLW(borg)] to [borg.cell.charge].")
log_silicon("[key_name(user)] set the charge of [key_name(borg)] to [borg.cell.charge].")
if ("remove_cell")