Uplink item buy limit mechanism (#14999)

This commit is contained in:
DreamySkrell
2022-11-12 23:08:54 +01:00
committed by GitHub
parent 56515acc8b
commit ecb5a8e769
7 changed files with 49 additions and 6 deletions
+9 -3
View File
@@ -15,7 +15,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid
var/nanoui_menu = 0 // The current menu we are in
var/list/nanoui_data = new // Additional data for NanoUI use
var/list/purchase_log = new
var/list/purchase_log = new // Assoc list of item to times bought; shared/referenced by child uplinks
var/datum/mind/uplink_owner = null
var/used_TC = 0
@@ -159,8 +159,14 @@ A list of items and costs is stored under the datum of every game mode, alongsid
for(var/datum/uplink_item/item in category.items)
if(item.can_view(src))
var/cost = item.cost(uses)
if(!cost) cost = "???"
items[++items.len] = list("name" = item.name, "description" = replacetext(item.description(), "\n", "<br>"), "can_buy" = item.can_buy(src), "cost" = cost, "ref" = "\ref[item]")
items[++items.len] = list(
"name" = item.name,
"description" = replacetext(item.description(), "\n", "<br>"),
"can_buy" = item.can_buy(src),
"cost" = cost,
"left" = item.items_left(src),
"ref" = "\ref[item]"
)
nanoui_data["items"] = items
else if(nanoui_menu == 2)
var/permanentData[0]