mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +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:
@@ -467,7 +467,7 @@
|
||||
admin_holder.rank_flags(),
|
||||
350,
|
||||
590,
|
||||
allowed_edit_list = usr.client.holder.can_edit_rights_flags(),
|
||||
allowed_edit_field = usr.client.holder.can_edit_rights_flags(),
|
||||
)
|
||||
|
||||
admin_holder.disassociate()
|
||||
|
||||
@@ -77,7 +77,9 @@ GLOBAL_VAR_INIT(global_vantag_hud, 0)
|
||||
to_chat(src, "Some accounts did not have proper ages set in their clients. This function requires database to be present.")
|
||||
|
||||
if(msg != "")
|
||||
src << browse("<html>[msg]</html>", "window=Player_age_check")
|
||||
var/datum/browser/popup = new(src, "Player_age_check", "Player Age Check")
|
||||
popup.set_content(msg)
|
||||
popup.open()
|
||||
else
|
||||
to_chat(src, "No matches for that age range found.")
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -162,8 +162,9 @@
|
||||
dat += span_red("The dart cartridge is empty!")
|
||||
dat += " \[<A href='byond://?src=\ref[src];eject_cart=1'>Eject</A>\]"
|
||||
|
||||
user << browse("<html>[dat]</html>", "window=dartgun")
|
||||
onclose(user, "dartgun", src)
|
||||
var/datum/browser/popup = new(user, "dartgun", "Dartgun")
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/obj/item/gun/projectile/dartgun/proc/check_beaker_mixing(var/obj/item/B)
|
||||
if(!mixing || !beakers)
|
||||
|
||||
@@ -25,4 +25,6 @@ GLOBAL_LIST_EMPTY(chemical_reaction_logs)
|
||||
for(var/entry in GLOB.chemical_reaction_logs)
|
||||
html += "[entry]<br>"
|
||||
|
||||
usr << browse("<html>[html]</html>", "window=chemlogs")
|
||||
var/datum/browser/popup = new(usr, "chemlogs", "Chemlogs")
|
||||
popup.set_content(html)
|
||||
popup.open()
|
||||
|
||||
@@ -301,84 +301,6 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
// src.add_fingerprint(user)
|
||||
// if(stat & BROKEN)
|
||||
// user.unset_machine()
|
||||
// return
|
||||
|
||||
// var/dat = "<head><title>Waste Disposal Unit</title></head><body><TT>" + span_bold("Waste Disposal Unit") + "<HR>"
|
||||
|
||||
// if(!ai) // AI can't pull flush handle
|
||||
// if(flush)
|
||||
// dat += "Disposal handle: <A href='byond://?src=\ref[src];handle=0'>Disengage</A> " + span_bold("Engaged")
|
||||
// else
|
||||
// dat += "Disposal handle: " + span_bold("Disengaged") + " <A href='byond://?src=\ref[src];handle=1'>Engage</A>"
|
||||
|
||||
// dat += "<BR><HR><A href='byond://?src=\ref[src];eject=1'>Eject contents</A><HR>"
|
||||
|
||||
// if(mode <= 0)
|
||||
// dat += "Pump: " + span_bold("Off") + " <A href='byond://?src=\ref[src];pump=1'>On</A><BR>"
|
||||
// else if(mode == 1)
|
||||
// dat += "Pump: <A href='byond://?src=\ref[src];pump=0'>Off</A> " + span_bold("On") + " (pressurizing)<BR>"
|
||||
// else
|
||||
// dat += "Pump: <A href='byond://?src=\ref[src];pump=0'>Off</A> " + span_bold("On") + " (idle)<BR>"
|
||||
|
||||
// var/per = 100* air_contents.return_pressure() / (SEND_PRESSURE)
|
||||
|
||||
// dat += "Pressure: [round(per, 1)]%<BR></body>"
|
||||
|
||||
|
||||
// user.set_machine(src)
|
||||
// user << browse("<html>[dat]</html>", "window=disposal;size=360x170")
|
||||
// onclose(user, "disposal")
|
||||
|
||||
// handle machine interaction
|
||||
|
||||
// /obj/machinery/disposal/Topic(href, href_list)
|
||||
// if(usr.loc == src)
|
||||
// to_chat(usr, span_red("You cannot reach the controls from inside."))
|
||||
// return
|
||||
|
||||
// if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1
|
||||
// to_chat(usr, span_red("The disposal units power is disabled."))
|
||||
// return
|
||||
// if(..())
|
||||
// return
|
||||
|
||||
// if(stat & BROKEN)
|
||||
// return
|
||||
// if(usr.stat || usr.restrained() || src.flushing)
|
||||
// return
|
||||
|
||||
// if(istype(src.loc, /turf))
|
||||
// usr.set_machine(src)
|
||||
|
||||
// if(href_list["close"])
|
||||
// usr.unset_machine()
|
||||
// usr << browse(null, "window=disposal")
|
||||
// return
|
||||
|
||||
// if(href_list["pump"])
|
||||
// if(text2num(href_list["pump"]))
|
||||
// mode = 1
|
||||
// else
|
||||
// mode = 0
|
||||
// update()
|
||||
|
||||
// if(!isAI(usr))
|
||||
// if(href_list["handle"])
|
||||
// flush = text2num(href_list["handle"])
|
||||
// update()
|
||||
|
||||
// if(href_list["eject"])
|
||||
// eject()
|
||||
// else
|
||||
// usr << browse(null, "window=disposal")
|
||||
// usr.unset_machine()
|
||||
// return
|
||||
// return
|
||||
|
||||
// eject the contents of the disposal unit
|
||||
|
||||
/obj/machinery/disposal/verb/force_eject()
|
||||
|
||||
@@ -78,9 +78,10 @@
|
||||
// END AUTOFIX
|
||||
if(op)
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=rememorize'>Re-memorize Spells</A><BR>"
|
||||
user << browse("<html>[dat]</html>", "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
var/datum/browser/popup = new(user, "radio", "Spellbook")
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/obj/item/spellbook/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
GLOBAL_DATUM_INIT(stockExchange, /datum/stockMarket, new)
|
||||
|
||||
/proc/plotBarGraph(var/list/points, var/base_text, var/width=400, var/height=400)
|
||||
var/output = "<html><table style='border:1px solid black; border-collapse: collapse; width: [width]px; height: [height]px'>"
|
||||
var/output = "<table style='border:1px solid black; border-collapse: collapse; width: [width]px; height: [height]px'>"
|
||||
if (points.len && height > 20 && width > 20)
|
||||
var/min = points[1]
|
||||
var/max = points[1]
|
||||
@@ -165,4 +165,4 @@ GLOBAL_DATUM_INIT(stockExchange, /datum/stockMarket, new)
|
||||
output += "<tr><td style='width:[width]px; height:[height]px; background: black'></td></tr>"
|
||||
output += "<tr><td style='font-size:10px; background:black; color:green; text-align:center'>[base_text]</td></tr>"
|
||||
|
||||
return "[output]</table></html>"
|
||||
return "[output]</table>"
|
||||
|
||||
@@ -305,4 +305,6 @@
|
||||
return 0
|
||||
|
||||
/datum/stock/proc/displayValues(var/mob/user)
|
||||
user << browse(plotBarGraph(values, "[name] share value per share"), "window=stock_[name];size=450x450")
|
||||
var/datum/browser/popup = new(user, "stock_[name]", "Share Value", 450, 450)
|
||||
popup.set_content(plotBarGraph(values, "[name] share value per share"))
|
||||
popup.open()
|
||||
|
||||
@@ -238,7 +238,9 @@
|
||||
if(index == page)
|
||||
dat = span_bold(dat)
|
||||
|
||||
usr << browse("<html>[dat]</html>", "window=player_notes;size=400x400")
|
||||
var/datum/browser/popup = new(usr, "player_notes", "Admin Playernotes", 480, 480)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/datum/admins/proc/player_has_info_legacy(var/key as text)
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
@@ -253,8 +255,7 @@
|
||||
if (!istype(src,/datum/admins))
|
||||
to_chat(usr, "Error: you are not an admin!")
|
||||
return
|
||||
var/dat = "<html><head><title>Info on [key]</title></head>"
|
||||
dat += "<body>"
|
||||
var/dat = ""
|
||||
|
||||
var/p_age = "unknown"
|
||||
for(var/client/C in GLOB.clients)
|
||||
@@ -288,8 +289,10 @@
|
||||
dat += "<br>"
|
||||
dat += "<A href='byond://?src=\ref[src];[HrefToken()];add_player_info_legacy=[key]'>Add Comment</A><br>"
|
||||
|
||||
dat += "</body></html>"
|
||||
usr << browse(dat, "window=adminplayerinfo;size=480x480")
|
||||
var/datum/browser/popup = new(usr, "adminplayerinfo", "Admin Playerinfo", 480, 480)
|
||||
popup.add_head_content("<title>Info on [key]</title>")
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/datum/admins/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
nuke_chat()
|
||||
|
||||
// Failed to fix, using tgalert as fallback
|
||||
action = tgalert(src, "Did that work?", "", "Yes", "No, switch to old ui")
|
||||
action = tg_alert(src, "Did that work?", "", "Yes", "No, switch to old ui")
|
||||
if (action == "No, switch to old ui")
|
||||
winset(src, "legacy_output_selector", "left=output_legacy")
|
||||
log_tgui(src, "Failed to fix.", context = "verb/fix_tgui_panel")
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
if(dat)
|
||||
last_data = dat
|
||||
dat += "<br><br>\[<a href='byond://?src=\ref[src];print=1'>print report</a>\]"
|
||||
user << browse("<html>[dat]</html>","window=xeno_analyzer")
|
||||
|
||||
return
|
||||
var/datum/browser/popup = new(user, "xeno_analyzer", "Xeno Analyzer")
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
Reference in New Issue
Block a user