Merge pull request #832 from Citadel-Station-13/upstream-merge-23201

[MIRROR] [READY]DATUM VERBS AND TOP MENUS!
This commit is contained in:
LetterJay
2017-05-10 23:05:37 -04:00
committed by GitHub
17 changed files with 590 additions and 256 deletions
+21
View File
@@ -359,6 +359,27 @@ GLOBAL_LIST(external_rsc_urls)
hook_vr("client_new",list(src))
var/list/topmenus = GLOB.menulist[/datum/menu]
for (var/thing in topmenus)
var/datum/menu/topmenu = thing
var/topmenuname = "[topmenu]"
if (topmenuname == "[topmenu.type]")
var/list/tree = splittext(topmenuname, "/")
topmenuname = tree[tree.len]
winset(src, "[topmenu.type]", "parent=menu;name=[url_encode(topmenuname)]")
var/list/entries = topmenu.Generate_list(src)
for (var/child in entries)
winset(src, "[url_encode(child)]", "[entries[child]]")
if (!ispath(child, /datum/menu))
var/atom/verb/verbpath = child
if (copytext(verbpath.name,1,2) != "@")
new child(src)
for (var/thing in prefs.menuoptions)
var/datum/menu/menuitem = GLOB.menulist[thing]
if (menuitem)
menuitem.Load_checked(src)
//////////////
//DISCONNECT//
//////////////