mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 23:17:28 +01:00
browse to browser part 1 (#17800)
* browse to browser * some more * fix that * fix that * . * datum browser update port * . * .
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<head><title>Engine Computer</title></head><body>"
|
||||
var/dat = ""
|
||||
switch(src.state)
|
||||
if(STATE_DEFAULT)
|
||||
if (src.authenticated)
|
||||
@@ -85,8 +85,11 @@
|
||||
dat += "<BR>Contents:<br>[src.connected_E.H_fuel]kg of Hydrogen<br>[src.connected_E.antiH_fuel]kg of Anti-Hydrogen<br>"
|
||||
|
||||
dat += "<BR>\[ [(src.state != STATE_DEFAULT) ? "<A href='byond://?src=\ref[src];operation=main'>Main Menu</A> | " : ""]<A href='byond://?src=\ref[user];mach_close=communications'>Close</A> \]"
|
||||
user << browse("<html>[dat]</html>", "window=communications;size=400x500")
|
||||
onclose(user, "communications")
|
||||
|
||||
var/datum/browser/popup = new(user, "communications", "Communications", 400, 500)
|
||||
popup.add_head_content("<title>Engine Computer</title>")
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
#undef STATE_DEFAULT
|
||||
#undef STATE_INJECTOR
|
||||
|
||||
@@ -31,91 +31,6 @@
|
||||
|
||||
monitor.tgui_interact(user)
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/gyrotron_control/attack_hand(var/mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/gyrotron_control/interact(var/mob/user)
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=gyrotron_controller_[id_tag]")
|
||||
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 = "<td>" + span_bold("Gyrotron controller #[id_tag]")
|
||||
|
||||
dat = "<table><tr>"
|
||||
dat += "<td>" + span_bold("Mode") + "</td>"
|
||||
dat += "<td>" + span_bold("Fire Delay") + "</td>"
|
||||
dat += "<td>" + span_bold("Power") + "</td>"
|
||||
dat += "</tr>"
|
||||
|
||||
for(var/obj/machinery/power/emitter/gyrotron/G in gyrotrons)
|
||||
if(!G || G.id_tag != id_tag || get_dist(src, G) > scan_range)
|
||||
continue
|
||||
|
||||
dat += "<tr>"
|
||||
if(G.state != 2 || (G.stat & (NOPOWER | BROKEN))) //Error data not found.
|
||||
dat += "<td>" + span_red("ERROR") + "</td>"
|
||||
dat += "<td>" + span_red("ERROR") + "</td>"
|
||||
dat += "<td>" + span_red("ERROR") + "</td>"
|
||||
else
|
||||
dat += "<td><a href='byond://?src=\ref[src];machine=\ref[G];toggle=1'>[G.active ? "Emitting" : "Standing By"]</a></td>"
|
||||
dat += "<td><a href='byond://?src=\ref[src];machine=\ref[G];modifyrate=1'>[G.rate]</a></td>"
|
||||
dat += "<td><a href='byond://?src=\ref[src];machine=\ref[G];modifypower=1'>[G.mega_energy]</a></td>"
|
||||
|
||||
dat += "</tr></table>"
|
||||
|
||||
var/datum/browser/popup = new(user, "gyrotron_controller_[id_tag]", "Gyrotron Remote Control Console", 500, 400, src)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/gyrotron_control/Topic(var/href, var/list/href_list)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
if(stat & (NOPOWER | BROKEN))
|
||||
return
|
||||
|
||||
var/obj/machinery/power/emitter/gyrotron/G = locate(href_list["machine"])
|
||||
if(!G || G.id_tag != id_tag || get_dist(src, G) > scan_range)
|
||||
return
|
||||
|
||||
if(href_list["modifypower"])
|
||||
var/new_val = tgui_input_number(usr, "Enter new emission power level (1 - 50)", "Modifying power level", G.mega_energy, 50, 1)
|
||||
if(!new_val)
|
||||
to_chat(usr, span_warning("That's not a valid number."))
|
||||
return 1
|
||||
G.mega_energy = CLAMP(new_val, 1, 50)
|
||||
G.update_active_power_usage(G.mega_energy * 1500)
|
||||
updateUsrDialog(usr)
|
||||
return 1
|
||||
|
||||
if(href_list["modifyrate"])
|
||||
var/new_val = tgui_input_number(usr, "Enter new emission delay between 1 and 10 seconds.", "Modifying emission rate", G.rate, 10, 1)
|
||||
if(!new_val)
|
||||
to_chat(usr, span_warning("That's not a valid number."))
|
||||
return 1
|
||||
G.rate = CLAMP(new_val, 1, 10)
|
||||
updateUsrDialog(usr)
|
||||
return 1
|
||||
|
||||
if(href_list["toggle"])
|
||||
G.activate(usr)
|
||||
updateUsrDialog(usr)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/gyrotron_control/attackby(var/obj/item/W, var/mob/user)
|
||||
..()
|
||||
if(istype(W, /obj/item/multitool))
|
||||
|
||||
Reference in New Issue
Block a user