mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #8212 from PsiOmegaDelta/CleanTopic
Minor NanoUI/Topic cleanup
This commit is contained in:
@@ -16,14 +16,11 @@
|
|||||||
var/damtype = "brute"
|
var/damtype = "brute"
|
||||||
var/force = 0
|
var/force = 0
|
||||||
|
|
||||||
/obj/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/custom_state)
|
/obj/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/custom_state = default_state)
|
||||||
// Calling Topic without a corresponding window open causes runtime errors
|
// Calling Topic without a corresponding window open causes runtime errors
|
||||||
if(!nowindow && ..())
|
if(!nowindow && ..())
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if(!custom_state)
|
|
||||||
custom_state = default_state
|
|
||||||
|
|
||||||
// In the far future no checks are made in an overriding Topic() beyond if(..()) return
|
// In the far future no checks are made in an overriding Topic() beyond if(..()) return
|
||||||
// Instead any such checks are made in CanUseTopic()
|
// Instead any such checks are made in CanUseTopic()
|
||||||
var/obj/host = nano_host()
|
var/obj/host = nano_host()
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ nanoui is used to open and update nano browser uis
|
|||||||
*
|
*
|
||||||
* @return /nanoui new nanoui object
|
* @return /nanoui new nanoui object
|
||||||
*/
|
*/
|
||||||
/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate_filename, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, var/datum/nanoui/master_ui = null, var/datum/topic_state/custom_state = null)
|
/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate_filename, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, var/datum/nanoui/master_ui = null, var/datum/topic_state/custom_state = default_state)
|
||||||
user = nuser
|
user = nuser
|
||||||
src_object = nsrc_object
|
src_object = nsrc_object
|
||||||
ui_key = nui_key
|
ui_key = nui_key
|
||||||
@@ -82,7 +82,7 @@ nanoui is used to open and update nano browser uis
|
|||||||
src.master_ui = master_ui
|
src.master_ui = master_ui
|
||||||
if(master_ui)
|
if(master_ui)
|
||||||
master_ui.children += src
|
master_ui.children += src
|
||||||
src.custom_state = custom_state ? custom_state : new/datum/topic_state()
|
src.custom_state = custom_state
|
||||||
|
|
||||||
// add the passed template filename as the "main" template, this is required
|
// add the passed template filename as the "main" template, this is required
|
||||||
add_template("main", ntemplate_filename)
|
add_template("main", ntemplate_filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user