diff --git a/code/game/machinery/computer/orders/order_computer/order_computer.dm b/code/game/machinery/computer/orders/order_computer/order_computer.dm index 9098d5aeb09..8ad5d5dde28 100644 --- a/code/game/machinery/computer/orders/order_computer/order_computer.dm +++ b/code/game/machinery/computer/orders/order_computer/order_computer.dm @@ -120,7 +120,8 @@ GLOBAL_LIST_EMPTY(order_console_products) "cat" = item.category_index, "ref" = REF(item), "cost" = round(item.cost_per_order * cargo_cost_multiplier), - "product_icon" = icon2base64(getFlatIcon(image(icon = initial(item.item_path.icon), icon_state = initial(item.item_path.icon_state)), no_anim=TRUE)) + "icon" = item.item_path::icon, + "icon_state" = item.item_path::icon_state, )) return data diff --git a/code/game/objects/structures/ore_containers.dm b/code/game/objects/structures/ore_containers.dm index 6bc6f680116..75c7a03cfcf 100644 --- a/code/game/objects/structures/ore_containers.dm +++ b/code/game/objects/structures/ore_containers.dm @@ -23,25 +23,16 @@ ui.open() /obj/structure/ore_container/ui_data(mob/user) - var/list/data = list() - data["ores"] = list() + var/list/ores = list() for(var/obj/item/stack/ore/ore_item in contents) - data["ores"] += list(list( + ores += list(list( "id" = REF(ore_item), "name" = ore_item.name, "amount" = ore_item.amount, + "icon" = ore_item::icon, + "icon_state" = ore_item::icon_state, )) - return data - -/obj/structure/ore_container/ui_static_data(mob/user) - var/list/data = list() - data["ore_images"] = list() - for(var/obj/item/stack/ore_item as anything in subtypesof(/obj/item/stack/ore)) - data["ore_images"] += list(list( - "name" = initial(ore_item.name), - "icon" = icon2base64(getFlatIcon(image(icon = initial(ore_item.icon), icon_state = initial(ore_item.icon_state)), no_anim=TRUE)) - )) - return data + return list("ores" = ores) /obj/structure/ore_container/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 312acb66720..24e0f53a87a 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -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(.) diff --git a/tgui/packages/tgui/interfaces/OreContainer.tsx b/tgui/packages/tgui/interfaces/OreContainer.tsx index 261523c6e95..daae93a8edf 100644 --- a/tgui/packages/tgui/interfaces/OreContainer.tsx +++ b/tgui/packages/tgui/interfaces/OreContainer.tsx @@ -2,23 +2,27 @@ import { createSearch, toTitleCase } from 'common/string'; import { useState } from 'react'; import { useBackend } from '../backend'; -import { Button, Flex, Image, Input, Section, Stack } from '../components'; +import { + Button, + DmIcon, + Flex, + Icon, + Input, + Section, + Stack, +} from '../components'; import { Window } from '../layouts'; type Ores = { id: string; name: string; amount: number; -}; - -type Ore_images = { - name: string; icon: string; + icon_state: string; }; type Data = { ores: Ores[]; - ore_images: Ore_images[]; }; export const OreContainer = (props) => { @@ -58,7 +62,13 @@ export const OreContainer = (props) => { - + } + /> @@ -87,30 +97,6 @@ export const OreContainer = (props) => { ); }; -const RetrieveIcon = (props) => { - const { data } = useBackend(); - const { ore_images = [] } = data; - const { ore } = props; - - let icon_display = ore_images.find((icon) => icon.name === ore.name); - - if (!icon_display) { - return null; - } - - return ( - - ); -}; - const Orename = (props) => { const { ore_name } = props; const return_name = ore_name.split(' '); diff --git a/tgui/packages/tgui/interfaces/OreRedemptionMachine.jsx b/tgui/packages/tgui/interfaces/OreRedemptionMachine.jsx index 3bb87d7dce2..b9088f32e0d 100644 --- a/tgui/packages/tgui/interfaces/OreRedemptionMachine.jsx +++ b/tgui/packages/tgui/interfaces/OreRedemptionMachine.jsx @@ -6,8 +6,8 @@ import { BlockQuote, Box, Button, + DmIcon, Icon, - Image, Input, LabeledList, Section, @@ -175,14 +175,7 @@ export const OreRedemptionMachine = (props) => { }; const MaterialRow = (props) => { - const { data } = useBackend(); - const { compact } = props; - const { material_icons } = data; - const { material, onRelease } = props; - - const display = material_icons.find( - (mat_icon) => mat_icon.id === material.id, - ); + const { compact, material, onRelease } = props; const sheet_amounts = Math.floor(material.amount); const print_amount = 5; @@ -192,14 +185,12 @@ const MaterialRow = (props) => { {!compact && ( - } /> )} diff --git a/tgui/packages/tgui/interfaces/ProduceConsole.tsx b/tgui/packages/tgui/interfaces/ProduceConsole.tsx index 686b194abea..b13fda8af07 100644 --- a/tgui/packages/tgui/interfaces/ProduceConsole.tsx +++ b/tgui/packages/tgui/interfaces/ProduceConsole.tsx @@ -8,8 +8,8 @@ import { Button, Dimmer, Divider, + DmIcon, Icon, - Image, Input, NumberInput, Section, @@ -26,7 +26,8 @@ type OrderDatum = { cat: string; ref: string; cost: number; - product_icon: string; + icon: string; + icon_state: string; }; type Item = { @@ -127,13 +128,13 @@ const ShoppingTab = (props) => { />{' '} {!condensed && ( - } /> )}