Skip to content

Commit

Permalink
Fix autolathe material icon (#1634)
Browse files Browse the repository at this point in the history
## Что этот PR делает
Фикс высоты оставшихся материалов и их иконок

## Почему это хорошо для игры
Хз

## Изображения изменений

![image](https://github.com/user-attachments/assets/d58cd628-fbf6-4991-b851-d0c1d369c870)

## Changelog

:cl:
fix: Оставшиеся ресурсы в автолате теперь имеют нормальную иконку, а не
4 сразу на всё ебало
/:cl:
  • Loading branch information
AyIong authored Nov 3, 2024
1 parent 8018a54 commit dff6b90
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 70 deletions.
5 changes: 0 additions & 5 deletions modular_ss220/autolathe_tgui/code/autolathe_ui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@
ui = new(user, src, "Autolathe220", name)
ui.set_autoupdate(FALSE)
ui.open()

/obj/machinery/autolathe/ui_assets(mob/user)
return list(
get_asset_datum(/datum/asset/spritesheet/materials)
)
7 changes: 5 additions & 2 deletions tgui/packages/tgui/interfaces/Autolathe220.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Requirement = {
glass: number;
};

const icon = 'icons/obj/stacks/minerals.dmi'; // Clueless
const materials = ['metal', 'glass'];

const canBeMade = (recipe, mavail, gavail, multi) => {
Expand Down Expand Up @@ -149,7 +150,7 @@ const Recipes = (props, context) => {
{materials.map(
(material) =>
recipe.requirements[material] && (
<ImageButton key={material} asset={['materials32x32', material]} imageSize={32}>
<ImageButton key={material} dmIcon={icon} dmIconState={`sheet-${material}`} imageSize={32}>
{roundMaterials(recipe.requirements[material], multiplier)}
</ImageButton>
)
Expand Down Expand Up @@ -209,7 +210,9 @@ const Materials = (props, context) => {
const MaterialButton = (material, amount) => (
<ImageButton
fluid
asset={['materials32x32', material]}
imageSize={32}
dmIcon={icon}
dmIconState={`sheet-${material}`} // Clueless x2
color="nope" // Not existed color, special for full transparent and borderless
buttons={
<Box backgroundColor="rgba(255, 255, 255, 0.05)" width="45px">
Expand Down
126 changes: 63 additions & 63 deletions tgui/public/tgui.bundle.js

Large diffs are not rendered by default.

0 comments on commit dff6b90

Please sign in to comment.