mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Fix NanoUI runtimes when data is null; touch up code
This commit is contained in:
@@ -22,23 +22,23 @@
|
||||
/client/Topic(href, href_list, hsrc)
|
||||
if(!usr || usr != mob) //stops us calling Topic for somebody else's client. Also helps prevent usr=null
|
||||
return
|
||||
// NanoUI
|
||||
if(href_list["nano_error"])
|
||||
src << href_list["nano_error"]
|
||||
throw EXCEPTION("NanoUI: [href_list["nano_error"]]")
|
||||
// asset_cache
|
||||
if(href_list["asset_cache_confirm_arrival"])
|
||||
//src << "ASSET JOB [href_list["asset_cache_confirm_arrival"]] ARRIVED."
|
||||
var/job = text2num(href_list["asset_cache_confirm_arrival"])
|
||||
completed_asset_jobs += job
|
||||
return
|
||||
//Admin PM
|
||||
// Admin PM
|
||||
if(href_list["priv_msg"])
|
||||
if (href_list["ahelp_reply"])
|
||||
cmd_ahelp_reply(href_list["priv_msg"])
|
||||
return
|
||||
cmd_admin_pm(href_list["priv_msg"],null)
|
||||
return
|
||||
// NanoUI
|
||||
if(href_list["nano_error"])
|
||||
src << href_list["nano_error"]
|
||||
throw EXCEPTION("NanoUI: [href_list["nano_error"]]")
|
||||
|
||||
//Logs all hrefs
|
||||
if(config && config.log_hrefs && href_logfile)
|
||||
|
||||
@@ -226,12 +226,8 @@
|
||||
"title" = title,
|
||||
"status" = status,
|
||||
"layout" = layout,
|
||||
"window" = window_id,
|
||||
"ref" = "\ref[src]",
|
||||
"window" = list(
|
||||
"width" = width,
|
||||
"height" = height,
|
||||
"ref" = window_id
|
||||
),
|
||||
"user" = list(
|
||||
"name" = user.name,
|
||||
"fancy" = user.client.prefs.nanoui_fancy,
|
||||
@@ -269,8 +265,8 @@
|
||||
* private
|
||||
*
|
||||
* Handle clicks from the NanoUI.
|
||||
* Call the src_object's Topic() if status is NANO_INTERACTIVE.
|
||||
* If the src_object's Topic() returns 1, update all UIs attacked to it.
|
||||
* Call the src_object's ui_act() if status is NANO_INTERACTIVE.
|
||||
* If the src_object's ui_act() returns 1, update all UIs attacked to it.
|
||||
**/
|
||||
/datum/nanoui/Topic(href, href_list)
|
||||
update_status(push = 0) // Update the window state.
|
||||
@@ -280,10 +276,9 @@
|
||||
var/action = href_list["nano"] // Pull the action out.
|
||||
href_list -= "nano"
|
||||
|
||||
var/update = src_object.ui_act(action, href_list, state) // Call Topic() on the src_object.
|
||||
|
||||
var/update = src_object.ui_act(action, href_list, state) // Call ui_act() on the src_object.
|
||||
if(src_object && update)
|
||||
SSnano.update_uis(src_object) // If we have a src_object and its Topic() told us to update.
|
||||
SSnano.update_uis(src_object) // If we have a src_object and its ui_act() told us to update.
|
||||
|
||||
/**
|
||||
* private
|
||||
@@ -313,7 +308,7 @@
|
||||
**/
|
||||
/datum/nanoui/proc/push_data(data, force = 0)
|
||||
update_status(push = 0) // Update the window state.
|
||||
if(status == NANO_DISABLED && !force)
|
||||
if(status <= NANO_DISABLED && !force)
|
||||
return // Cannot update UI, we have no visibility.
|
||||
|
||||
var/list/send_data = get_send_data(data) // Get the data to send.
|
||||
|
||||
Reference in New Issue
Block a user