512 forward compatibility merge
This commit is contained in:
committed by
CitadelStationBot
parent
fd2705b6e6
commit
4b297f509e
@@ -149,20 +149,20 @@ GLOBAL_LIST_EMPTY(html_interfaces)
|
||||
asset_list[type] = assetlist
|
||||
|
||||
/datum/html_interface/proc/createWindow(datum/html_interface_client/hclient)
|
||||
winclone(hclient.client, "window", "browser_\ref[src]")
|
||||
winclone(hclient.client, "window", "browser_[REF(src)]")
|
||||
|
||||
var/list/params = list(
|
||||
"size" = "[width]x[height]",
|
||||
"statusbar" = "false",
|
||||
"on-close" = "byond://?src=\ref[src]&html_interface_action=onclose"
|
||||
"on-close" = "byond://?src=[REF(src)]&html_interface_action=onclose"
|
||||
)
|
||||
|
||||
if (hclient.client.hi_last_pos)
|
||||
params["pos"] = "[hclient.client.hi_last_pos]"
|
||||
|
||||
winset(hclient.client, "browser_\ref[src]", list2params(params))
|
||||
winset(hclient.client, "browser_[REF(src)]", list2params(params))
|
||||
|
||||
winset(hclient.client, "browser_\ref[src].browser", list2params(list("parent" = "browser_\ref[src]", "type" = "browser", "pos" = "0,0", "size" = "[width]x[height]", "anchor1" = "0,0", "anchor2" = "100,100", "use-title" = "true", "auto-format" = "false")))
|
||||
winset(hclient.client, "browser_[REF(src)].browser", list2params(list("parent" = "browser_[REF(src)]", "type" = "browser", "pos" = "0,0", "size" = "[width]x[height]", "anchor1" = "0,0", "anchor2" = "100,100", "use-title" = "true", "auto-format" = "false")))
|
||||
|
||||
/* * Public API */
|
||||
/datum/html_interface/proc/getTitle()
|
||||
@@ -185,7 +185,7 @@ GLOBAL_LIST_EMPTY(html_interfaces)
|
||||
|
||||
if (istype(hclient))
|
||||
if (hclient.is_loaded)
|
||||
hclient.client << output(list2params(list(jscript)), "browser_\ref[src].browser:eval")
|
||||
hclient.client << output(list2params(list(jscript)), "browser_[REF(src)].browser:eval")
|
||||
else
|
||||
for (var/client in src.clients)
|
||||
if(src.clients[client])
|
||||
@@ -200,7 +200,7 @@ GLOBAL_LIST_EMPTY(html_interfaces)
|
||||
|
||||
if (istype(hclient))
|
||||
if (hclient.is_loaded)
|
||||
hclient.client << output(list2params(arguments), "browser_\ref[src].browser:[func]")
|
||||
hclient.client << output(list2params(arguments), "browser_[REF(src)].browser:[func]")
|
||||
else
|
||||
for (var/client in src.clients)
|
||||
if (src.clients[client])
|
||||
@@ -235,15 +235,15 @@ GLOBAL_LIST_EMPTY(html_interfaces)
|
||||
if ((type in asset_list) && islist(asset_list[type]))
|
||||
send_asset_list(hclient.client, asset_list[type], TRUE)
|
||||
|
||||
if (!winexists(hclient.client, "browser_\ref[src]"))
|
||||
if (!winexists(hclient.client, "browser_[REF(src)]"))
|
||||
src.createWindow(hclient)
|
||||
//src._renderTitle(hclient, TRUE)
|
||||
//src._renderLayout(hclient)
|
||||
|
||||
hclient.is_loaded = FALSE
|
||||
hclient.client << output(replacetextEx(replacetextEx(file2text('html_interface.html'), "\[hsrc\]", "\ref[src]"), "</head>", "[head]</head>"), "browser_\ref[src].browser")
|
||||
hclient.client << output(replacetextEx(replacetextEx(file2text('html_interface.html'), "\[hsrc\]", "[REF(src)]"), "</head>", "[head]</head>"), "browser_[REF(src)].browser")
|
||||
|
||||
winshow(hclient.client, "browser_\ref[src]", TRUE)
|
||||
winshow(hclient.client, "browser_[REF(src)]", TRUE)
|
||||
|
||||
while (hclient.client && hclient.active && !hclient.is_loaded)
|
||||
sleep(2)
|
||||
@@ -258,10 +258,10 @@ GLOBAL_LIST_EMPTY(html_interfaces)
|
||||
if (!src.clients.len)
|
||||
src.clients = null
|
||||
|
||||
hclient.client.hi_last_pos = winget(hclient.client, "browser_\ref[src]" ,"pos")
|
||||
hclient.client.hi_last_pos = winget(hclient.client, "browser_[REF(src)]" ,"pos")
|
||||
|
||||
winshow(hclient.client, "browser_\ref[src]", FALSE)
|
||||
winset(hclient.client, "browser_\ref[src]", "parent=none")
|
||||
winshow(hclient.client, "browser_[REF(src)]", FALSE)
|
||||
winset(hclient.client, "browser_[REF(src)]", "parent=none")
|
||||
|
||||
if (hascall(src.ref, "hiOnHide"))
|
||||
call(src.ref, "hiOnHide")(hclient)
|
||||
@@ -344,7 +344,7 @@ GLOBAL_LIST_EMPTY(html_interfaces)
|
||||
|
||||
src.specificRenderTitle(hclient)
|
||||
|
||||
hclient.client << output(list2params(list(title)), "browser_\ref[src].browser:setTitle")
|
||||
hclient.client << output(list2params(list(title)), "browser_[REF(src)].browser:setTitle")
|
||||
|
||||
/datum/html_interface/proc/_renderLayout(datum/html_interface_client/hclient, ignore_loaded = FALSE)
|
||||
if (hclient && (ignore_loaded || hclient.is_loaded))
|
||||
@@ -354,7 +354,7 @@ GLOBAL_LIST_EMPTY(html_interfaces)
|
||||
if (html != hclient.layout)
|
||||
hclient.layout = html
|
||||
|
||||
hclient.client << output(list2params(list(html)), "browser_\ref[src].browser:updateLayout")
|
||||
hclient.client << output(list2params(list(html)), "browser_[REF(src)].browser:updateLayout")
|
||||
|
||||
for (var/id in src.content_elements)
|
||||
src._renderContent(id, hclient, ignore_loaded = ignore_loaded)
|
||||
@@ -367,7 +367,7 @@ GLOBAL_LIST_EMPTY(html_interfaces)
|
||||
if (ignore_cache || !(id in hclient.content_elements) || html != hclient.content_elements[id])
|
||||
hclient.content_elements[id] = html
|
||||
|
||||
hclient.client << output(list2params(list(id, html)), "browser_\ref[src].browser:updateContent")
|
||||
hclient.client << output(list2params(list(id, html)), "browser_[REF(src)].browser:updateContent")
|
||||
|
||||
/datum/html_interface/Topic(href, href_list[])
|
||||
var/datum/html_interface_client/hclient = getClient(usr.client)
|
||||
|
||||
@@ -27,7 +27,7 @@ The client is optional and may be a /mob, /client or /html_interface_client obje
|
||||
|
||||
/datum/html_interface/specificRenderTitle(datum/html_interface_client/hclient, ignore_cache = FALSE)
|
||||
// Update the title in our custom header (in addition to default functionality)
|
||||
winset(hclient.client, "browser_\ref[src].uiTitle", list2params(list("text" = "[src.title]")))
|
||||
winset(hclient.client, "browser_[REF(src)].uiTitle", list2params(list("text" = "[src.title]")))
|
||||
|
||||
/datum/html_interface/nanotrasen/registerResources(var/list/resources = list())
|
||||
resources["uiBg.png"] = 'uiBg.png'
|
||||
@@ -39,19 +39,19 @@ The client is optional and may be a /mob, /client or /html_interface_client obje
|
||||
. = ..() // we want the default window
|
||||
|
||||
// Remove the titlebar
|
||||
winset(hclient.client, "browser_\ref[src]", list2params(list(
|
||||
winset(hclient.client, "browser_[REF(src)]", list2params(list(
|
||||
"titlebar" = "false"
|
||||
)))
|
||||
|
||||
// Reposition the browser
|
||||
winset(hclient.client, "browser_\ref[src].browser", list2params(list(
|
||||
winset(hclient.client, "browser_[REF(src)].browser", list2params(list(
|
||||
"pos" = "0,35",
|
||||
"size" = "[width]x[height - 35]"
|
||||
)))
|
||||
|
||||
// Add top background image
|
||||
winset(hclient.client, "browser_\ref[src].topbg", list2params(list(
|
||||
"parent" = "browser_\ref[src]",
|
||||
winset(hclient.client, "browser_[REF(src)].topbg", list2params(list(
|
||||
"parent" = "browser_[REF(src)]",
|
||||
"type" = "label",
|
||||
"pos" = "0,0",
|
||||
"size" = "[width]x35",
|
||||
@@ -63,8 +63,8 @@ The client is optional and may be a /mob, /client or /html_interface_client obje
|
||||
)))
|
||||
|
||||
// Add Nanotrasen logo
|
||||
winset(hclient.client, "browser_\ref[src].uiTitleFluff", list2params(list(
|
||||
"parent" = "browser_\ref[src]",
|
||||
winset(hclient.client, "browser_[REF(src)].uiTitleFluff", list2params(list(
|
||||
"parent" = "browser_[REF(src)]",
|
||||
"type" = "label",
|
||||
"pos" = "[width - 42 - 4 - 24 - 4 - 24 - 4],5",
|
||||
"size" = "42x24",
|
||||
@@ -76,8 +76,8 @@ The client is optional and may be a /mob, /client or /html_interface_client obje
|
||||
)))
|
||||
|
||||
// Add Eye picture
|
||||
winset(hclient.client, "browser_\ref[src].uiTitleEye", list2params(list(
|
||||
"parent" = "browser_\ref[src]",
|
||||
winset(hclient.client, "browser_[REF(src)].uiTitleEye", list2params(list(
|
||||
"parent" = "browser_[REF(src)]",
|
||||
"type" = "label",
|
||||
"pos" = "8,5",
|
||||
"size" = "42x24",
|
||||
@@ -89,8 +89,8 @@ The client is optional and may be a /mob, /client or /html_interface_client obje
|
||||
)))
|
||||
|
||||
// Add title text
|
||||
winset(hclient.client, "browser_\ref[src].uiTitle", list2params(list(
|
||||
"parent" = "browser_\ref[src]",
|
||||
winset(hclient.client, "browser_[REF(src)].uiTitle", list2params(list(
|
||||
"parent" = "browser_[REF(src)]",
|
||||
"type" = "label",
|
||||
"is-transparent" = "true",
|
||||
"pos" = "64,0",
|
||||
@@ -107,8 +107,8 @@ The client is optional and may be a /mob, /client or /html_interface_client obje
|
||||
|
||||
// Add minimize button
|
||||
// TODO: Style the button (add image)
|
||||
winset(hclient.client, "browser_\ref[src].uiTitleMinimize", list2params(list(
|
||||
"parent" = "browser_\ref[src]",
|
||||
winset(hclient.client, "browser_[REF(src)].uiTitleMinimize", list2params(list(
|
||||
"parent" = "browser_[REF(src)]",
|
||||
"type" = "button",
|
||||
"is-flat" = "true",
|
||||
"background-color"="#383838", // should be unnecessary if image is used
|
||||
@@ -123,18 +123,18 @@ The client is optional and may be a /mob, /client or /html_interface_client obje
|
||||
"font-size" = "12", // ~ 16px - should be unnecessary if image is used
|
||||
|
||||
// Disable resizing (disables maximizing), minimize window, bind window.on-size to catch 'restore window' button to enable resizing if restored.
|
||||
"command" = ".winset \"browser_\ref[src].can-resize=false;browser_\ref[src].is-minimized=true;browser_\ref[src].on-size=\".swinset \\\"browser_\ref[src].can-resize=true;browser_\ref[src].on-size=\\\"\"\""
|
||||
"command" = ".winset \"browser_[REF(src)].can-resize=false;browser_[REF(src)].is-minimized=true;browser_[REF(src)].on-size=\".swinset \\\"browser_[REF(src)].can-resize=true;browser_[REF(src)].on-size=\\\"\"\""
|
||||
)))
|
||||
|
||||
// Add close button
|
||||
// TODO: Style the button (add image)
|
||||
winset(hclient.client, "browser_\ref[src].uiTitleClose", list2params(list(
|
||||
"parent" = "browser_\ref[src]",
|
||||
winset(hclient.client, "browser_[REF(src)].uiTitleClose", list2params(list(
|
||||
"parent" = "browser_[REF(src)]",
|
||||
"type" = "button",
|
||||
"is-flat" = "true",
|
||||
"background-color"="#383838", // should be unnecessary if image is used
|
||||
"text-color" = "#FFFFFF", // should be unnecessary if image is used
|
||||
"command" = "byond://?src=\ref[src];html_interface_action=onclose",
|
||||
"command" = "byond://?src=[REF(src)];html_interface_action=onclose",
|
||||
"is-transparent" = "true",
|
||||
"pos" = "[width - 24 - 4],5",
|
||||
"size" = "24x24",
|
||||
@@ -173,6 +173,6 @@ The client is optional and may be a /mob, /client or /html_interface_client obje
|
||||
if (hclient.getExtraVar("eye_color") != color)
|
||||
hclient.putExtraVar("eye_color", color)
|
||||
|
||||
winset(hclient.client, "browser_\ref[src].uiTitleEye", list2params(list("image" = "[resource]")))
|
||||
winset(hclient.client, "browser_[REF(src)].uiTitleEye", list2params(list("image" = "[resource]")))
|
||||
else
|
||||
WARNING("Invalid object passed to /datum/html_interface/nanotrasen/proc/setEyeColor")
|
||||
Reference in New Issue
Block a user