Files
Bubberstation/code/modules/asset_cache/assets/uplink.dm
T
AndrewandGitHub a32c65a263 New Uplink UI (#85455)
## About The Pull Request

Changes the layout of uplinks, mostly on the Market tab.

Made it more compact.

Before:


![image](https://github.com/user-attachments/assets/74449e97-ea68-4ae6-b8b9-661a9b40fdad)

After:


![image](https://github.com/user-attachments/assets/0babcafb-804f-449e-9777-5ec9ec615bbe)

<img width="100%" alt="ARnnJe7Oui"
src="https://github.com/user-attachments/assets/fdc846cd-9df8-4009-af3c-4129c161e1cb">

<img width="100%" alt="qKq0kM7YxV"
src="https://github.com/user-attachments/assets/e377a36f-4420-44cd-bb8f-34e16cfd804f">

## Why It's Good For The Game

Better UX

## Changelog

🆑
qol: new uplink UI
qol: made it possible to buy a custom amount of TC, instead of bundles
with fixed amounts
/🆑
2024-08-01 14:45:01 +00:00

48 lines
1.6 KiB
Plaintext

/// Sends information needed for uplinks
/datum/asset/json/uplink
name = "uplink"
early = TRUE
/datum/asset/json/uplink/generate()
var/list/data = list()
var/list/categories = list()
var/list/items = list()
for(var/datum/uplink_category/category as anything in subtypesof(/datum/uplink_category))
categories += category
sortTim(categories, GLOBAL_PROC_REF(cmp_uplink_category_desc))
var/list/new_categories = list()
for(var/datum/uplink_category/category as anything in categories)
new_categories += initial(category.name)
categories = new_categories
for(var/datum/uplink_item/item_path as anything in subtypesof(/datum/uplink_item))
var/datum/uplink_item/item = new item_path()
var/atom/actual_item = item.item
if(item.item) {
items += list(list(
"id" = item_path,
"name" = item.name,
"icon" = actual_item.icon,
"icon_state" = actual_item.icon_state,
"cost" = item.cost,
"desc" = item.desc,
"category" = item.category ? initial(item.category.name) : null,
"purchasable_from" = item.purchasable_from,
"restricted" = item.restricted,
"limited_stock" = item.limited_stock,
"stock_key" = item.stock_key,
"restricted_roles" = item.restricted_roles,
"restricted_species" = item.restricted_species,
"progression_minimum" = item.progression_minimum,
"cost_override_string" = item.cost_override_string,
"lock_other_purchases" = item.lock_other_purchases
))
}
SStraitor.uplink_items += item
SStraitor.uplink_items_by_type[item_path] = item
data["items"] = items
data["categories"] = categories
return data