mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Refactors some more UIs to use DmIcon (#87886)
## About The Pull Request Upstream port of https://github.com/Monkestation/Monkestation2.0/pull/4215 This changes some tgui UIs that used icon2base64/getFlatIcon to display items to instead use DmIcon, just passing the icon/icon_state instead. To be specific: the ORM, the "ore container", and the order console (produce, mining, and bitrunning vendors) <details> <summary><h3>UI screenshots / proof of testing</h3></summary>      </details> ## Why It's Good For The Game gfi bad, especially in ui(_static)_data, dmicon good. ## Changelog 🆑 refactor: The ORM, "ore container", and order console UIs (produce, mining, bitrunner vendors) now load icons in a more efficient manner. /🆑
This commit is contained in:
@@ -229,21 +229,27 @@
|
||||
for(var/datum/material/material as anything in mat_container.materials)
|
||||
var/amount = mat_container.materials[material]
|
||||
var/sheet_amount = amount / SHEET_MATERIAL_AMOUNT
|
||||
var/obj/sheet_type = material.sheet_type
|
||||
data["materials"] += list(list(
|
||||
"name" = material.name,
|
||||
"id" = REF(material),
|
||||
"amount" = sheet_amount,
|
||||
"category" = "material",
|
||||
"value" = ore_values[material.type],
|
||||
"icon" = sheet_type::icon,
|
||||
"icon_state" = sheet_type::icon_state,
|
||||
))
|
||||
|
||||
for(var/research in stored_research.researched_designs)
|
||||
var/datum/design/alloy = SSresearch.techweb_design_by_id(research)
|
||||
var/obj/alloy_type = alloy.build_path
|
||||
data["materials"] += list(list(
|
||||
"name" = alloy.name,
|
||||
"id" = alloy.id,
|
||||
"category" = "alloy",
|
||||
"amount" = can_smelt_alloy(alloy),
|
||||
"icon" = alloy_type::icon,
|
||||
"icon_state" = alloy_type::icon_state,
|
||||
))
|
||||
|
||||
data["disconnected"] = null
|
||||
@@ -274,29 +280,6 @@
|
||||
)
|
||||
return data
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
var/datum/component/material_container/mat_container = materials.mat_container
|
||||
if (mat_container)
|
||||
for(var/datum/material/material as anything in mat_container.materials)
|
||||
var/obj/material_display = initial(material.sheet_type)
|
||||
data["material_icons"] += list(list(
|
||||
"id" = REF(material),
|
||||
"product_icon" = icon2base64(getFlatIcon(image(icon = initial(material_display.icon), icon_state = initial(material_display.icon_state)), no_anim=TRUE)),
|
||||
))
|
||||
|
||||
for(var/research in stored_research.researched_designs)
|
||||
var/datum/design/alloy = SSresearch.techweb_design_by_id(research)
|
||||
var/obj/alloy_display = initial(alloy.build_path)
|
||||
data["material_icons"] += list(list(
|
||||
"id" = alloy.id,
|
||||
"product_icon" = icon2base64(getFlatIcon(image(icon = initial(alloy_display.icon), icon_state = initial(alloy_display.icon_state)), no_anim=TRUE)),
|
||||
))
|
||||
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
Reference in New Issue
Block a user