/datum/browser var/mob/user var/title var/window_id // window_id is used as the window name for browse and onclose var/width = 0 var/height = 0 var/datum/weakref/ref = null var/window_options = "can_close=1;can_minimize=1;can_maximize=0;can_resize=1;titlebar=1;" // window option is set using window_id var/stylesheets[0] var/scripts[0] var/head_elements var/body_elements var/head_content = "" var/content = "" var/datum/asset_pack/simple/common/common_asset /datum/browser/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, atom/nref = null) user = nuser RegisterSignal(user, COMSIG_PARENT_QDELETING, PROC_REF(user_deleted)) window_id = nwindow_id if (ntitle) title = format_text(ntitle) if (nwidth) width = nwidth if (nheight) height = nheight if (nref) ref = WEAKREF(nref) spawn(0) // i'm so sorry common_asset = SSassets.ready_asset_pack(/datum/asset_pack/simple/common) /datum/browser/proc/user_deleted(datum/source) SIGNAL_HANDLER user = null /datum/browser/proc/add_head_content(nhead_content) head_content = nhead_content /datum/browser/proc/set_window_options(nwindow_options) window_options = nwindow_options /datum/browser/proc/add_stylesheet(name, file) name = "[sanitize_filename(name)].css" stylesheets |= name SSassets.register_dynamic_item_by_name(file, name) /datum/browser/proc/add_script(name, file) name = "[sanitize_filename(name)].js" scripts |= "[name]" SSassets.register_dynamic_item_by_name("[name]", name) /datum/browser/proc/set_content(ncontent) content = ncontent /datum/browser/proc/add_content(ncontent) content += ncontent /datum/browser/proc/get_header() var/file head_content += "" for (file in stylesheets) head_content += "" for (file in scripts) head_content += "" return {"
[head_content]