mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-07-18 10:32:32 +01:00
Merge pull request #8035 from PsiOmegaDelta/CanHasNano
NanoUI/Topic make-over
This commit is contained in:
@@ -108,6 +108,9 @@ datum/nano_item_lists
|
||||
return pick(random_items)
|
||||
|
||||
/obj/item/device/uplink/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["buy_item"] == "random")
|
||||
var/datum/uplink_item/UI = chooseRandomItem()
|
||||
href_list["buy_item"] = UI.reference
|
||||
@@ -208,10 +211,10 @@ datum/nano_item_lists
|
||||
// The purchasing code.
|
||||
/obj/item/device/uplink/hidden/Topic(href, href_list)
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
return 1
|
||||
|
||||
if (!( istype(usr, /mob/living/carbon/human)))
|
||||
return 0
|
||||
return 1
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
if ((usr.contents.Find(src.loc) || (in_range(src.loc, usr) && istype(src.loc.loc, /turf))))
|
||||
|
||||
@@ -16,11 +16,14 @@
|
||||
var/damtype = "brute"
|
||||
var/force = 0
|
||||
|
||||
/obj/Topic(href, href_list, var/nowindow = 0)
|
||||
/obj/Topic(href, href_list, var/nowindow = 0, var/checkrange = 1)
|
||||
// Calling Topic without a corresponding window open causes runtime errors
|
||||
if(nowindow)
|
||||
return 0
|
||||
return ..()
|
||||
if(!nowindow && ..())
|
||||
return 1
|
||||
if(usr.can_interact_with_interface(src, checkrange) != STATUS_INTERACTIVE)
|
||||
return 1
|
||||
add_fingerprint(usr)
|
||||
return 0
|
||||
|
||||
/obj/item/proc/is_used_on(obj/O, mob/user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user