mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-21 03:56:47 +01:00
cleans up some more update Dialog (#19208)
* cleans up some more update Dialog * . * pod UI * . * modern rcon console * . * no dupe tags * . * nbeeds a recode * . * . * ice cream as tgui * , * legacy drone fab * more a POI object * . * missing dels * navbeacon * eh that is part of the default now * del useless list * . * . * . * retail scanner * better * finish retail * . * be gone * . * .
This commit is contained in:
@@ -283,6 +283,21 @@
|
||||
#define rustg_iconforge_generate(file_path, spritesheet_name, sprites, hash_icons, generate_dmi, flatten) RUSTG_CALL(RUST_G, "iconforge_generate")(file_path, spritesheet_name, sprites, "[hash_icons]", "[generate_dmi]", "[flatten]")
|
||||
/// Returns a job_id for use with rustg_iconforge_check()
|
||||
#define rustg_iconforge_generate_async(file_path, spritesheet_name, sprites, hash_icons, generate_dmi, flatten) RUSTG_CALL(RUST_G, "iconforge_generate_async")(file_path, spritesheet_name, sprites, "[hash_icons]", "[generate_dmi]", "[flatten]")
|
||||
/// Creates a single DMI or PNG using 'sprites' as a list of icon states / images.
|
||||
/// This function is intended for generating icons with only a few states that have little in common with each other, and only one size.
|
||||
/// For icons with a large number of states, potentially variable sizes, that re-use sets of transforms more than once, or that benefit from caching, use rustg_iconforge_generate.
|
||||
/// sprites - follows the same format as rustg_iconforge_generate.
|
||||
/// file_path - the full relative path at which the PNG or DMI will be written. It must be a full filepath such as tmp/my_icon.dmi or my_icon.png
|
||||
/// flatten - boolean (0 or 1) determines if the DMI output will be flattened to a single frame/dir if unscoped (null/0 dir or frame values).
|
||||
///
|
||||
/// Returns a HeadlessResult, decoded to a BYOND list (always, it's not possible for this to panic unless rustg itself has an issue) containing the following fields:
|
||||
/// list(
|
||||
/// "file_path" = "tmp/my_icon.dmi" // [whatever you input returned back to you, null if there was a fatal error]
|
||||
/// "width" = 32 // the width, which is determined by the first entry of 'sprites', null if there was a fatal error
|
||||
/// "height" = 32 // the height, which is determined by the first entry of 'sprites', null if there was a fatal error
|
||||
/// "error" = "[A string, null if there were no errors.]"
|
||||
/// )
|
||||
#define rustg_iconforge_generate_headless(file_path, sprites, flatten) json_decode(RUSTG_CALL(RUST_G, "iconforge_generate_headless")(file_path, sprites, "[flatten]"))
|
||||
/// Returns the status of an async job_id, or its result if it is completed. See RUSTG_JOB DEFINEs.
|
||||
#define rustg_iconforge_check(job_id) RUSTG_CALL(RUST_G, "iconforge_check")("[job_id]")
|
||||
/// Clears all cached DMIs and images, freeing up memory.
|
||||
|
||||
@@ -93,12 +93,6 @@
|
||||
return
|
||||
AddComponent(/datum/component/using_machine_shim, O)
|
||||
|
||||
/// deprecated, do not use
|
||||
/obj/item/proc/updateSelfDialog()
|
||||
var/mob/M = src.loc
|
||||
if(istype(M) && M.client && M.check_current_machine(src))
|
||||
src.attack_self(M)
|
||||
|
||||
/// deprecated, do not use
|
||||
/obj/proc/updateUsrDialog(mob/user)
|
||||
if(in_use)
|
||||
@@ -125,21 +119,6 @@
|
||||
src.attack_hand(H)
|
||||
in_use = is_in_use
|
||||
|
||||
/// deprecated, do not use
|
||||
/obj/proc/updateDialog()
|
||||
// Check that people are actually using the machine. If not, don't update anymore.
|
||||
if(in_use)
|
||||
var/list/nearby = viewers(1, src)
|
||||
var/is_in_use = 0
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.check_current_machine(src)))
|
||||
is_in_use = 1
|
||||
src.interact(M)
|
||||
var/ai_in_use = AutoUpdateAI(src)
|
||||
|
||||
if(!ai_in_use && !is_in_use)
|
||||
in_use = 0
|
||||
|
||||
/// deprecated, do not use
|
||||
/obj/machinery/CouldUseTopic(var/mob/user)
|
||||
..()
|
||||
|
||||
@@ -63,9 +63,6 @@
|
||||
//used for optional self-objectives that antagonists can give themselves, which are displayed at the end of the round.
|
||||
var/ambitions
|
||||
|
||||
//used to store what traits the player had picked out in their preferences before joining, in text form.
|
||||
var/list/traits = list()
|
||||
|
||||
var/datum/religion/my_religion
|
||||
|
||||
/datum/mind/New(var/key)
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
if(WIRE_AI_CONTROL)
|
||||
if(!A.aidisabled)
|
||||
A.aidisabled = TRUE
|
||||
A.updateDialog()
|
||||
addtimer(VARSET_CALLBACK(A, aidisabled, FALSE), 10 SECONDS, TIMER_DELETE_ME)
|
||||
|
||||
if(WIRE_SYPHON)
|
||||
|
||||
@@ -110,8 +110,6 @@
|
||||
power_change()
|
||||
update_icon()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/pump/return_air()
|
||||
return air_contents
|
||||
|
||||
|
||||
@@ -84,9 +84,6 @@
|
||||
power_change()
|
||||
update_icon()
|
||||
|
||||
//src.update_icon()
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/scrubber/return_air()
|
||||
return air_contents
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
circuit = /obj/item/circuitboard/pod
|
||||
var/id = 1.0
|
||||
var/obj/machinery/mass_driver/connected = null
|
||||
var/timing = 0.0
|
||||
var/timing = FALSE
|
||||
var/time = 30.0
|
||||
var/title = "Mass Driver Controls"
|
||||
|
||||
@@ -110,36 +110,64 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/pod/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(!Adjacent(user) && !issilicon(user))
|
||||
return
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/computer/pod/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, custom_state)
|
||||
. = ..()
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "PodComputer", title)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/pod/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
|
||||
return list(
|
||||
"connected" = connected,
|
||||
"timing" = timing,
|
||||
"time" = time,
|
||||
"power_level" = connected?.power
|
||||
)
|
||||
|
||||
/obj/machinery/computer/pod/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
var/dat = "<TT><B>[title]</B>"
|
||||
user.set_machine(src)
|
||||
if(connected)
|
||||
var/d2
|
||||
if(timing) //door controls do not need timers.
|
||||
d2 = "<A href='byond://?src=\ref[src];time=0'>Stop Time Launch</A>"
|
||||
else
|
||||
d2 = "<A href='byond://?src=\ref[src];time=1'>Initiate Time Launch</A>"
|
||||
var/second = time % 60
|
||||
var/minute = (time - second) / 60
|
||||
dat += "<HR>\nTimer System: [d2]\nTime Left: [minute ? "[minute]:" : null][second] <A href='byond://?src=\ref[src];tp=-30'>-</A> <A href='byond://?src=\ref[src];tp=-1'>-</A> <A href='byond://?src=\ref[src];tp=1'>+</A> <A href='byond://?src=\ref[src];tp=30'>+</A>"
|
||||
var/temp = ""
|
||||
var/list/L = list( 0.25, 0.5, 1, 2, 4, 8, 16 )
|
||||
for(var/t in L)
|
||||
if(t == connected.power)
|
||||
temp += "[t] "
|
||||
else
|
||||
temp += "<A href = 'byond://?src=\ref[src];power=[t]'>[t]</A> "
|
||||
dat += "<HR>\nPower Level: [temp]<BR>\n<A href = 'byond://?src=\ref[src];alarm=1'>Firing Sequence</A><BR>\n<A href = 'byond://?src=\ref[src];drive=1'>Test Fire Driver</A><BR>\n<A href = 'byond://?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
else
|
||||
dat += "<BR>\n<A href = 'byond://?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
dat += "<BR><BR><A href='byond://?src=\ref[user];mach_close=computer'>Close</A></TT>"
|
||||
add_fingerprint(user)
|
||||
var/datum/browser/popup = new(user, "pod_computer", "Pod Computer", 400, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
switch(action)
|
||||
if("toggle_door")
|
||||
for(var/obj/machinery/door/blast/M in GLOB.machines)
|
||||
if(M.id == id)
|
||||
if(M.density)
|
||||
M.open()
|
||||
else
|
||||
M.close()
|
||||
return TRUE
|
||||
if("start_stop")
|
||||
timing = !timing
|
||||
return TRUE
|
||||
if("test_alarm")
|
||||
alarm()
|
||||
return TRUE
|
||||
if("test_drive")
|
||||
for(var/obj/machinery/mass_driver/M in GLOB.machines)
|
||||
if(M.id == id)
|
||||
M.power = connected.power
|
||||
M.drive()
|
||||
return TRUE
|
||||
if("adjust_power")
|
||||
if(!connected)
|
||||
return FALSE
|
||||
connected.power = CLAMP(text2num(params["value"]), 0.25, 16)
|
||||
return TRUE
|
||||
if("adjust_time")
|
||||
time = CLAMP(round(text2num(params["value"])), 0, 120)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/pod/process()
|
||||
if(!..())
|
||||
@@ -150,47 +178,9 @@
|
||||
else
|
||||
alarm()
|
||||
time = 0
|
||||
timing = 0
|
||||
updateDialog()
|
||||
timing = FALSE
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.set_machine(src)
|
||||
if(href_list["power"])
|
||||
var/t = text2num(href_list["power"])
|
||||
t = min(max(0.25, t), 16)
|
||||
if(connected)
|
||||
connected.power = t
|
||||
if(href_list["alarm"])
|
||||
alarm()
|
||||
if(href_list["drive"])
|
||||
for(var/obj/machinery/mass_driver/M in GLOB.machines)
|
||||
if(M.id == id)
|
||||
M.power = connected.power
|
||||
M.drive()
|
||||
|
||||
if(href_list["time"])
|
||||
timing = text2num(href_list["time"])
|
||||
if(href_list["tp"])
|
||||
var/tp = text2num(href_list["tp"])
|
||||
time += tp
|
||||
time = min(max(round(time), 0), 120)
|
||||
if(href_list["door"])
|
||||
for(var/obj/machinery/door/blast/M in GLOB.machines)
|
||||
if(M.id == id)
|
||||
if(M.density)
|
||||
M.open()
|
||||
else
|
||||
M.close()
|
||||
updateUsrDialog(usr)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/old
|
||||
icon_state = "oldcomp"
|
||||
icon_keyboard = null
|
||||
@@ -198,8 +188,6 @@
|
||||
name = "DoorMex Control Computer"
|
||||
title = "Door Controls"
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/old/syndicate
|
||||
name = "ProComp Executive IIc"
|
||||
desc = "Criminals often operate on a tight budget. Operates external airlocks."
|
||||
@@ -210,8 +198,7 @@
|
||||
if(!allowed(user))
|
||||
to_chat(user, span_warning("Access Denied"))
|
||||
return
|
||||
else
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/pod/old/swf
|
||||
name = "Magix System IV"
|
||||
|
||||
@@ -322,7 +322,6 @@
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment, writer.rank)
|
||||
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_REASSIGN_EMPLOYEE_IDCARD, writer)
|
||||
|
||||
computer.updateUsrDialog(usr)
|
||||
return
|
||||
|
||||
/datum/file/program/card_comp/centcom
|
||||
|
||||
@@ -147,7 +147,6 @@ FIRE ALARM
|
||||
time = 0
|
||||
timing = 0
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
updateDialog()
|
||||
last_process = world.timeofday
|
||||
|
||||
if(detecting && (locate(/obj/fire) in loc))
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
current_track = null
|
||||
playing = 0
|
||||
update_icon()
|
||||
updateDialog()
|
||||
start_stop_song()
|
||||
|
||||
// Tells the media manager to start or stop playing based on current settings.
|
||||
@@ -95,7 +94,6 @@
|
||||
if(hacked == newhacked)
|
||||
return
|
||||
hacked = newhacked
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
@@ -306,7 +304,6 @@
|
||||
update_use_power(USE_POWER_ACTIVE)
|
||||
update_icon()
|
||||
start_stop_song()
|
||||
updateDialog()
|
||||
|
||||
// Advance to the next track - Don't start playing it unless we were already playing
|
||||
/obj/machinery/media/jukebox/proc/NextTrack()
|
||||
@@ -317,7 +314,6 @@
|
||||
current_track = tracks[newTrackIndex]
|
||||
if(playing)
|
||||
start_stop_song()
|
||||
updateDialog()
|
||||
|
||||
// Advance to the next track - Don't start playing it unless we were already playing
|
||||
/obj/machinery/media/jukebox/proc/PrevTrack()
|
||||
@@ -328,7 +324,6 @@
|
||||
current_track = tracks[newTrackIndex]
|
||||
if(playing)
|
||||
start_stop_song()
|
||||
updateDialog()
|
||||
|
||||
//Pre-hacked Jukebox, has the full sond list unlocked
|
||||
/obj/machinery/media/jukebox/hacked
|
||||
|
||||
+100
-126
@@ -10,50 +10,24 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do
|
||||
desc = "A beacon used for bot navigation."
|
||||
plane = PLATING_PLANE
|
||||
anchored = TRUE
|
||||
var/open = 0 // true if cover is open
|
||||
var/locked = 1 // true if controls are locked
|
||||
var/freq = null // DEPRECATED we don't use radios anymore!
|
||||
var/open = FALSE // true if cover is open
|
||||
var/locked = TRUE // true if controls are locked
|
||||
var/location = "" // location response text
|
||||
var/codes_txt // DEPRECATED codes as set on map: "tag1;tag2" or "tag1=value;tag2=value"
|
||||
var/list/codes = list() // assoc. list of transponder codes
|
||||
req_access = list(ACCESS_ENGINE)
|
||||
|
||||
/obj/machinery/navbeacon/Initialize(mapload)
|
||||
. = ..()
|
||||
set_codes_from_txt(codes_txt)
|
||||
if(freq)
|
||||
WARNING("[src] at [x],[y],[z] has deprecated var freq=[freq]. Replace it with proper type.")
|
||||
|
||||
var/turf/T = loc
|
||||
hide(!T.is_plating())
|
||||
GLOB.navbeacons += src
|
||||
|
||||
// set the transponder codes assoc list from codes_txt
|
||||
// DEPRECATED - This is kept only for compatibilty with old map files! Do not use this!
|
||||
// Instead, you should replace the map instance with one of the appropriate navbeacon subtypes.
|
||||
// See the bottom of this file for a list of subtypes, make your own examples if your map needs more
|
||||
/obj/machinery/navbeacon/proc/set_codes_from_txt()
|
||||
if(!codes_txt)
|
||||
return
|
||||
WARNING("[src] at [x],[y],[z] in [get_area(src)] is using the deprecated 'codes_txt' mapping method. Replace it with proper type.")
|
||||
|
||||
codes = list()
|
||||
var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons
|
||||
for(var/e in entries)
|
||||
var/index = findtext(e, "=") // format is "key=value"
|
||||
if(index)
|
||||
var/key = copytext(e, 1, index)
|
||||
var/val = copytext(e, index+1)
|
||||
codes[key] = val
|
||||
else
|
||||
codes[e] = "1"
|
||||
|
||||
/obj/machinery/navbeacon/hides_under_flooring()
|
||||
return 1
|
||||
|
||||
// called when turf state changes
|
||||
// hide the object if turf is intact
|
||||
/obj/machinery/navbeacon/hide(var/intact)
|
||||
/obj/machinery/navbeacon/hide(intact)
|
||||
invisibility = intact ? INVISIBILITY_ABSTRACT : INVISIBILITY_NONE
|
||||
update_icon()
|
||||
|
||||
@@ -67,7 +41,7 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do
|
||||
else
|
||||
icon_state = "[state]"
|
||||
|
||||
/obj/machinery/navbeacon/attackby(var/obj/item/I, var/mob/user)
|
||||
/obj/machinery/navbeacon/attackby(obj/item/I, mob/user)
|
||||
var/turf/T = loc
|
||||
if(!T.is_plating())
|
||||
return // prevent intraction when T-scanner revealed
|
||||
@@ -75,126 +49,126 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do
|
||||
if(I.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
open = !open
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
|
||||
user.visible_message(span_notice("[user] [open ? "opens" : "closes"] the beacon's cover."), span_infoplain("You [open ? "open" : "close"] the beacon's cover."))
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
else if(I.GetID())
|
||||
if(open)
|
||||
if(allowed(user))
|
||||
locked = !locked
|
||||
to_chat(user, "Controls are now [locked ? "locked." : "unlocked."]")
|
||||
else
|
||||
to_chat(user, span_warning("Access denied."))
|
||||
updateDialog()
|
||||
else
|
||||
to_chat(user, "You must open the cover first!")
|
||||
return
|
||||
if(I.GetID())
|
||||
togglelock(user)
|
||||
|
||||
/obj/machinery/navbeacon/attack_ai(var/mob/user)
|
||||
interact(user, 1)
|
||||
/obj/machinery/navbeacon/attack_ai(mob/user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/navbeacon/attack_hand(var/mob/user)
|
||||
/obj/machinery/navbeacon/attack_hand(mob/user)
|
||||
|
||||
if(!user.IsAdvancedToolUser())
|
||||
return 0
|
||||
|
||||
interact(user, 0)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/navbeacon/interact(var/mob/user, var/ai = 0)
|
||||
/obj/machinery/navbeacon/proc/togglelock(mob/user)
|
||||
if(!open)
|
||||
to_chat(user, span_warning("You must open the cover first!"))
|
||||
return FALSE
|
||||
|
||||
if(allowed(user))
|
||||
locked = !locked
|
||||
to_chat(user, span_notice("Controls are now [locked ? "locked." : "unlocked."]"))
|
||||
return TRUE
|
||||
|
||||
to_chat(user, span_warning("Access denied."))
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/navbeacon/tgui_interact(mob/user, datum/tgui/ui)
|
||||
var/turf/T = loc
|
||||
if(!T.is_plating())
|
||||
return // prevent intraction when T-scanner revealed
|
||||
|
||||
if(!open && !ai) // can't alter controls if not open, unless you're an AI
|
||||
to_chat(user, "The beacon's control cover is closed.")
|
||||
if(!open && !isAI(user)) // can't alter controls if not open, unless you're an AI
|
||||
to_chat(user, span_warning("The beacon's control cover is closed."))
|
||||
return
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "NavBeacon", name)
|
||||
ui.open()
|
||||
|
||||
var/t
|
||||
/obj/machinery/navbeacon/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
|
||||
if(locked && !ai)
|
||||
t = {"<TT><B>Navigation Beacon</B><HR><BR>
|
||||
<i>(swipe card to unlock controls)</i><BR><HR>
|
||||
Location: [location ? location : "(none)"]</A><BR>
|
||||
Transponder Codes:<UL>"}
|
||||
return list(
|
||||
"siliconUser" = issilicon(user),
|
||||
"locked" = locked,
|
||||
"open" = open,
|
||||
"location" = location,
|
||||
"codes" = codes,
|
||||
)
|
||||
|
||||
for(var/key in codes)
|
||||
t += "<LI>[key] ... [codes[key]]"
|
||||
t+= "<UL></TT>"
|
||||
|
||||
else
|
||||
|
||||
t = {"<TT><B>Navigation Beacon</B><HR><BR>
|
||||
<i>(swipe card to lock controls)</i><BR><HR>
|
||||
Location: <A href='byond://?src=\ref[src];locedit=1'>[location ? location : "(none)"]</A><BR>
|
||||
Transponder Codes:<UL>"}
|
||||
|
||||
for(var/key in codes)
|
||||
t += "<LI>[key] ... [codes[key]]"
|
||||
t += " <small><A href='byond://?src=\ref[src];edit=1;code=[key]'>(edit)</A>"
|
||||
t += " <A href='byond://?src=\ref[src];delete=1;code=[key]'>(delete)</A></small><BR>"
|
||||
t += "<small><A href='byond://?src=\ref[src];add=1;'>(add new)</A></small><BR>"
|
||||
t+= "<UL></TT>"
|
||||
|
||||
var/datum/browser/popup = new(user, "navbeacon", "Navbeacon")
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/navbeacon/Topic(href, href_list)
|
||||
..()
|
||||
if(usr.stat)
|
||||
/obj/machinery/navbeacon/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
|
||||
if(open && !locked)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["locedit"])
|
||||
var/newloc = tgui_input_text(usr, "Enter New Location", "Navigation Beacon", location, MAX_NAME_LEN)
|
||||
if(newloc)
|
||||
location = newloc
|
||||
updateDialog()
|
||||
switch(action)
|
||||
if("lock")
|
||||
if(!open)
|
||||
return
|
||||
return togglelock(ui.user)
|
||||
|
||||
else if(href_list["edit"])
|
||||
var/codekey = href_list["code"]
|
||||
return access_action(action, params, ui.user)
|
||||
|
||||
var/newkey = tgui_input_text(usr, "Enter Transponder Code Key", "Navigation Beacon", codekey, MAX_NAME_LEN)
|
||||
if(!newkey)
|
||||
return
|
||||
/obj/machinery/navbeacon/proc/access_action(action, list/params, mob/user)
|
||||
if(!open || locked)
|
||||
return FALSE
|
||||
|
||||
var/codeval = codes[codekey]
|
||||
var/newval = tgui_input_text(usr, "Enter Transponder Code Value", "Navigation Beacon", codeval, MAX_NAME_LEN)
|
||||
if(!newval)
|
||||
newval = codekey
|
||||
return
|
||||
|
||||
codes.Remove(codekey)
|
||||
codes[newkey] = newval
|
||||
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["delete"])
|
||||
var/codekey = href_list["code"]
|
||||
codes.Remove(codekey)
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["add"])
|
||||
|
||||
var/newkey = tgui_input_text(usr, "Enter New Transponder Code Key", "Navigation Beacon", null, MAX_NAME_LEN)
|
||||
if(!newkey)
|
||||
return
|
||||
|
||||
var/newval = tgui_input_text(usr, "Enter New Transponder Code Value", "Navigation Beacon", null, MAX_NAME_LEN)
|
||||
if(!newval)
|
||||
newval = "1"
|
||||
return
|
||||
|
||||
if(!codes)
|
||||
codes = new()
|
||||
|
||||
codes[newkey] = newval
|
||||
|
||||
updateDialog()
|
||||
switch(action)
|
||||
if("loc_edit")
|
||||
var/new_loc = sanitize(params["new_loc"], MAX_NAME_LEN)
|
||||
if(!new_loc)
|
||||
return FALSE
|
||||
location = new_loc
|
||||
return TRUE
|
||||
if("trans_edit_key")
|
||||
var/codekey = params["code"]
|
||||
if(!codekey || !(codekey in codes))
|
||||
return FALSE
|
||||
var/new_key = sanitize(params["new_key"], MAX_NAME_LEN)
|
||||
if(!new_key)
|
||||
return FALSE
|
||||
var/list/new_codes = list()
|
||||
for(var/key, value in codes)
|
||||
if(key == codekey)
|
||||
new_codes[new_key] = value
|
||||
continue
|
||||
new_codes[key] = value
|
||||
codes = new_codes
|
||||
return TRUE
|
||||
if("trans_edit_code")
|
||||
var/codekey = params["code"]
|
||||
if(!codekey)
|
||||
return FALSE
|
||||
var/new_val = sanitize(params["new_val"], MAX_NAME_LEN)
|
||||
if(!new_val)
|
||||
return FALSE
|
||||
codes[codekey] = new_val
|
||||
return TRUE
|
||||
if("trans_add_code")
|
||||
var/new_key = sanitize(params["new_key"], MAX_NAME_LEN)
|
||||
if(!new_key)
|
||||
return FALSE
|
||||
if(codes[new_key])
|
||||
return FALSE
|
||||
var/new_val = sanitize(params["new_val"], MAX_NAME_LEN)
|
||||
if(!new_val)
|
||||
return FALSE
|
||||
codes[new_key] = new_val
|
||||
return TRUE
|
||||
if("trans_del")
|
||||
var/codekey = params["code"]
|
||||
if(!codekey)
|
||||
return FALSE
|
||||
codes.Remove(codekey)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/navbeacon/Destroy()
|
||||
GLOB.navbeacons.Remove(src)
|
||||
|
||||
@@ -5,135 +5,100 @@
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
var/metal_amount = 0
|
||||
var/operating = 0
|
||||
var/operating = FALSE
|
||||
var/obj/item/robot_parts/being_built = null
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 40
|
||||
active_power_usage = 10000
|
||||
var/inserting = FALSE
|
||||
|
||||
/obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/stack/material) && O.get_material_name() == MAT_STEEL)
|
||||
var/obj/item/stack/M = O
|
||||
if(metal_amount < 150000.0)
|
||||
var/count = 0
|
||||
/obj/machinery/robotic_fabricator/attackby(obj/item/O, mob/user)
|
||||
if(istype(O, /obj/item/stack/material) && O.get_material_name() == MAT_STEEL && !inserting)
|
||||
if(metal_amount < 150000)
|
||||
var/obj/item/stack/supplied_stack = O
|
||||
if(!supplied_stack.get_amount())
|
||||
return
|
||||
add_overlay("fab-load-metal")
|
||||
spawn(15)
|
||||
if(M)
|
||||
if(!M.get_amount())
|
||||
return
|
||||
while(metal_amount < 150000 && M.get_amount())
|
||||
metal_amount += O.matter[MAT_STEEL] /*O:height * O:width * O:length * 100000.0*/
|
||||
M.use(1)
|
||||
count++
|
||||
inserting = TRUE
|
||||
addtimer(CALLBACK(src, PROC_REF(complete_insertion), user, supplied_stack), 0.9 SECONDS, TIMER_DELETE_ME)
|
||||
return
|
||||
to_chat(user, "The robot part maker is full. Please remove metal from the robot part maker in order to insert more.")
|
||||
|
||||
to_chat(user, "You insert [count] metal sheet\s into the fabricator.")
|
||||
cut_overlay("fab-load-metal")
|
||||
updateDialog()
|
||||
else
|
||||
to_chat(user, "The robot part maker is full. Please remove metal from the robot part maker in order to insert more.")
|
||||
/obj/machinery/robotic_fabricator/proc/complete_insertion(mob/user, obj/item/stack/supplied_stack)
|
||||
var/count = 0
|
||||
while(metal_amount < 150000 && supplied_stack.get_amount())
|
||||
metal_amount += supplied_stack.matter[MAT_STEEL]
|
||||
supplied_stack.use(1)
|
||||
count++
|
||||
|
||||
/obj/machinery/robotic_fabricator/attack_hand(user as mob)
|
||||
var/dat
|
||||
to_chat(user, "You insert [count] metal sheet\s into the fabricator.")
|
||||
cut_overlay("fab-load-metal")
|
||||
inserting = FALSE
|
||||
|
||||
/obj/machinery/robotic_fabricator/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/robotic_fabricator/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, custom_state)
|
||||
. = ..()
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "AncientDroneFab", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/robotic_fabricator/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
return list(
|
||||
"operating" = operating,
|
||||
"metal_amount" = metal_amount
|
||||
)
|
||||
|
||||
/obj/machinery/robotic_fabricator/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
if(operating)
|
||||
dat = {"
|
||||
<TT>Building [being_built.name].<BR>
|
||||
Please wait until completion...</TT><BR>
|
||||
<BR>
|
||||
"}
|
||||
else
|
||||
dat = {"
|
||||
<B>Metal Amount:</B> [min(150000, metal_amount)] cm<sup>3</sup> (MAX: 150,000)<BR><HR>
|
||||
<BR>
|
||||
<A href='byond://?src=\ref[src];make=1'>Left Arm (25,000 cc metal.)<BR>
|
||||
<A href='byond://?src=\ref[src];make=2'>Right Arm (25,000 cc metal.)<BR>
|
||||
<A href='byond://?src=\ref[src];make=3'>Left Leg (25,000 cc metal.)<BR>
|
||||
<A href='byond://?src=\ref[src];make=4'>Right Leg (25,000 cc metal).<BR>
|
||||
<A href='byond://?src=\ref[src];make=5'>Chest (50,000 cc metal).<BR>
|
||||
<A href='byond://?src=\ref[src];make=6'>Head (50,000 cc metal).<BR>
|
||||
<A href='byond://?src=\ref[src];make=7'>Robot Frame (75,000 cc metal).<BR>
|
||||
"}
|
||||
return FALSE
|
||||
|
||||
var/datum/browser/popup = new(user, "robot_fabricator", "Robot Fabricator")
|
||||
popup.add_head_content("<TITLE>Robotic Fabricator Control Panel</TITLE>")
|
||||
popup.set_content("<TT>[dat]</TT>")
|
||||
popup.open()
|
||||
add_fingerprint(ui.user)
|
||||
switch(action)
|
||||
if("build_l_arm")
|
||||
return try_start_building("/obj/item/robot_parts/l_arm", 20 SECONDS, 25000)
|
||||
if("build_r_arm")
|
||||
return try_start_building("/obj/item/robot_parts/r_arm", 20 SECONDS, 25000)
|
||||
if("build_l_leg")
|
||||
return try_start_building("/obj/item/robot_parts/l_leg", 20 SECONDS, 25000)
|
||||
if("build_r_leg")
|
||||
return try_start_building("/obj/item/robot_parts/r_leg", 20 SECONDS, 25000)
|
||||
if("build_chest")
|
||||
return try_start_building("/obj/item/robot_parts/chest", 35 SECONDS, 50000)
|
||||
if("build_head")
|
||||
return try_start_building("/obj/item/robot_parts/head", 35 SECONDS, 50000)
|
||||
if("build_frame")
|
||||
return try_start_building("/obj/item/robot_parts/robot_suit", 60 SECONDS, 75000)
|
||||
|
||||
/obj/machinery/robotic_fabricator/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
/obj/machinery/robotic_fabricator/proc/try_start_building(build_type, build_time, build_cost)
|
||||
var/building = text2path(build_type)
|
||||
if(isnull(building))
|
||||
return FALSE
|
||||
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
if(metal_amount < build_cost)
|
||||
return FALSE
|
||||
|
||||
if(href_list["make"])
|
||||
if(!operating)
|
||||
var/part_type = text2num(href_list["make"])
|
||||
operating = TRUE
|
||||
update_use_power(USE_POWER_ACTIVE)
|
||||
metal_amount = max(0, metal_amount - build_cost)
|
||||
add_overlay("fab-active")
|
||||
|
||||
var/build_type = ""
|
||||
var/build_time = 200
|
||||
var/build_cost = 25000
|
||||
addtimer(CALLBACK(src, PROC_REF(complete_building), building), build_time, TIMER_DELETE_ME)
|
||||
return TRUE
|
||||
|
||||
switch (part_type)
|
||||
if(1)
|
||||
build_type = "/obj/item/robot_parts/l_arm"
|
||||
build_time = 200
|
||||
build_cost = 25000
|
||||
|
||||
if(2)
|
||||
build_type = "/obj/item/robot_parts/r_arm"
|
||||
build_time = 200
|
||||
build_cost = 25000
|
||||
|
||||
if(3)
|
||||
build_type = "/obj/item/robot_parts/l_leg"
|
||||
build_time = 200
|
||||
build_cost = 25000
|
||||
|
||||
if(4)
|
||||
build_type = "/obj/item/robot_parts/r_leg"
|
||||
build_time = 200
|
||||
build_cost = 25000
|
||||
|
||||
if(5)
|
||||
build_type = "/obj/item/robot_parts/chest"
|
||||
build_time = 350
|
||||
build_cost = 50000
|
||||
|
||||
if(6)
|
||||
build_type = "/obj/item/robot_parts/head"
|
||||
build_time = 350
|
||||
build_cost = 50000
|
||||
|
||||
if(7)
|
||||
build_type = "/obj/item/robot_parts/robot_suit"
|
||||
build_time = 600
|
||||
build_cost = 75000
|
||||
|
||||
var/building = text2path(build_type)
|
||||
if(!isnull(building))
|
||||
if(metal_amount >= build_cost)
|
||||
operating = 1
|
||||
update_use_power(USE_POWER_ACTIVE)
|
||||
|
||||
metal_amount = max(0, metal_amount - build_cost)
|
||||
|
||||
being_built = new building(src)
|
||||
|
||||
add_overlay("fab-active")
|
||||
updateUsrDialog(usr)
|
||||
|
||||
spawn (build_time)
|
||||
if(!isnull(being_built))
|
||||
being_built.loc = get_turf(src)
|
||||
being_built = null
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
operating = 0
|
||||
cut_overlay("fab-active")
|
||||
return
|
||||
|
||||
for (var/mob/M in viewers(1, src))
|
||||
if(M.client && M.check_current_machine(src))
|
||||
attack_hand(M)
|
||||
/obj/machinery/robotic_fabricator/proc/complete_building(building)
|
||||
being_built = new building(src)
|
||||
being_built.forceMove(get_turf(src))
|
||||
being_built = null
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
operating = FALSE
|
||||
cut_overlay("fab-active")
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
overload = 1
|
||||
step_energy_drain = step_energy_drain*overload_coeff
|
||||
src.occupant_message(span_red("You enable leg actuators overload."))
|
||||
src.log_message("Toggled leg actuators overload.")
|
||||
src.log_message("Toggled leg actuators overload.", LOG_GAME)
|
||||
playsound(src, 'sound/mecha/mechanical_toggle.ogg', 50, 1)
|
||||
return
|
||||
|
||||
|
||||
@@ -614,7 +614,6 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
|
||||
user.show_message(span_notice("\The [src] can now be attached and modified!"))
|
||||
else
|
||||
user.show_message(span_notice("\The [src] can no longer be modified or attached!"))
|
||||
updateDialog()
|
||||
//Foreach goto(83)
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
@@ -143,8 +143,8 @@ GLOBAL_LIST_INIT(RMS_random_malfunction, list(/obj/item/fbp_backup_cell,
|
||||
else
|
||||
product = choose_normal(user)
|
||||
|
||||
spark_system.start()
|
||||
product.loc = get_turf(A)
|
||||
spark_system.start()
|
||||
product.loc = get_turf(A)
|
||||
|
||||
/obj/item/rms/proc/choose_overcharge(mob/living/user)
|
||||
var/final_product
|
||||
|
||||
@@ -124,11 +124,14 @@
|
||||
if(!selection)
|
||||
return
|
||||
var/mob/M = selection:mob
|
||||
var/turf/target_turf = get_turf(M)
|
||||
if(!target_turf)
|
||||
return
|
||||
log_admin("[key_name(usr)] jumped to [key_name(M)]")
|
||||
message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
|
||||
usr.on_mob_jump()
|
||||
usr.reset_perspective(usr)
|
||||
usr.forceMove(get_turf(M))
|
||||
usr.forceMove(target_turf)
|
||||
feedback_add_details("admin_verb","JK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
else
|
||||
tgui_alert_async(usr, "Admin jumping disabled")
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
else
|
||||
. += "It's completely empty."
|
||||
|
||||
|
||||
/obj/machinery/cash_register/attack_hand(mob/user)
|
||||
// Don't be accessible from the wrong side of the machine
|
||||
if(get_dir(src, user) & GLOB.reverse_dir[src.dir]) return
|
||||
@@ -55,131 +54,149 @@
|
||||
spawn_money(cash_stored, loc, user)
|
||||
cash_stored = 0
|
||||
cut_overlay("register_cash")
|
||||
else
|
||||
open_cash_box()
|
||||
else
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
return
|
||||
open_cash_box(user)
|
||||
return
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/cash_register/click_alt(mob/user)
|
||||
if(Adjacent(user))
|
||||
open_cash_box()
|
||||
open_cash_box(user)
|
||||
|
||||
/obj/machinery/cash_register/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, custom_state)
|
||||
. = ..()
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "RetailScanner", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/cash_register/interact(mob/user)
|
||||
var/dat = "<html><h2>Cash Register<hr></h2>"
|
||||
if (locked)
|
||||
dat += "<a href='byond://?src=\ref[src];choice=toggle_lock'>Unlock</a><br>"
|
||||
dat += "Linked account: " + span_bold("[linked_account ? linked_account.owner_name : "None"]") + "<br>"
|
||||
dat += span_bold("[cash_locked? "Unlock" : "Lock"] Cash Box") + " | "
|
||||
else
|
||||
dat += "<a href='byond://?src=\ref[src];choice=toggle_lock'>Lock</a><br>"
|
||||
dat += "Linked account: <a href='byond://?src=\ref[src];choice=link_account'>[linked_account ? linked_account.owner_name : "None"]</a><br>"
|
||||
dat += "<a href='byond://?src=\ref[src];choice=toggle_cash_lock'>[cash_locked? "Unlock" : "Lock"] Cash Box</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];choice=custom_order'>Custom Order</a><hr>"
|
||||
/obj/machinery/cash_register/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
return list(
|
||||
"locked" = locked,
|
||||
"cash_locked" = cash_locked,
|
||||
"linked_account" = linked_account?.owner_name,
|
||||
"machine_id" = machine_id,
|
||||
"transaction_logs" = transaction_logs,
|
||||
"current_transactioon" = get_current_transaction()
|
||||
)
|
||||
|
||||
if(item_list.len)
|
||||
dat += get_current_transaction()
|
||||
dat += "<br>"
|
||||
|
||||
for(var/i=transaction_logs.len, i>=1, i--)
|
||||
dat += "[transaction_logs[i]]<br>"
|
||||
|
||||
if(transaction_logs.len)
|
||||
dat += locked ? "<br>" : "<a href='byond://?src=\ref[src];choice=reset_log'>Reset Log</a><br>"
|
||||
dat += "<br>"
|
||||
dat += "<i>Device ID:</i> [machine_id]</html>"
|
||||
user << browse(dat, "window=cash_register;size=350x500")
|
||||
onclose(user, "cash_register")
|
||||
|
||||
|
||||
/obj/machinery/cash_register/Topic(var/href, var/href_list)
|
||||
if(..())
|
||||
/obj/machinery/cash_register/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(href_list["choice"])
|
||||
switch(href_list["choice"])
|
||||
if("toggle_lock")
|
||||
if(allowed(usr))
|
||||
locked = !locked
|
||||
else
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Insufficient access."))
|
||||
if("toggle_cash_lock")
|
||||
cash_locked = !cash_locked
|
||||
if("link_account")
|
||||
var/attempt_account_num = tgui_input_number(usr, "Enter account number", "New account number")
|
||||
var/attempt_pin = tgui_input_number(usr, "Enter PIN", "Account PIN")
|
||||
linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
if(linked_account)
|
||||
if(linked_account.suspended)
|
||||
linked_account = null
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Account has been suspended."))
|
||||
else
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Account not found."))
|
||||
if("custom_order")
|
||||
var/t_purpose = tgui_input_text(usr, "Enter purpose", "New purpose", "", MAX_MESSAGE_LEN)
|
||||
if (!t_purpose || !Adjacent(usr)) return
|
||||
transaction_purpose = t_purpose
|
||||
item_list += t_purpose
|
||||
var/t_amount = round(tgui_input_number(usr, "Enter price", "New price"))
|
||||
if (!t_amount || !Adjacent(usr) || t_amount < 0) return
|
||||
transaction_amount += t_amount
|
||||
price_list += t_amount
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 25)
|
||||
src.visible_message("[icon2html(src,viewers(src))][transaction_purpose]: [t_amount] Thaler\s.")
|
||||
if("set_amount")
|
||||
var/item_name = locate(href_list["item"])
|
||||
var/n_amount = round(tgui_input_number(usr, "Enter amount", "New amount", 0, 20, 0))
|
||||
n_amount = CLAMP(n_amount, 0, 20)
|
||||
if (!item_list[item_name] || !Adjacent(usr)) return
|
||||
transaction_amount += (n_amount - item_list[item_name]) * price_list[item_name]
|
||||
if(!n_amount)
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
else
|
||||
item_list[item_name] = n_amount
|
||||
if("subtract")
|
||||
var/item_name = locate(href_list["item"])
|
||||
if(item_name)
|
||||
transaction_amount -= price_list[item_name]
|
||||
item_list[item_name]--
|
||||
if(item_list[item_name] <= 0)
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
if("add")
|
||||
var/item_name = locate(href_list["item"])
|
||||
if(item_list[item_name] >= 20) return
|
||||
transaction_amount += price_list[item_name]
|
||||
item_list[item_name]++
|
||||
if("clear")
|
||||
var/item_name = locate(href_list["item"])
|
||||
if(item_name)
|
||||
transaction_amount -= price_list[item_name] * item_list[item_name]
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
else
|
||||
transaction_amount = 0
|
||||
item_list.Cut()
|
||||
price_list.Cut()
|
||||
if("reset_log")
|
||||
transaction_logs.Cut()
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_notice("Transaction log reset."))
|
||||
updateDialog()
|
||||
switch(action)
|
||||
if("toggle_lock")
|
||||
if(allowed(ui.user))
|
||||
locked = !locked
|
||||
return TRUE
|
||||
to_chat(ui.user, "[icon2html(src, ui.user.client)]" + span_warning("Insufficient access."))
|
||||
return FALSE
|
||||
return access_action(action, params, ui.user)
|
||||
|
||||
/obj/machinery/cash_register/proc/access_action(action, list/params, mob/user)
|
||||
if(locked)
|
||||
return FALSE
|
||||
|
||||
switch(action)
|
||||
if("toggle_cash_lock")
|
||||
cash_locked = !cash_locked
|
||||
if("link_account")
|
||||
var/attempt_account_num = text2num(params["name"])
|
||||
if(isnull(attempt_account_num))
|
||||
return FALSE
|
||||
var/attempt_pin = text2num(params["pin"])
|
||||
if(isnull(attempt_pin))
|
||||
return FALSE
|
||||
linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
if(linked_account)
|
||||
if(linked_account.suspended)
|
||||
linked_account = null
|
||||
visible_message("[icon2html(src, viewers(src))]" + span_warning("Account has been suspended."))
|
||||
return FALSE
|
||||
return TRUE
|
||||
to_chat(user, "[icon2html(src, user.client)]" + span_warning("Account not found."))
|
||||
return FALSE
|
||||
if("custom_order")
|
||||
var/t_purpose = sanitize(params["purpose"], 200)
|
||||
if (!t_purpose)
|
||||
return FALSE
|
||||
transaction_purpose = t_purpose
|
||||
var/amount = params["amount"]
|
||||
if(!isnum(amount))
|
||||
return FALSE
|
||||
amount = CLAMP(amount, 1, 20)
|
||||
item_list[t_purpose] = amount
|
||||
var/price = params["price"]
|
||||
if (!price)
|
||||
return FALSE
|
||||
transaction_amount += amount * price
|
||||
price_list[t_purpose] = price
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 25)
|
||||
visible_message("[icon2html(src, viewers(src))][transaction_purpose][amount > 1 ? "[amount] x" : ""]: [amount * price] Thaler\s.")
|
||||
return TRUE
|
||||
if("set_amount")
|
||||
var/item_name = params["item"]
|
||||
if(!item_name)
|
||||
return FALSE
|
||||
var/n_amount = text2num(params["amount"])
|
||||
if(!isnum(n_amount))
|
||||
return FALSE
|
||||
n_amount = CLAMP(n_amount, 0, 20)
|
||||
if(!item_list[item_name])
|
||||
return FALSE
|
||||
transaction_amount += (n_amount - item_list[item_name]) * price_list[item_name]
|
||||
if(!n_amount)
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
return TRUE
|
||||
item_list[item_name] = n_amount
|
||||
return TRUE
|
||||
if("subtract")
|
||||
var/item_name = params["item"]
|
||||
if(!item_name)
|
||||
return FALSE
|
||||
transaction_amount -= price_list[item_name]
|
||||
item_list[item_name]--
|
||||
if(item_list[item_name] <= 0)
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
return TRUE
|
||||
if("add")
|
||||
var/item_name = params["item"]
|
||||
if(!item_name)
|
||||
return FALSE
|
||||
if(item_list[item_name] >= 20)
|
||||
return FALSE
|
||||
transaction_amount += price_list[item_name]
|
||||
item_list[item_name]++
|
||||
return TRUE
|
||||
if("clear")
|
||||
var/item_name = params["item"]
|
||||
if(!item_name)
|
||||
return FALSE
|
||||
transaction_amount -= price_list[item_name] * item_list[item_name]
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
return TRUE
|
||||
if("clear_entry")
|
||||
transaction_amount = 0
|
||||
item_list.Cut()
|
||||
price_list.Cut()
|
||||
return TRUE
|
||||
if("reset_log")
|
||||
transaction_logs.Cut()
|
||||
to_chat(user, "[icon2html(src, user.client)]" + span_notice("Transaction log reset."))
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/cash_register/attackby(obj/item/O, mob/user)
|
||||
// Check for a method of paying (ID, PDA, e-wallet, cash, ect.)
|
||||
var/obj/item/card/id/I = O.GetID()
|
||||
if(I)
|
||||
scan_card(I, O)
|
||||
scan_card(I, O, user)
|
||||
else if (istype(O, /obj/item/spacecash/ewallet))
|
||||
var/obj/item/spacecash/ewallet/E = O
|
||||
scan_wallet(E)
|
||||
scan_wallet(E, user)
|
||||
else if (istype(O, /obj/item/spacecash))
|
||||
var/obj/item/spacecash/SC = O
|
||||
if(cash_open)
|
||||
@@ -191,7 +208,7 @@
|
||||
H.drop_from_inventory(SC)
|
||||
qdel(SC)
|
||||
else
|
||||
scan_cash(SC)
|
||||
scan_cash(SC, user)
|
||||
else if(istype(O, /obj/item/card/emag))
|
||||
return ..()
|
||||
else if(istype(O) && O.has_tool_quality(TOOL_WRENCH))
|
||||
@@ -199,7 +216,7 @@
|
||||
toggle_anchors(W, user)
|
||||
// Not paying: Look up price and add it to transaction_amount
|
||||
else
|
||||
scan_item_price(O)
|
||||
scan_item_price(O, user)
|
||||
|
||||
|
||||
/obj/machinery/cash_register/MouseDrop_T(atom/dropping, mob/user)
|
||||
@@ -219,39 +236,39 @@
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/scan_card(obj/item/card/id/I, obj/item/ID_container)
|
||||
/obj/machinery/cash_register/proc/scan_card(obj/item/card/id/I, obj/item/ID_container, mob/user)
|
||||
if (!transaction_amount)
|
||||
return
|
||||
|
||||
if (cash_open)
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("The cash box is open."))
|
||||
to_chat(user, "[icon2html(src, user.client)]" + span_warning("The cash box is open."))
|
||||
return
|
||||
|
||||
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(I))
|
||||
return
|
||||
|
||||
if (!linked_account)
|
||||
usr.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to connect to linked account."))
|
||||
user.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to connect to linked account."))
|
||||
return
|
||||
|
||||
// Access account for transaction
|
||||
if(check_account())
|
||||
if(check_account(user))
|
||||
var/datum/money_account/D = get_account(I.associated_account_number)
|
||||
var/attempt_pin = ""
|
||||
if(D && D.security_level)
|
||||
attempt_pin = tgui_input_number(usr, "Enter PIN", "Transaction")
|
||||
attempt_pin = tgui_input_number(user, "Enter PIN", "Transaction")
|
||||
D = null
|
||||
D = attempt_account_access(I.associated_account_number, attempt_pin, 2)
|
||||
|
||||
if(!D)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to access account. Check security settings and try again."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Unable to access account. Check security settings and try again."))
|
||||
else
|
||||
if(D.suspended)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Your account has been suspended."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Your account has been suspended."))
|
||||
else
|
||||
if(transaction_amount > D.money)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Not enough funds."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Not enough funds."))
|
||||
else
|
||||
// Transfer the money
|
||||
D.money -= transaction_amount
|
||||
@@ -283,21 +300,20 @@
|
||||
// Confirm and reset
|
||||
transaction_complete()
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/scan_wallet(obj/item/spacecash/ewallet/E)
|
||||
/obj/machinery/cash_register/proc/scan_wallet(obj/item/spacecash/ewallet/E, mob/user)
|
||||
if (!transaction_amount)
|
||||
return
|
||||
|
||||
if (cash_open)
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("The cash box is open."))
|
||||
to_chat(user, "[icon2html(src, user.client)]" + span_warning("The cash box is open."))
|
||||
return
|
||||
|
||||
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(E))
|
||||
return
|
||||
|
||||
// Access account for transaction
|
||||
if(check_account())
|
||||
if(check_account(user))
|
||||
if(transaction_amount > E.worth)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Not enough funds."))
|
||||
else
|
||||
@@ -321,21 +337,20 @@
|
||||
// Confirm and reset
|
||||
transaction_complete()
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/scan_cash(obj/item/spacecash/SC)
|
||||
/obj/machinery/cash_register/proc/scan_cash(obj/item/spacecash/SC, mob/user)
|
||||
if (!transaction_amount)
|
||||
return
|
||||
|
||||
if (cash_open)
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("The cash box is open."))
|
||||
to_chat(user, "[icon2html(src, user.client)]" + span_warning("The cash box is open."))
|
||||
return
|
||||
|
||||
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(SC))
|
||||
return
|
||||
|
||||
if(transaction_amount > SC.worth)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Not enough money."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Not enough money."))
|
||||
else
|
||||
// Insert cash into magical slot
|
||||
SC.worth -= transaction_amount
|
||||
@@ -353,24 +368,23 @@
|
||||
// Confirm and reset
|
||||
transaction_complete()
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/scan_item_price(obj/O)
|
||||
/obj/machinery/cash_register/proc/scan_item_price(obj/O, mob/user)
|
||||
if(!istype(O)) return
|
||||
if(item_list.len > 10)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Only up to ten different items allowed per purchase."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Only up to ten different items allowed per purchase."))
|
||||
return
|
||||
if (cash_open)
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("The cash box is open."))
|
||||
to_chat(user, "[icon2html(src, user.client)]" + span_warning("The cash box is open."))
|
||||
return
|
||||
|
||||
// First check if item has a valid price
|
||||
var/price = O.get_item_cost()
|
||||
if(isnull(price))
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to find item in database."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Unable to find item in database."))
|
||||
return
|
||||
// Call out item cost
|
||||
src.visible_message("[icon2html(src,viewers(src))]\A [O]: [price ? "[price] Thaler\s" : "free of charge"].")
|
||||
src.visible_message("[icon2html(src, viewers(src))]\A [O]: [price ? "[price] Thaler\s" : "free of charge"].")
|
||||
// Note the transaction purpose for later use
|
||||
if(transaction_purpose)
|
||||
transaction_purpose += "<br>"
|
||||
@@ -387,74 +401,48 @@
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 25)
|
||||
// Reset confirmation
|
||||
confirm_item = null
|
||||
updateDialog()
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/get_current_transaction()
|
||||
var/dat = {"
|
||||
<head><style>
|
||||
.tx-title-r {text-align: center; background-color:#ffdddd; font-weight: bold}
|
||||
.tx-name-r {background-color: #eebbbb}
|
||||
.tx-data-r {text-align: right; background-color: #ffcccc;}
|
||||
</head></style>
|
||||
<table width=300>
|
||||
<tr><td colspan="2" class="tx-title-r">New Entry</td></tr>
|
||||
<tr></tr>"}
|
||||
var/item_name
|
||||
for(var/i=1, i<=item_list.len, i++)
|
||||
item_name = item_list[i]
|
||||
dat += "<tr><td class=\"tx-name-r\">[item_list[item_name] ? "<a href='byond://?src=\ref[src];choice=subtract;item=\ref[item_name]'>-</a> <a href='byond://?src=\ref[src];choice=set_amount;item=\ref[item_name]'>Set</a> <a href='byond://?src=\ref[src];choice=add;item=\ref[item_name]'>+</a> [item_list[item_name]] x " : ""][item_name] <a href='byond://?src=\ref[src];choice=clear;item=\ref[item_name]'>Remove</a></td><td class=\"tx-data-r\" width=50>[price_list[item_name] * item_list[item_name]] þ</td></tr>"
|
||||
dat += "</table><table width=300>"
|
||||
dat += "<tr><td class=\"tx-name-r\"><a href='byond://?src=\ref[src];choice=clear'>Clear Entry</a></td><td class=\"tx-name-r\" style='text-align: right'>" + span_bold("Total Amount: [transaction_amount] þ") + "</td></tr>"
|
||||
dat += "</table></html>"
|
||||
return dat
|
||||
if(!length(item_list))
|
||||
return list()
|
||||
|
||||
var/list/current_transactioon = list(
|
||||
"items" = item_list,
|
||||
"prices" = price_list,
|
||||
"amount" = transaction_amount,
|
||||
|
||||
)
|
||||
return current_transactioon
|
||||
|
||||
/obj/machinery/cash_register/proc/add_transaction_log(c_name, p_method, t_amount)
|
||||
var/list/new_entry = list(
|
||||
"log_id" = length(transaction_logs) + 1,
|
||||
"customer" = c_name,
|
||||
"payment_method" = p_method,
|
||||
"trans_time" = stationtime2text(),
|
||||
"items" = item_list,
|
||||
"prices" = price_list,
|
||||
"amount" = transaction_amount
|
||||
)
|
||||
UNTYPED_LIST_ADD(transaction_logs, new_entry)
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/add_transaction_log(var/c_name, var/p_method, var/t_amount)
|
||||
var/dat = {"
|
||||
<head><style>
|
||||
.tx-title {text-align: center; background-color:#ddddff; font-weight: bold}
|
||||
.tx-name {background-color: #bbbbee}
|
||||
.tx-data {text-align: right; background-color: #ccccff;}
|
||||
</head></style>
|
||||
<table width=300>
|
||||
<tr><td colspan="2" class="tx-title">Transaction #[transaction_logs.len+1]</td></tr>
|
||||
<tr></tr>
|
||||
<tr><td class="tx-name">Customer</td><td class="tx-data">[c_name]</td></tr>
|
||||
<tr><td class="tx-name">Pay Method</td><td class="tx-data">[p_method]</td></tr>
|
||||
<tr><td class="tx-name">Station Time</td><td class="tx-data">[stationtime2text()]</td></tr>
|
||||
</table>
|
||||
<table width=300>
|
||||
"}
|
||||
var/item_name
|
||||
for(var/i=1, i<=item_list.len, i++)
|
||||
item_name = item_list[i]
|
||||
dat += "<tr><td class=\"tx-name\">[item_list[item_name] ? "[item_list[item_name]] x " : ""][item_name]</td><td class=\"tx-data\" width=50>[price_list[item_name] * item_list[item_name]] þ</td></tr>"
|
||||
dat += "<tr></tr><tr><td colspan=\"2\" class=\"tx-name\" style='text-align: right'>" + span_bold("Total Amount: [transaction_amount] þ") + "</td></tr>"
|
||||
dat += "</table></html>"
|
||||
|
||||
transaction_logs += dat
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/check_account()
|
||||
/obj/machinery/cash_register/proc/check_account(mob/user)
|
||||
if (!linked_account)
|
||||
usr.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to connect to linked account."))
|
||||
return 0
|
||||
user.visible_message("[icon2html(src, viewers(src))]" + span_warning("Unable to connect to linked account."))
|
||||
return FALSE
|
||||
|
||||
if(linked_account.suspended)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Connected account has been suspended."))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Connected account has been suspended."))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/cash_register/proc/transaction_complete()
|
||||
/// Visible confirmation
|
||||
playsound(src, 'sound/machines/chime.ogg', 25)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_notice("Transaction complete."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_notice("Transaction complete."))
|
||||
flick("register_approve", src)
|
||||
reset_memory()
|
||||
updateDialog()
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/reset_memory()
|
||||
transaction_amount = null
|
||||
@@ -463,14 +451,13 @@
|
||||
price_list.Cut()
|
||||
confirm_item = null
|
||||
|
||||
|
||||
/obj/machinery/cash_register/verb/open_cash_box()
|
||||
/obj/machinery/cash_register/verb/open_cash_box(mob/user)
|
||||
set category = "Object"
|
||||
set name = "Open Cash Box"
|
||||
set desc = "Open/closes the register's cash box."
|
||||
set src in view(1)
|
||||
|
||||
if(usr.stat) return
|
||||
if(user.stat) return
|
||||
|
||||
if(cash_open)
|
||||
cash_open = 0
|
||||
@@ -484,7 +471,7 @@
|
||||
if(cash_stored)
|
||||
add_overlay("register_cash")
|
||||
else
|
||||
to_chat(usr, span_warning("The cash box is locked."))
|
||||
to_chat(user, span_warning("The cash box is locked."))
|
||||
|
||||
|
||||
/obj/machinery/cash_register/proc/toggle_anchors(obj/item/tool/wrench/W, mob/user)
|
||||
@@ -510,9 +497,7 @@
|
||||
manipulating = 0
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/cash_register/emag_act(var/remaining_charges, var/mob/user)
|
||||
/obj/machinery/cash_register/emag_act(remaining_charges, mob/user)
|
||||
if(!emagged)
|
||||
src.visible_message(span_danger("The [src]'s cash box springs open as [user] swipes the card through the scanner!"))
|
||||
playsound(src, "sparks", 50, 1)
|
||||
@@ -520,7 +505,7 @@
|
||||
emagged = 1
|
||||
locked = 0
|
||||
cash_locked = 0
|
||||
open_cash_box()
|
||||
open_cash_box(user)
|
||||
|
||||
|
||||
//--Premades--//
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
var/emagged = 0
|
||||
var/machine_id = ""
|
||||
var/transaction_amount = 0 // cumulatd amount of money to pay in a single purchase
|
||||
var/transaction_purpose = null // text that gets used in ATM transaction logs
|
||||
var/transaction_purpose = "" // text that gets used in ATM transaction logs
|
||||
var/list/transaction_logs = list() // list of strings using html code to visualise data
|
||||
var/list/item_list = list() // entities and according
|
||||
var/list/price_list = list() // prices for each purchase
|
||||
@@ -22,7 +22,6 @@
|
||||
var/datum/money_account/linked_account
|
||||
var/account_to_connect = null
|
||||
|
||||
|
||||
// Claim machine ID
|
||||
/obj/item/retail_scanner/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -31,7 +30,6 @@
|
||||
pixel_y = 3
|
||||
GLOB.transaction_devices += src // Global reference list to be properly set up by /proc/setup_economy()
|
||||
|
||||
|
||||
/obj/item/retail_scanner/Destroy()
|
||||
GLOB.transaction_devices -= src
|
||||
. = ..()
|
||||
@@ -50,133 +48,149 @@
|
||||
src.dir = SOUTH
|
||||
src.pixel_y = 0
|
||||
|
||||
|
||||
/obj/item/retail_scanner/attack_self(mob/user)
|
||||
. = ..(user)
|
||||
if(.)
|
||||
return TRUE
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
|
||||
/obj/item/retail_scanner/click_alt(var/mob/user)
|
||||
/obj/item/retail_scanner/click_alt(mob/user)
|
||||
if(Adjacent(user))
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/item/retail_scanner/examine(mob/user as mob)
|
||||
/obj/item/retail_scanner/examine(mob/user)
|
||||
. = ..()
|
||||
if(transaction_amount)
|
||||
. += "It has a purchase of [transaction_amount] pending[transaction_purpose ? " for [transaction_purpose]" : ""]."
|
||||
|
||||
/obj/item/retail_scanner/interact(mob/user as mob)
|
||||
var/dat = "<h2>Retail Scanner<hr></h2>"
|
||||
if (locked)
|
||||
dat += "<a href='byond://?src=\ref[src];choice=toggle_lock'>Unlock</a><br>"
|
||||
dat += "Linked account: <b>[linked_account ? linked_account.owner_name : "None"]</b><br>"
|
||||
else
|
||||
dat += "<a href='byond://?src=\ref[src];choice=toggle_lock'>Lock</a><br>"
|
||||
dat += "Linked account: <a href='byond://?src=\ref[src];choice=link_account'>[linked_account ? linked_account.owner_name : "None"]</a><br>"
|
||||
dat += "<a href='byond://?src=\ref[src];choice=custom_order'>Custom Order</a><hr>"
|
||||
/obj/item/retail_scanner/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, custom_state)
|
||||
. = ..()
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "RetailScanner", name)
|
||||
ui.open()
|
||||
|
||||
if(item_list.len)
|
||||
dat += get_current_transaction()
|
||||
dat += "<br>"
|
||||
/obj/item/retail_scanner/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
return list(
|
||||
"locked" = locked,
|
||||
"linked_account" = linked_account?.owner_name,
|
||||
"machine_id" = machine_id,
|
||||
"transaction_logs" = transaction_logs,
|
||||
"current_transactioon" = get_current_transaction()
|
||||
)
|
||||
|
||||
for(var/i=transaction_logs.len, i>=1, i--)
|
||||
dat += "[transaction_logs[i]]<br>"
|
||||
|
||||
if(transaction_logs.len)
|
||||
dat += locked ? "<br>" : "<a href='byond://?src=\ref[src];choice=reset_log'>Reset Log</a><br>"
|
||||
dat += "<br>"
|
||||
dat += "<i>Device ID:</i> [machine_id]"
|
||||
|
||||
var/datum/browser/popup = new(user, "retail", "Retail", 350, 500)
|
||||
popup.add_head_content("<title>Retail Scanner</title>")
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/obj/item/retail_scanner/Topic(var/href, var/href_list)
|
||||
if(..())
|
||||
/obj/item/retail_scanner/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(href_list["choice"])
|
||||
switch(href_list["choice"])
|
||||
if("toggle_lock")
|
||||
if(allowed(usr))
|
||||
locked = !locked
|
||||
else
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Insufficient access."))
|
||||
if("link_account")
|
||||
var/attempt_account_num = tgui_input_number(usr, "Enter account number", "New account number")
|
||||
var/attempt_pin = tgui_input_number(usr, "Enter PIN", "Account PIN")
|
||||
linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
if(linked_account)
|
||||
if(linked_account.suspended)
|
||||
linked_account = null
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Account has been suspended."))
|
||||
else
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Account not found."))
|
||||
if("custom_order")
|
||||
var/t_purpose = tgui_input_text(usr, "Enter purpose", "New purpose", "", MAX_MESSAGE_LEN)
|
||||
if (!t_purpose || !Adjacent(usr)) return
|
||||
transaction_purpose = t_purpose
|
||||
item_list += t_purpose
|
||||
var/t_amount = round(tgui_input_number(usr, "Enter price", "New price"))
|
||||
if (!t_amount || !Adjacent(usr)) return
|
||||
transaction_amount += t_amount
|
||||
price_list += t_amount
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 25)
|
||||
src.visible_message("[icon2html(src,viewers(src))][transaction_purpose]: [t_amount] Thaler\s.")
|
||||
if("set_amount")
|
||||
var/item_name = locate(href_list["item"])
|
||||
var/n_amount = round(tgui_input_number(usr, "Enter amount", "New amount", 0, 20, 0))
|
||||
n_amount = CLAMP(n_amount, 0, 20)
|
||||
if (!item_list[item_name] || !Adjacent(usr)) return
|
||||
transaction_amount += (n_amount - item_list[item_name]) * price_list[item_name]
|
||||
if(!n_amount)
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
else
|
||||
item_list[item_name] = n_amount
|
||||
if("subtract")
|
||||
var/item_name = locate(href_list["item"])
|
||||
if(item_name)
|
||||
transaction_amount -= price_list[item_name]
|
||||
item_list[item_name]--
|
||||
if(item_list[item_name] <= 0)
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
if("add")
|
||||
var/item_name = locate(href_list["item"])
|
||||
if(item_list[item_name] >= 20) return
|
||||
transaction_amount += price_list[item_name]
|
||||
item_list[item_name]++
|
||||
if("clear")
|
||||
var/item_name = locate(href_list["item"])
|
||||
if(item_name)
|
||||
transaction_amount -= price_list[item_name] * item_list[item_name]
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
else
|
||||
transaction_amount = 0
|
||||
item_list.Cut()
|
||||
price_list.Cut()
|
||||
if("reset_log")
|
||||
transaction_logs.Cut()
|
||||
to_chat(usr, "[icon2html(src, usr.client)]" + span_notice("Transaction log reset."))
|
||||
updateDialog()
|
||||
switch(action)
|
||||
if("toggle_lock")
|
||||
if(allowed(ui.user))
|
||||
locked = !locked
|
||||
return TRUE
|
||||
to_chat(ui.user, "[icon2html(src, ui.user.client)]" + span_warning("Insufficient access."))
|
||||
return FALSE
|
||||
return access_action(action, params, ui.user)
|
||||
|
||||
/obj/item/retail_scanner/proc/access_action(action, list/params, mob/user)
|
||||
if(locked)
|
||||
return FALSE
|
||||
|
||||
switch(action)
|
||||
if("link_account")
|
||||
var/attempt_account_num = text2num(params["name"])
|
||||
if(isnull(attempt_account_num))
|
||||
return FALSE
|
||||
var/attempt_pin = text2num(params["pin"])
|
||||
if(isnull(attempt_pin))
|
||||
return FALSE
|
||||
linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
if(linked_account)
|
||||
if(linked_account.suspended)
|
||||
linked_account = null
|
||||
visible_message("[icon2html(src, viewers(src))]" + span_warning("Account has been suspended."))
|
||||
return FALSE
|
||||
return TRUE
|
||||
to_chat(user, "[icon2html(src, user.client)]" + span_warning("Account not found."))
|
||||
return FALSE
|
||||
if("custom_order")
|
||||
var/t_purpose = sanitize(params["purpose"], 200)
|
||||
if (!t_purpose)
|
||||
return FALSE
|
||||
transaction_purpose = t_purpose
|
||||
var/amount = params["amount"]
|
||||
if(!isnum(amount))
|
||||
return FALSE
|
||||
amount = CLAMP(amount, 1, 20)
|
||||
item_list[t_purpose] = amount
|
||||
var/price = params["price"]
|
||||
if (!price)
|
||||
return FALSE
|
||||
transaction_amount += amount * price
|
||||
price_list[t_purpose] = price
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 25)
|
||||
visible_message("[icon2html(src, viewers(src))][transaction_purpose][amount > 1 ? "[amount] x" : ""]: [amount * price] Thaler\s.")
|
||||
return TRUE
|
||||
if("set_amount")
|
||||
var/item_name = params["item"]
|
||||
if(!item_name)
|
||||
return FALSE
|
||||
var/n_amount = text2num(params["amount"])
|
||||
if(!isnum(n_amount))
|
||||
return FALSE
|
||||
n_amount = CLAMP(n_amount, 0, 20)
|
||||
if(!item_list[item_name])
|
||||
return FALSE
|
||||
transaction_amount += (n_amount - item_list[item_name]) * price_list[item_name]
|
||||
if(!n_amount)
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
return TRUE
|
||||
item_list[item_name] = n_amount
|
||||
return TRUE
|
||||
if("subtract")
|
||||
var/item_name = params["item"]
|
||||
if(!item_name)
|
||||
return FALSE
|
||||
transaction_amount -= price_list[item_name]
|
||||
item_list[item_name]--
|
||||
if(item_list[item_name] <= 0)
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
return TRUE
|
||||
if("add")
|
||||
var/item_name = params["item"]
|
||||
if(!item_name)
|
||||
return FALSE
|
||||
if(item_list[item_name] >= 20)
|
||||
return FALSE
|
||||
transaction_amount += price_list[item_name]
|
||||
item_list[item_name]++
|
||||
return TRUE
|
||||
if("clear")
|
||||
var/item_name = params["item"]
|
||||
if(!item_name)
|
||||
return FALSE
|
||||
transaction_amount -= price_list[item_name] * item_list[item_name]
|
||||
item_list -= item_name
|
||||
price_list -= item_name
|
||||
return TRUE
|
||||
if("clear_entry")
|
||||
transaction_amount = 0
|
||||
item_list.Cut()
|
||||
price_list.Cut()
|
||||
return TRUE
|
||||
if("reset_log")
|
||||
transaction_logs.Cut()
|
||||
to_chat(user, "[icon2html(src, user.client)]" + span_notice("Transaction log reset."))
|
||||
return TRUE
|
||||
|
||||
/obj/item/retail_scanner/attackby(obj/O, mob/user)
|
||||
// Check for a method of paying (ID, PDA, e-wallet, cash, ect.)
|
||||
var/obj/item/card/id/I = O.GetID()
|
||||
if(I)
|
||||
scan_card(I, O)
|
||||
scan_card(I, O, user)
|
||||
else if (istype(O, /obj/item/spacecash/ewallet))
|
||||
var/obj/item/spacecash/ewallet/E = O
|
||||
scan_wallet(E)
|
||||
@@ -187,33 +201,31 @@
|
||||
return ..()
|
||||
// Not paying: Look up price and add it to transaction_amount
|
||||
else
|
||||
scan_item_price(O)
|
||||
|
||||
scan_item_price(O, user)
|
||||
|
||||
/obj/item/retail_scanner/showoff(mob/user)
|
||||
for (var/mob/M in view(user))
|
||||
M.show_message("[user] holds up [src]. <a HREF='byond://?src=\ref[M];clickitem=\ref[src]'>Swipe card or item.</a>",1)
|
||||
|
||||
|
||||
/obj/item/retail_scanner/proc/confirm(var/obj/item/I)
|
||||
/obj/item/retail_scanner/proc/confirm(obj/item/I)
|
||||
if(confirm_item == I)
|
||||
return 1
|
||||
else
|
||||
confirm_item = I
|
||||
src.visible_message("[icon2html(src,viewers(src))]<b>Total price:</b> [transaction_amount] Thaler\s. Swipe again to confirm.")
|
||||
src.visible_message("[icon2html(src, viewers(src))]<b>Total price:</b> [transaction_amount] Thaler\s. Swipe again to confirm.")
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 25)
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/retail_scanner/proc/scan_card(var/obj/item/card/id/I, var/obj/item/ID_container)
|
||||
/obj/item/retail_scanner/proc/scan_card(obj/item/card/id/I, obj/item/ID_container, mob/user)
|
||||
if (!transaction_amount)
|
||||
return
|
||||
|
||||
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(I))
|
||||
if((length(item_list) > 1 || item_list[item_list[1]] > 1) && !confirm(I))
|
||||
return
|
||||
|
||||
if (!linked_account)
|
||||
usr.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to connect to linked account."))
|
||||
user.visible_message("[icon2html(src, viewers(src))]" + span_warning("Unable to connect to linked account."))
|
||||
return
|
||||
|
||||
// Access account for transaction
|
||||
@@ -221,18 +233,18 @@
|
||||
var/datum/money_account/D = get_account(I.associated_account_number)
|
||||
var/attempt_pin = ""
|
||||
if(D && D.security_level)
|
||||
attempt_pin = tgui_input_number(usr, "Enter PIN", "Transaction")
|
||||
attempt_pin = tgui_input_number(user, "Enter PIN", "Transaction")
|
||||
D = null
|
||||
D = attempt_account_access(I.associated_account_number, attempt_pin, 2)
|
||||
|
||||
if(!D)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to access account. Check security settings and try again."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Unable to access account. Check security settings and try again."))
|
||||
else
|
||||
if(D.suspended)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Your account has been suspended."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Your account has been suspended."))
|
||||
else
|
||||
if(transaction_amount > D.money)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Not enough funds."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Not enough funds."))
|
||||
else
|
||||
// Transfer the money
|
||||
D.money -= transaction_amount
|
||||
@@ -264,18 +276,17 @@
|
||||
// Confirm and reset
|
||||
transaction_complete()
|
||||
|
||||
|
||||
/obj/item/retail_scanner/proc/scan_wallet(var/obj/item/spacecash/ewallet/E)
|
||||
/obj/item/retail_scanner/proc/scan_wallet(obj/item/spacecash/ewallet/E)
|
||||
if (!transaction_amount)
|
||||
return
|
||||
|
||||
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(E))
|
||||
if((length(item_list) > 1 || item_list[item_list[1]] > 1) && !confirm(E))
|
||||
return
|
||||
|
||||
// Access account for transaction
|
||||
if(check_account())
|
||||
if(transaction_amount > E.worth)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Not enough funds."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Not enough funds."))
|
||||
else
|
||||
// Transfer the money
|
||||
E.worth -= transaction_amount
|
||||
@@ -297,20 +308,19 @@
|
||||
// Confirm and reset
|
||||
transaction_complete()
|
||||
|
||||
|
||||
/obj/item/retail_scanner/proc/scan_item_price(var/obj/O)
|
||||
/obj/item/retail_scanner/proc/scan_item_price(obj/O)
|
||||
if(!istype(O)) return
|
||||
if(item_list.len > 10)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Only up to ten different items allowed per purchase."))
|
||||
if(length(item_list) > 10)
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Only up to ten different items allowed per purchase."))
|
||||
return
|
||||
|
||||
// First check if item has a valid price
|
||||
var/price = O.get_item_cost()
|
||||
if(isnull(price))
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to find item in database."))
|
||||
src.visible_message("[icon2html(src, viewers(src))]" + span_warning("Unable to find item in database."))
|
||||
return
|
||||
// Call out item cost
|
||||
src.visible_message("[icon2html(src,viewers(src))]\A [O]: [price ? "[price] Thaler\s" : "free of charge"].")
|
||||
src.visible_message("[icon2html(src, viewers(src))]\A [O]: [price ? "[price] Thaler\s" : "free of charge"].")
|
||||
// Note the transaction purpose for later use
|
||||
if(transaction_purpose)
|
||||
transaction_purpose += "<br>"
|
||||
@@ -329,72 +339,46 @@
|
||||
// Reset confirmation
|
||||
confirm_item = null
|
||||
|
||||
|
||||
/obj/item/retail_scanner/proc/get_current_transaction()
|
||||
var/dat = {"
|
||||
<head><style>
|
||||
.tx-title-r {text-align: center; background-color:#ffdddd; font-weight: bold}
|
||||
.tx-name-r {background-color: #eebbbb}
|
||||
.tx-data-r {text-align: right; background-color: #ffcccc;}
|
||||
</head></style>
|
||||
<table width=300>
|
||||
<tr><td colspan="2" class="tx-title-r">New Entry</td></tr>
|
||||
<tr></tr>"}
|
||||
var/item_name
|
||||
for(var/i=1, i<=item_list.len, i++)
|
||||
item_name = item_list[i]
|
||||
dat += "<tr><td class=\"tx-name-r\">[item_list[item_name] ? "<a href='byond://?src=\ref[src];choice=subtract;item=\ref[item_name]'>-</a> <a href='byond://?src=\ref[src];choice=set_amount;item=\ref[item_name]'>Set</a> <a href='byond://?src=\ref[src];choice=add;item=\ref[item_name]'>+</a> [item_list[item_name]] x " : ""][item_name] <a href='byond://?src=\ref[src];choice=clear;item=\ref[item_name]'>Remove</a></td><td class=\"tx-data-r\" width=50>[price_list[item_name] * item_list[item_name]] þ</td></tr>"
|
||||
dat += "</table><table width=300>"
|
||||
dat += "<tr><td class=\"tx-name-r\"><a href='byond://?src=\ref[src];choice=clear'>Clear Entry</a></td><td class=\"tx-name-r\" style='text-align: right'><b>Total Amount: [transaction_amount] þ</b></td></tr>"
|
||||
dat += "</table></html>"
|
||||
return dat
|
||||
if(!length(item_list))
|
||||
return list()
|
||||
|
||||
var/list/current_transactioon = list(
|
||||
"items" = item_list,
|
||||
"prices" = price_list,
|
||||
"amount" = transaction_amount,
|
||||
|
||||
/obj/item/retail_scanner/proc/add_transaction_log(var/c_name, var/p_method, var/t_amount)
|
||||
var/dat = {"
|
||||
<head><style>
|
||||
.tx-title {text-align: center; background-color:#ddddff; font-weight: bold}
|
||||
.tx-name {background-color: #bbbbee}
|
||||
.tx-data {text-align: right; background-color: #ccccff;}
|
||||
</head></style>
|
||||
<table width=300>
|
||||
<tr><td colspan="2" class="tx-title">Transaction #[transaction_logs.len+1]</td></tr>
|
||||
<tr></tr>
|
||||
<tr><td class="tx-name">Customer</td><td class="tx-data">[c_name]</td></tr>
|
||||
<tr><td class="tx-name">Pay Method</td><td class="tx-data">[p_method]</td></tr>
|
||||
<tr><td class="tx-name">Station Time</td><td class="tx-data">[stationtime2text()]</td></tr>
|
||||
</table>
|
||||
<table width=300>
|
||||
"}
|
||||
var/item_name
|
||||
for(var/i=1, i<=item_list.len, i++)
|
||||
item_name = item_list[i]
|
||||
dat += "<tr><td class=\"tx-name\">[item_list[item_name] ? "[item_list[item_name]] x " : ""][item_name]</td><td class=\"tx-data\" width=50>[price_list[item_name] * item_list[item_name]] þ</td></tr>"
|
||||
dat += "<tr></tr><tr><td colspan=\"2\" class=\"tx-name\" style='text-align: right'><b>Total Amount: [transaction_amount] þ</b></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
transaction_logs += dat
|
||||
)
|
||||
return current_transactioon
|
||||
|
||||
/obj/item/retail_scanner/proc/add_transaction_log(c_name, p_method, t_amount)
|
||||
var/list/new_entry = list(
|
||||
"log_id" = length(transaction_logs) + 1,
|
||||
"customer" = c_name,
|
||||
"payment_method" = p_method,
|
||||
"trans_time" = stationtime2text(),
|
||||
"items" = item_list,
|
||||
"prices" = price_list,
|
||||
"amount" = transaction_amount
|
||||
)
|
||||
UNTYPED_LIST_ADD(transaction_logs, new_entry)
|
||||
|
||||
/obj/item/retail_scanner/proc/check_account()
|
||||
if (!linked_account)
|
||||
usr.visible_message("[icon2html(src,viewers(src))]" + span_warning("Unable to connect to linked account."))
|
||||
return 0
|
||||
visible_message("[icon2html(src, viewers(src))]" + span_warning("Unable to connect to linked account."))
|
||||
return FALSE
|
||||
|
||||
if(linked_account.suspended)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_warning("Connected account has been suspended."))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
visible_message("[icon2html(src, viewers(src))]" + span_warning("Connected account has been suspended."))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/retail_scanner/proc/transaction_complete()
|
||||
/// Visible confirmation
|
||||
playsound(src, 'sound/machines/chime.ogg', 25)
|
||||
src.visible_message("[icon2html(src,viewers(src))]" + span_notice("Transaction complete."))
|
||||
visible_message("[icon2html(src, viewers(src))]" + span_notice("Transaction complete."))
|
||||
flick("retail_approve", src)
|
||||
reset_memory()
|
||||
updateDialog()
|
||||
|
||||
|
||||
/obj/item/retail_scanner/proc/reset_memory()
|
||||
transaction_amount = null
|
||||
@@ -403,13 +387,13 @@
|
||||
price_list.Cut()
|
||||
confirm_item = null
|
||||
|
||||
|
||||
/obj/item/retail_scanner/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
to_chat(user, span_danger("You stealthily swipe the cryptographic sequencer through \the [src]."))
|
||||
playsound(src, "sparks", 50, 1)
|
||||
req_access = list()
|
||||
emagged = 1
|
||||
/obj/item/retail_scanner/emag_act(remaining_charges, mob/user)
|
||||
if(emagged)
|
||||
return
|
||||
to_chat(user, span_danger("You stealthily swipe the cryptographic sequencer through \the [src]."))
|
||||
playsound(src, "sparks", 50, 1)
|
||||
req_access = list()
|
||||
emagged = 1
|
||||
|
||||
//--Premades--//
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
var/dispense_flavour = ICECREAM_VANILLA
|
||||
var/flavour_name = "vanilla"
|
||||
|
||||
/obj/machinery/icecream_vat/proc/get_ingredient_list(var/type)
|
||||
/obj/machinery/icecream_vat/proc/get_ingredient_list(type)
|
||||
switch(type)
|
||||
if(ICECREAM_CHOCOLATE)
|
||||
return list(REAGENT_ID_MILK, REAGENT_ID_ICE, REAGENT_ID_COCO)
|
||||
@@ -36,7 +36,7 @@
|
||||
else
|
||||
return list(REAGENT_ID_MILK, REAGENT_ID_ICE)
|
||||
|
||||
/obj/machinery/icecream_vat/proc/get_flavour_name(var/flavour_type)
|
||||
/obj/machinery/icecream_vat/proc/get_flavour_name(flavour_type)
|
||||
switch(flavour_type)
|
||||
if(ICECREAM_CHOCOLATE)
|
||||
return "chocolate"
|
||||
@@ -61,33 +61,82 @@
|
||||
reagents.add_reagent(REAGENT_ID_SUGAR, 5)
|
||||
reagents.add_reagent(REAGENT_ID_ICE, 5)
|
||||
|
||||
/obj/machinery/icecream_vat/attack_hand(mob/user as mob)
|
||||
/obj/machinery/icecream_vat/attack_hand(mob/user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/icecream_vat/interact(mob/user as mob)
|
||||
var/dat
|
||||
dat += span_bold("ICECREAM") + "<br><div class='statusDisplay'>"
|
||||
dat += span_bold("Dispensing: [flavour_name] icecream ") + " <br><br>"
|
||||
dat += span_bold("Vanilla icecream:") + " <a href='byond://?src=\ref[src];select=[ICECREAM_VANILLA]'>" + span_bold("Select") + "</a> <a href='byond://?src=\ref[src];make=[ICECREAM_VANILLA];amount=1'>" + span_bold("Make") + "</a> <a href='byond://?src=\ref[src];make=[ICECREAM_VANILLA];amount=5'>" + span_bold("x5") + "</a> [product_types[ICECREAM_VANILLA]] scoops left. (Ingredients: milk, ice)<br>"
|
||||
dat += span_bold("Strawberry icecream:") + " <a href='byond://?src=\ref[src];select=[ICECREAM_STRAWBERRY]'>" + span_bold("Select") + "</a> <a href='byond://?src=\ref[src];make=[ICECREAM_STRAWBERRY];amount=1'>" + span_bold("Make") + "</a> <a href='byond://?src=\ref[src];make=[ICECREAM_STRAWBERRY];amount=5'>" + span_bold("x5") + "</a> [product_types[ICECREAM_STRAWBERRY]] dollops left. (Ingredients: milk, ice, berry juice)<br>"
|
||||
dat += span_bold("Chocolate icecream:") + " <a href='byond://?src=\ref[src];select=[ICECREAM_CHOCOLATE]'>" + span_bold("Select") + "</a> <a href='byond://?src=\ref[src];make=[ICECREAM_CHOCOLATE];amount=1'>" + span_bold("Make") + "</a> <a href='byond://?src=\ref[src];make=[ICECREAM_CHOCOLATE];amount=5'>" + span_bold("x5") + "</a> [product_types[ICECREAM_CHOCOLATE]] dollops left. (Ingredients: milk, ice, coco powder)<br>"
|
||||
dat += span_bold("Blue icecream:") + " <a href='byond://?src=\ref[src];select=[ICECREAM_BLUE]'>" + span_bold("Select") + "</a> <a href='byond://?src=\ref[src];make=[ICECREAM_BLUE];amount=1'>" + span_bold("Make") + "</a> <a href='byond://?src=\ref[src];make=[ICECREAM_BLUE];amount=5'>" + span_bold("x5") + "</a> [product_types[ICECREAM_BLUE]] dollops left. (Ingredients: milk, ice, singulo)<br></div>"
|
||||
dat += "<br>" + span_bold("CONES") + "<br><div class='statusDisplay'>"
|
||||
dat += span_bold("Waffle cones:") + " <a href='byond://?src=\ref[src];cone=[CONE_WAFFLE]'>" + span_bold("Dispense") + "</a> <a href='byond://?src=\ref[src];make=[CONE_WAFFLE];amount=1'>" + span_bold("Make") + "</a> <a href='byond://?src=\ref[src];make=[CONE_WAFFLE];amount=5'>" + span_bold("x5") + "</a> [product_types[CONE_WAFFLE]] cones left. (Ingredients: flour, sugar)<br>"
|
||||
dat += span_bold("Chocolate cones:") + " <a href='byond://?src=\ref[src];cone=[CONE_CHOC]'>" + span_bold("Dispense") + "</a> <a href='byond://?src=\ref[src];make=[CONE_CHOC];amount=1'>" + span_bold("Make") + "</a> <a href='byond://?src=\ref[src];make=[CONE_CHOC];amount=5'>" + span_bold("x5") + "</a> [product_types[CONE_CHOC]] cones left. (Ingredients: flour, sugar, coco powder)<br></div>"
|
||||
dat += "<br>"
|
||||
dat += span_bold("VAT CONTENT") + "<br>"
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
dat += "[R.name]: [R.volume]"
|
||||
dat += "<A href='byond://?src=\ref[src];disposeI=[R.id]'>Purge</A><BR>"
|
||||
dat += "<a href='byond://?src=\ref[src];refresh=1'>Refresh</a> <a href='byond://?src=\ref[src];close=1'>Close</a>"
|
||||
/obj/machinery/icecream_vat/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, custom_state)
|
||||
. = ..()
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "IcecreamVat", name)
|
||||
ui.open()
|
||||
|
||||
var/datum/browser/popup = new(user, "icecreamvat","Icecream Vat", 700, 500, src)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
/obj/machinery/icecream_vat/proc/build_icecream_data(list/ice_types)
|
||||
var/ice_data = list()
|
||||
if(!length(ice_types))
|
||||
return ice_data
|
||||
for(var/entry in ice_types)
|
||||
UNTYPED_LIST_ADD(ice_data, list("index" = entry, "name" = get_flavour_name(entry), "amount_left" = product_types[entry], "ingredients" = get_ingredient_list(entry)))
|
||||
return ice_data
|
||||
|
||||
/obj/machinery/icecream_vat/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
/obj/machinery/icecream_vat/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
|
||||
var/list/reagent_data = list()
|
||||
for(var/datum/reagent/current_reagent in reagents.reagent_list)
|
||||
UNTYPED_LIST_ADD(reagent_data, list("name" = current_reagent.name, "volume" = current_reagent.volume, "id" = current_reagent.id))
|
||||
|
||||
return list(
|
||||
"current_flavor" = flavour_name,
|
||||
"icecrem_data" = build_icecream_data(list(ICECREAM_VANILLA, ICECREAM_STRAWBERRY, ICECREAM_CHOCOLATE, ICECREAM_BLUE)),
|
||||
"cone_data" = build_icecream_data(list(CONE_WAFFLE, CONE_CHOC)),
|
||||
"reagent_data" = reagent_data
|
||||
)
|
||||
|
||||
/obj/machinery/icecream_vat/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("index_action")
|
||||
var/index_action = text2num(params["iceIndex"])
|
||||
if(index_action <= 0)
|
||||
return FALSE
|
||||
if(index_action < 5)
|
||||
dispense_flavour = index_action
|
||||
flavour_name = get_flavour_name(dispense_flavour)
|
||||
visible_message(span_notice("[ui.user] sets [src] to dispense [flavour_name] flavoured icecream."))
|
||||
return TRUE
|
||||
if(index_action < 7)
|
||||
var/cone_name = get_flavour_name(index_action)
|
||||
if(product_types[index_action] >= 1)
|
||||
product_types[index_action] -= 1
|
||||
var/obj/item/reagent_containers/food/snacks/icecream/I = new(src.loc)
|
||||
I.cone_type = cone_name
|
||||
I.icon_state = "icecream_cone_[cone_name]"
|
||||
I.desc = "Delicious [cone_name] cone, but no ice cream."
|
||||
visible_message(span_info("[ui.user] dispenses a crunchy [cone_name] cone from [src]."))
|
||||
else
|
||||
to_chat(ui.user, span_warning("There are no [cone_name] cones left!"))
|
||||
return TRUE
|
||||
if("make_type")
|
||||
var/amount = text2num(params["amount"])
|
||||
if(amount <= 0 || amount > 10)
|
||||
return FALSE
|
||||
var/index = text2num(params["index"])
|
||||
if(index <= 0 || index > 6)
|
||||
return FALSE
|
||||
make(ui.user, index, amount)
|
||||
return TRUE
|
||||
if("clear_reagent")
|
||||
var/reagent_id = params["id"]
|
||||
if(!reagent_id)
|
||||
return FALSE
|
||||
reagents.del_reagent(reagent_id)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/icecream_vat/attackby(obj/item/O, mob/user)
|
||||
if(istype(O, /obj/item/reagent_containers/food/snacks/icecream))
|
||||
var/obj/item/reagent_containers/food/snacks/icecream/I = O
|
||||
if(!I.ice_creamed)
|
||||
@@ -109,7 +158,7 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/icecream_vat/proc/make(var/mob/user, var/make_type, var/amount)
|
||||
/obj/machinery/icecream_vat/proc/make(mob/user, make_type, amount)
|
||||
for(var/R in get_ingredient_list(make_type))
|
||||
if(reagents.has_reagent(R, amount))
|
||||
continue
|
||||
@@ -127,47 +176,6 @@
|
||||
else
|
||||
to_chat(user, span_warning("You don't have the ingredients to make this."))
|
||||
|
||||
/obj/machinery/icecream_vat/Topic(href, href_list)
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["select"])
|
||||
dispense_flavour = text2num(href_list["select"])
|
||||
flavour_name = get_flavour_name(dispense_flavour)
|
||||
src.visible_message(span_notice("[usr] sets [src] to dispense [flavour_name] flavoured icecream."))
|
||||
|
||||
if(href_list["cone"])
|
||||
var/dispense_cone = text2num(href_list["cone"])
|
||||
var/cone_name = get_flavour_name(dispense_cone)
|
||||
if(product_types[dispense_cone] >= 1)
|
||||
product_types[dispense_cone] -= 1
|
||||
var/obj/item/reagent_containers/food/snacks/icecream/I = new(src.loc)
|
||||
I.cone_type = cone_name
|
||||
I.icon_state = "icecream_cone_[cone_name]"
|
||||
I.desc = "Delicious [cone_name] cone, but no ice cream."
|
||||
src.visible_message(span_info("[usr] dispenses a crunchy [cone_name] cone from [src]."))
|
||||
else
|
||||
to_chat(usr, span_warning("There are no [cone_name] cones left!"))
|
||||
|
||||
if(href_list["make"])
|
||||
var/amount = (text2num(href_list["amount"]))
|
||||
var/C = text2num(href_list["make"])
|
||||
make(usr, C, amount)
|
||||
|
||||
if(href_list["disposeI"])
|
||||
reagents.del_reagent(href_list["disposeI"])
|
||||
|
||||
updateDialog()
|
||||
|
||||
if(href_list["refresh"])
|
||||
updateDialog()
|
||||
|
||||
if(href_list["close"])
|
||||
usr.unset_machine()
|
||||
usr << browse(null,"window=icecreamvat")
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/icecream
|
||||
name = "ice cream cone"
|
||||
desc = "Delicious waffle cone, but no ice cream."
|
||||
@@ -182,7 +190,7 @@
|
||||
create_reagents(20)
|
||||
reagents.add_reagent(REAGENT_ID_NUTRIMENT, 5)
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/icecream/proc/add_ice_cream(var/flavour_name)
|
||||
/obj/item/reagent_containers/food/snacks/icecream/proc/add_ice_cream(flavour_name)
|
||||
name = "[flavour_name] icecream"
|
||||
add_overlay("icecream_[flavour_name]")
|
||||
desc = "Delicious [cone_type] cone with a dollop of [flavour_name] ice cream."
|
||||
|
||||
@@ -115,7 +115,6 @@
|
||||
current_track = null
|
||||
playing = 0
|
||||
update_icon()
|
||||
updateDialog()
|
||||
start_stop_song()
|
||||
|
||||
// Track/music internals
|
||||
@@ -138,7 +137,6 @@
|
||||
return
|
||||
playing = 1
|
||||
start_stop_song()
|
||||
updateDialog()
|
||||
|
||||
// Advance to the next track - Don't start playing it unless we were already playing
|
||||
/obj/item/walkpod/proc/NextTrack()
|
||||
@@ -149,7 +147,6 @@
|
||||
current_track = tracks[newTrackIndex]
|
||||
if(playing)
|
||||
start_stop_song()
|
||||
updateDialog()
|
||||
|
||||
// Unadvance to the notnext track - Don't start playing it unless we were already playing
|
||||
/obj/item/walkpod/proc/PrevTrack()
|
||||
@@ -160,7 +157,6 @@
|
||||
current_track = tracks[newTrackIndex]
|
||||
if(playing)
|
||||
start_stop_song()
|
||||
updateDialog()
|
||||
|
||||
// UI
|
||||
/obj/item/walkpod/proc/getTracksList()
|
||||
|
||||
@@ -151,11 +151,6 @@ GLOBAL_LIST_EMPTY(apcs)
|
||||
var/nightshift_setting = NIGHTSHIFT_AUTO
|
||||
var/last_nightshift_switch = 0
|
||||
|
||||
/obj/machinery/power/apc/updateDialog()
|
||||
if(stat & (BROKEN|MAINT))
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/power/apc/connect_to_network()
|
||||
//Override because the APC does not directly connect to the network; it goes through a terminal.
|
||||
//The terminal is what the power computer looks for anyway.
|
||||
|
||||
@@ -29,91 +29,6 @@
|
||||
|
||||
monitor.tgui_interact(user)
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/fusion_fuel_control/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/fusion_fuel_control/interact(var/mob/user)
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_control")
|
||||
return
|
||||
|
||||
if (!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_control")
|
||||
return
|
||||
|
||||
if(!id_tag)
|
||||
to_chat(user, span_warning("This console has not been assigned an ident tag. Please contact your system administrator or conduct a manual update with a standard multitool."))
|
||||
return
|
||||
|
||||
var/dat = span_bold("Reactor Core Fuel Control #[id_tag]") + "<BR>"
|
||||
dat += {"
|
||||
<hr>
|
||||
<table border=1 width='100%'>
|
||||
<tr>
|
||||
<td><b>Contains</b></td>
|
||||
<td><b>Assembly</b></td>
|
||||
<td><b>Remaining</b></td>
|
||||
</tr>"}
|
||||
|
||||
for(var/obj/machinery/fusion_fuel_injector/I in fuel_injectors)
|
||||
if(!id_tag || !I.id_tag || I.id_tag != id_tag || get_dist(src, I) > scan_range)
|
||||
continue
|
||||
|
||||
dat += "<tr>"
|
||||
|
||||
if(I.stat & (BROKEN|NOPOWER))
|
||||
dat += "<td>" + span_danger("ERROR") + "</td>"
|
||||
dat += "<td>" + span_danger("ERROR") + "</td>"
|
||||
dat += "<td>" + span_danger("ERROR") + "</td>"
|
||||
else
|
||||
dat += "<td>[I.cur_assembly ? I.cur_assembly.fuel_type : "NONE"]</td>"
|
||||
if(I.cur_assembly)
|
||||
dat += "<td><a href='byond://?src=\ref[src];toggle_injecting=\ref[I]'>\[[I.injecting ? "Halt injecting" : "Begin injecting"]\]</a></td>"
|
||||
else
|
||||
dat += "<td>None</td>"
|
||||
if(I.cur_assembly)
|
||||
dat += "<td>[I.cur_assembly.percent_depleted * 100]%</td>"
|
||||
else
|
||||
dat += "<td>NA</td>"
|
||||
|
||||
dat += "</tr>"
|
||||
|
||||
dat += {"</table><hr>
|
||||
<A href='byond://?src=\ref[src];refresh=1'>Refresh</A>
|
||||
<A href='byond://?src=\ref[src];close=1'>Close</A><BR>"}
|
||||
|
||||
var/datum/browser/popup = new(user, "fuel_control", "Fusion Fuel Control Console", 800, 400, src)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/fusion_fuel_control/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["toggle_injecting"])
|
||||
var/obj/machinery/fusion_fuel_injector/I = locate(href_list["toggle_injecting"])
|
||||
if(I.id_tag != id_tag || get_dist(src, I) > scan_range)
|
||||
return
|
||||
|
||||
if(istype(I))
|
||||
if(I.injecting)
|
||||
I.StopInjecting()
|
||||
else
|
||||
I.BeginInjecting()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_control")
|
||||
usr.unset_machine()
|
||||
|
||||
updateDialog()
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/fusion_fuel_control/attackby(var/obj/item/W, var/mob/user)
|
||||
..()
|
||||
if(istype(W, /obj/item/multitool))
|
||||
@@ -121,21 +36,3 @@
|
||||
if(new_ident && user.Adjacent(src))
|
||||
monitor.fuel_tag = new_ident
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/fusion_fuel_control/update_icon()
|
||||
if(stat & (BROKEN))
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "broken"
|
||||
set_light(0)
|
||||
|
||||
if(stat & (NOPOWER))
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "computer"
|
||||
set_light(0)
|
||||
|
||||
if(!stat & (BROKEN|NOPOWER))
|
||||
icon = initial(icon)
|
||||
icon_state = initial(icon_state)
|
||||
set_light(light_range_on, light_power_on)
|
||||
*/
|
||||
|
||||
@@ -96,8 +96,6 @@ GLOBAL_LIST_EMPTY(all_turbines)
|
||||
stored_energy = 0
|
||||
return
|
||||
|
||||
updateDialog()
|
||||
|
||||
var/datum/gas_mixture/air1 = circ1.return_transfer_air()
|
||||
var/datum/gas_mixture/air2 = circ2.return_transfer_air()
|
||||
|
||||
|
||||
@@ -353,7 +353,6 @@ GLOBAL_LIST_EMPTY(gravity_generators)
|
||||
if(charge_count % 4 == 0 && prob(75)) // Let them know it is charging/discharging.
|
||||
playsound(src, 'sound/effects/empulse.ogg', 100, 1)
|
||||
|
||||
updateDialog()
|
||||
if(prob(25)) // To help stop "Your clothes feel warm." spam.
|
||||
pulse_radiation()
|
||||
|
||||
|
||||
@@ -236,7 +236,6 @@
|
||||
var/temp_loss = (temperature - cooling_temperature)/TEMPERATURE_DIVISOR
|
||||
temp_loss = between(2, round(temp_loss, 1), TEMPERATURE_CHANGE_MAX)
|
||||
temperature = max(temperature - temp_loss, cooling_temperature)
|
||||
updateDialog()
|
||||
|
||||
if(overheating)
|
||||
overheating--
|
||||
|
||||
@@ -340,9 +340,14 @@
|
||||
// Multitool - change RCON tag
|
||||
if(istype(W, /obj/item/multitool))
|
||||
var/newtag = tgui_input_text(user, "Enter new RCON tag. Use \"NO_TAG\" to disable RCON or leave empty to cancel.", "SMES RCON system", "", MAX_NAME_LEN)
|
||||
if(newtag)
|
||||
RCon_tag = newtag
|
||||
to_chat(user, span_notice("You changed the RCON tag to: [newtag]"))
|
||||
if(!newtag)
|
||||
return
|
||||
for(var/obj/machinery/power/smes/buildable/smes in GLOB.smeses)
|
||||
if(smes.RCon_tag == newtag)
|
||||
to_chat(user, span_warning("The entered RCON tag [newtag] already exists. Aborting."))
|
||||
return
|
||||
RCon_tag = newtag
|
||||
to_chat(user, span_notice("You changed the RCON tag to: [newtag]"))
|
||||
return
|
||||
// Charged above 1% and safeties are enabled.
|
||||
if((charge > (capacity/100)) && safeties_enabled)
|
||||
|
||||
@@ -362,7 +362,6 @@ GLOBAL_LIST_EMPTY(solars_list)
|
||||
connected_tracker.set_angle(SSsun.sun.angle)
|
||||
|
||||
set_panels(cdir)
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/power/solar_control/update_icon()
|
||||
if(stat & BROKEN)
|
||||
@@ -458,8 +457,6 @@ GLOBAL_LIST_EMPTY(solars_list)
|
||||
if(powernet)
|
||||
add_avail(connected_power)
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/power/solar_control/tgui_act(action, params)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -273,45 +273,41 @@
|
||||
if(lastgen > 100)
|
||||
add_overlay(image('icons/obj/pipes.dmi', "turb-o", FLY_LAYER))
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/power/turbine/attack_hand(var/mob/user as mob)
|
||||
if((. = ..()))
|
||||
return
|
||||
src.interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/power/turbine/interact(mob/user)
|
||||
if(!Adjacent(user) || (stat & (NOPOWER|BROKEN)) && !issilicon(user))
|
||||
user.unset_machine(src)
|
||||
user << browse(null, "window=turbine")
|
||||
/obj/machinery/power/turbine/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, custom_state)
|
||||
. = ..()
|
||||
if(!Adjacent(user) && !issilicon(user))
|
||||
return
|
||||
user.set_machine(src)
|
||||
|
||||
var/t = "<TT><B>Gas Turbine Generator</B><HR><PRE>"
|
||||
t += "Generated power : [DisplayPower(lastgen)]<BR><BR>"
|
||||
t += "Turbine: [round(compressor.rpm)] RPM<BR>"
|
||||
t += "Starter: [ compressor.starter ? "<A href='byond://?src=\ref[src];str=1'>Off</A> " + span_bold("On") : span_bold("Off") + " <A href='byond://?src=\ref[src];str=1'>On</A>"]"
|
||||
t += "</PRE><HR><A href='byond://?src=\ref[src];close=1'>Close</A>"
|
||||
t += "</TT>"
|
||||
var/datum/browser/popup = new(user, "turbine", name, 700, 500, src)
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/power/turbine/Topic(href, href_list)
|
||||
if(..())
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=turbine")
|
||||
usr.unset_machine(src)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "Turbine", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/turbine/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
return list(
|
||||
"display_power" = lastgen,
|
||||
"turbine_rpm" = compressor?.rpm,
|
||||
"starter" = compressor?.starter
|
||||
)
|
||||
|
||||
/obj/machinery/power/turbine/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
else if(href_list["str"])
|
||||
if(compressor)
|
||||
|
||||
switch(action)
|
||||
if("start_stop")
|
||||
if(!compressor)
|
||||
return FALSE
|
||||
compressor.starter = !compressor.starter
|
||||
updateDialog()
|
||||
|
||||
return TRUE
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Turbine Computer
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
src.locked = !src.locked
|
||||
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
|
||||
. = 1
|
||||
updateDialog()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -48,7 +47,6 @@
|
||||
if((ACCESS_CAPTAIN in C.GetAccess()) || (ACCESS_SECURITY in C.GetAccess()) || (ACCESS_ENGINE in C.GetAccess()))
|
||||
src.locked = !src.locked
|
||||
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
|
||||
updateDialog()
|
||||
else
|
||||
to_chat(user, span_red("Access denied."))
|
||||
else if(W.has_tool_quality(TOOL_WRENCH))
|
||||
@@ -62,7 +60,6 @@
|
||||
if(get_dir(src, gen) == src.dir)
|
||||
owned_gen = gen
|
||||
owned_gen.capacitors |= src
|
||||
owned_gen.updateDialog()
|
||||
else
|
||||
if(owned_gen && (src in owned_gen.capacitors))
|
||||
owned_gen.capacitors -= src
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
src.locked = !src.locked
|
||||
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
|
||||
. = 1
|
||||
updateDialog()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -64,7 +63,6 @@
|
||||
if((ACCESS_CAPTAIN in C.GetAccess()) || (ACCESS_SECURITY in C.GetAccess()) || (ACCESS_ENGINE in C.GetAccess()))
|
||||
src.locked = !src.locked
|
||||
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
|
||||
updateDialog()
|
||||
else
|
||||
to_chat(user, span_red("Access denied."))
|
||||
else if(W.has_tool_quality(TOOL_WRENCH))
|
||||
@@ -83,7 +81,6 @@
|
||||
// owned_capacitor = cap
|
||||
capacitors |= cap
|
||||
cap.owned_gen = src
|
||||
updateDialog()
|
||||
// break
|
||||
else
|
||||
for(var/obj/machinery/shield_capacitor/capacitor in capacitors)
|
||||
|
||||
@@ -336,13 +336,3 @@
|
||||
GLOB.stockExchange.add_log(/datum/stock_log/borrow, user.name, B.stock.name, B.share_amount, B.deposit)
|
||||
else
|
||||
to_chat(user, span_danger("Could not complete transaction. Check your account balance."))
|
||||
|
||||
/obj/machinery/computer/stockexchange/Topic(href, href_list)
|
||||
if (..())
|
||||
return 1
|
||||
|
||||
if (!usr || (!(usr in range(1, src)) && iscarbon(usr)))
|
||||
usr.set_machine(src)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog(usr)
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
crystals += W
|
||||
W.forceMove(src)
|
||||
user.visible_message("[user] inserts [W] into \the [src]'s crystal slot.", span_notice("You insert [W] into \the [src]'s crystal slot."))
|
||||
updateDialog()
|
||||
else if(istype(W, /obj/item/gps))
|
||||
if(!inserted_gps)
|
||||
inserted_gps = W
|
||||
@@ -349,7 +348,6 @@
|
||||
log_msg += "nothing"
|
||||
log_msg += " [sending ? "to" : "from"] [trueX], [trueY], [z_co] ([A ? A.name : "null area"])"
|
||||
investigate_log(log_msg, "telesci")
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/telescience/proc/teleport(mob/user)
|
||||
if(!COOLDOWN_FINISHED(src, teleport_cooldown))
|
||||
|
||||
@@ -472,6 +472,7 @@ GLOBAL_LIST_EMPTY(pending_discord_registrations)
|
||||
if(!command_add.Execute())
|
||||
log_sql("Error while trying to add [ckey] to the [role] [kind] whitelist.")
|
||||
message.text = "Error while trying to add [ckey] to the [role] [kind] whitelist. Please review SQL logs."
|
||||
qdel(command_add)
|
||||
return message
|
||||
qdel(command_add)
|
||||
|
||||
@@ -499,6 +500,7 @@ GLOBAL_LIST_EMPTY(pending_discord_registrations)
|
||||
if(!command_remove.Execute())
|
||||
log_sql("Error while trying to remove [ckey] from the [role] [kind] whitelist.")
|
||||
message.text = "Error while trying to remove [ckey] from the [role] [kind] whitelist. Please review SQL logs."
|
||||
qdel(command_remove)
|
||||
return message
|
||||
qdel(command_remove)
|
||||
|
||||
@@ -535,14 +537,14 @@ GLOBAL_LIST_EMPTY(pending_discord_registrations)
|
||||
log_sql("Error while trying to query whitelists for [ckey].")
|
||||
embed.description = "Error while trying to query whitelists for [ckey]. Please review SQL logs."
|
||||
embed.colour = "#FF0000"
|
||||
qdel(query_list)
|
||||
return message
|
||||
else
|
||||
while(query_list.NextRow())
|
||||
var/kind_query_result = query_list.item[1]
|
||||
var/entry_query_result = query_list.item[2]
|
||||
while(query_list.NextRow())
|
||||
var/kind_query_result = query_list.item[1]
|
||||
var/entry_query_result = query_list.item[2]
|
||||
|
||||
embed.description += "- [kind_query_result] - [entry_query_result]\n"
|
||||
found = TRUE
|
||||
embed.description += "- [kind_query_result] - [entry_query_result]\n"
|
||||
found = TRUE
|
||||
qdel(query_list)
|
||||
|
||||
if(!found)
|
||||
|
||||
@@ -13,15 +13,12 @@
|
||||
var/number_pages = 0
|
||||
|
||||
/datum/tgui_module/rcon/proc/filter_smeslist(var/page)
|
||||
number_pages = known_SMESs.len / SMES_PER_PAGE
|
||||
|
||||
if(number_pages != round(number_pages))
|
||||
number_pages = round(number_pages) + 1
|
||||
number_pages = (length(known_SMESs) + SMES_PER_PAGE - 1) / SMES_PER_PAGE
|
||||
var/page_index = page - 1
|
||||
|
||||
var/lower_bound = page_index * SMES_PER_PAGE + 1
|
||||
var/upper_bound = (page_index + 1) * SMES_PER_PAGE
|
||||
upper_bound = min(upper_bound, known_SMESs.len)
|
||||
upper_bound = min(upper_bound, length(known_SMESs))
|
||||
filtered_smeslist = list()
|
||||
|
||||
for(var/index = lower_bound, index <= upper_bound, index++)
|
||||
@@ -34,13 +31,13 @@
|
||||
filter_smeslist(current_page)
|
||||
|
||||
// SMES DATA (simplified view)
|
||||
var/list/smeslist[0]
|
||||
var/list/smeslist = list()
|
||||
for(var/obj/machinery/power/smes/buildable/SMES in filtered_smeslist)
|
||||
var/list/smes_data = SMES.tgui_data()
|
||||
smes_data["RCON_tag"] = SMES.RCon_tag
|
||||
smeslist.Add(list(smes_data))
|
||||
|
||||
data["pages"] = number_pages + 1
|
||||
data["pages"] = number_pages
|
||||
data["current_page"] = current_page
|
||||
data["smes_info"] = sortByKey(smeslist, "RCON_tag")
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@
|
||||
if(floor.ext_panel)
|
||||
floor.ext_panel.reset()
|
||||
queued_floors.Cut()
|
||||
control_panel_interior.updateDialog()
|
||||
|
||||
// Update the icons of all exterior panels (after we change modes etc)
|
||||
/datum/turbolift/proc/update_ext_panel_icons()
|
||||
@@ -146,7 +145,6 @@
|
||||
moving_upwards = 1
|
||||
else
|
||||
moving_upwards = 0
|
||||
control_panel_interior.updateDialog()
|
||||
|
||||
if(doors_are_open())
|
||||
if(!doors_closing)
|
||||
|
||||
@@ -110,7 +110,6 @@
|
||||
/obj/machinery/artifact_analyser/process()
|
||||
if(scan_in_progress && world.time > scan_completion_time)
|
||||
scan_in_progress = 0
|
||||
updateDialog()
|
||||
|
||||
var/results = ""
|
||||
if(!owned_scanner)
|
||||
|
||||
Reference in New Issue
Block a user