mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
removes sleep from light flickers (#17211)
* removes sleep from light flickers * . * . * move the counter * oups * . * .
This commit is contained in:
@@ -300,13 +300,13 @@
|
||||
screen = MED_DATA_RECORD
|
||||
if("sync_r")
|
||||
if(active2)
|
||||
set_temp(client_update_record(src,usr))
|
||||
set_temp(client_update_record(src,ui.user))
|
||||
if("edit_notes")
|
||||
// The modal input in tgui is busted for this sadly...
|
||||
var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(usr.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(usr.Adjacent(src))
|
||||
var/new_notes = strip_html_simple(tgui_input_text(ui.user,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(ui.user.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(ui.user, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(ui.user.Adjacent(src))
|
||||
active2.fields["notes"] = new_notes
|
||||
if("new")
|
||||
if(istype(active1, /datum/data/record) && !istype(active2, /datum/data/record))
|
||||
|
||||
@@ -272,13 +272,13 @@
|
||||
qdel(active2)
|
||||
if("sync_r")
|
||||
if(active2)
|
||||
set_temp(client_update_record(src,usr))
|
||||
set_temp(client_update_record(src,ui.user))
|
||||
if("edit_notes")
|
||||
// The modal input in tgui is busted for this sadly...
|
||||
var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(usr.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(usr.Adjacent(src))
|
||||
var/new_notes = strip_html_simple(tgui_input_text(ui.user,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(ui.user.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(ui.user, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(ui.user.Adjacent(src))
|
||||
active2.fields["notes"] = new_notes
|
||||
if("d_rec")
|
||||
var/datum/data/record/general_record = locate(params["d_rec"] || "")
|
||||
|
||||
@@ -216,13 +216,13 @@
|
||||
set_temp("All employment records deleted.")
|
||||
if("sync_r")
|
||||
if(active1)
|
||||
set_temp(client_update_record(src,active1,usr))
|
||||
set_temp(client_update_record(src,active1,ui.user))
|
||||
if("edit_notes")
|
||||
// The modal input in tgui is busted for this sadly...
|
||||
var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active1.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(usr.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(usr.Adjacent(src))
|
||||
var/new_notes = strip_html_simple(tgui_input_text(ui.user,"Enter new information here.","Character Preference", html_decode(active1.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(ui.user.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(ui.user, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(ui.user.Adjacent(src))
|
||||
active1.fields["notes"] = new_notes
|
||||
if("del_r")
|
||||
if(PDA_Manifest)
|
||||
|
||||
@@ -729,19 +729,27 @@ var/global/list/light_type_cache = list()
|
||||
|
||||
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
|
||||
if(flickering) return
|
||||
flickering = 1
|
||||
spawn(0)
|
||||
if(on && status == LIGHT_OK)
|
||||
for(var/i = 0; i < amount; i++)
|
||||
if(status != LIGHT_OK) break
|
||||
on = !on
|
||||
update(0)
|
||||
if(!on) // Only play when the light turns off.
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 50, 1)
|
||||
sleep(rand(5, 15))
|
||||
on = (status == LIGHT_OK)
|
||||
update(0)
|
||||
if(on && status == LIGHT_OK)
|
||||
flickering = 1
|
||||
do_flicker(amount)
|
||||
|
||||
/obj/machinery/light/proc/do_flicker(remaining_flicks)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
PRIVATE_PROC(TRUE)
|
||||
if(status != LIGHT_OK)
|
||||
flickering = 0
|
||||
return
|
||||
on = !on
|
||||
update(0)
|
||||
if(!on) // Only play when the light turns off.
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 50, 1)
|
||||
if(remaining_flicks > 0)
|
||||
remaining_flicks--
|
||||
addtimer(CALLBACK(src, PROC_REF(do_flicker), remaining_flicks), rand(5, 15), TIMER_DELETE_ME)
|
||||
return
|
||||
on = (status == LIGHT_OK)
|
||||
update(0)
|
||||
flickering = 0
|
||||
|
||||
// ai attack - turn on/off emergency lighting for a specific fixture
|
||||
/obj/machinery/light/attack_ai(mob/user)
|
||||
|
||||
@@ -68,10 +68,10 @@
|
||||
var/sawn_off = FALSE
|
||||
|
||||
/obj/item/gun/projectile/shotgun/pump/rifle/ceremonial/attackby(var/obj/item/A as obj, mob/user as mob)
|
||||
if(sawn_off)
|
||||
to_chat(user, span_warning("The [src] is already shortened!"))
|
||||
return
|
||||
if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != ITEMSIZE_NORMAL)
|
||||
if(sawn_off)
|
||||
to_chat(user, span_warning("The [src] is already shortened!"))
|
||||
return
|
||||
to_chat(user, span_notice("You begin to shorten the barrel and stock of \the [src]."))
|
||||
if(loaded.len)
|
||||
afterattack(user, user)
|
||||
|
||||
Reference in New Issue
Block a user