Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,20 @@ public void draw(ModularGuiContext context, WidgetThemeEntry<?> widgetTheme) {
GuiDraw.drawText(" " + this.display.display.stackSize, 4, 9, 1.0f, textColor, false);
GuiDraw.drawItem(item, 26, 4, 16, 16, context.getCurrentDrawingZ());
if (this.display.tradeableNow) {
GuiTextures.OVERLAY_TRADEABLE.draw(
1,
1,
MTEVendingMachineGui.TILE_ITEM_WIDTH - 2,
MTEVendingMachineGui.TILE_ITEM_HEIGHT - 2);
GuiTextures.OVERLAY_TRADEABLE
.draw(0, 0, MTEVendingMachineGui.TILE_ITEM_WIDTH, MTEVendingMachineGui.TILE_ITEM_HEIGHT);
}
if (!this.checkVmActive() || this.display.hasCooldown || !this.display.enabled) {
GuiDraw.drawRoundedRect(
1,
1,
MTEVendingMachineGui.TILE_ITEM_WIDTH - 2,
MTEVendingMachineGui.TILE_ITEM_HEIGHT - 2,
GuiParams.trade_display_disabled_color.getColor(true),
GuiParams.trade_display_tile_disabled_corner_radius.getInt(),
GuiParams.trade_display_tile_disabled_corner_radius_segments.getInt());
GuiTextures.OVERLAY_COOLDOWN
.draw(0, 0, MTEVendingMachineGui.TILE_ITEM_WIDTH, MTEVendingMachineGui.TILE_ITEM_HEIGHT);
}
if (this.display.tgID.equals(this.rootPanel.currentSelected)) {
GuiTextures.OVERLAY_SELECTED.draw(
1,
1,
MTEVendingMachineGui.TILE_ITEM_WIDTH - 2,
MTEVendingMachineGui.TILE_ITEM_HEIGHT - 2);
GuiTextures.OVERLAY_SELECTED
.draw(0, 0, MTEVendingMachineGui.TILE_ITEM_WIDTH, MTEVendingMachineGui.TILE_ITEM_HEIGHT);
}
this.overlay(
IKey.str(display.hasCooldown ? this.display.cooldownText : "")
.style(IKey.WHITE));
.color(GuiParams.trade_display_text_color.getColor(false)));
if (this.display.isFavourite) {
GuiTextures.FAVOURITE_SPRITE.draw(context, 4, 4, 6, 6, widgetTheme.getTheme());
}
Expand All @@ -140,7 +128,7 @@ public void draw(ModularGuiContext context, WidgetThemeEntry<?> widgetTheme) {
1,
1,
3,
MTEVendingMachineGui.LIST_ITEM_HEIGHT - 3,
MTEVendingMachineGui.LIST_ITEM_HEIGHT - 2,
this.display.tradeableNow ? GuiParams.trade_display_list_tradable_now_color.getColor(true)
: GuiParams.trade_display_list_untradable_now_color.getColor(true));
if (!this.checkVmActive() || this.display.hasCooldown || !this.display.enabled) {
Expand All @@ -156,12 +144,12 @@ public void draw(ModularGuiContext context, WidgetThemeEntry<?> widgetTheme) {
1,
1,
2,
MTEVendingMachineGui.LIST_ITEM_HEIGHT - 3,
MTEVendingMachineGui.LIST_ITEM_HEIGHT - 2,
GuiParams.trade_display_list_current_selected_color.getColor(true));
}
this.overlay(
IKey.str(display.hasCooldown && this.display.enabled ? this.display.cooldownText : "")
.style(IKey.WHITE)
.color(GuiParams.trade_display_text_color.getColor(false))
.scale(0.9f));
if (this.display.isFavourite) {
GuiTextures.FAVOURITE_SPRITE.draw(context, 139, 2, 10, 10, widgetTheme.getTheme());
Expand Down
52 changes: 18 additions & 34 deletions src/main/java/com/cubefury/vendingmachine/gui/GuiTextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,9 @@

public final class GuiTextures {

public static final UITexture OVERLAY_TRADE_AVAILABLE_HIGHLIGHT = UITexture.builder()
.location(VendingMachine.MODID, "gui/overlay/trade_available")
.imageSize(47, 25)
.adaptable(6)
.name("trade_available_highlight")
.build();

public static final UITexture OVERLAY_TRADE_DISABLED = UITexture.builder()
.location(VendingMachine.MODID, "gui/overlay/trade_disabled")
.imageSize(47, 25)
.adaptable(4)
.canApplyTheme()
.name("trade_disabled")
.build();

public static final UITexture TRADE_AVAILABLE_BACKGROUND = UITexture.builder()
.location(VendingMachine.MODID, "gui/background/trade_available")
.imageSize(18, 18)
.canApplyTheme()
.name("trade_available_background")
.build();

public static final UITexture SIDE_PANEL_BACKGROUND = UITexture.builder()
.location(VendingMachine.MODID, "gui/background/panel_side")
.imageSize(195, 136)
.imageSize(50, 214)
.adaptable(4)
.canApplyTheme()
.name("panel_side_background")
Expand All @@ -48,55 +26,61 @@ public final class GuiTextures {
.name("text_field_background")
.build();

// TODO: Restore canApplyTheme to trade button textures after scrolling texture bug is fixed in MUI2
public static final UITexture TILE_TRADE_BUTTON_UNPRESSED = UITexture.builder()
.location(VendingMachine.MODID, "gui/background/trade_button_unpressed")
.canApplyTheme()
.imageSize(195, 136)
.imageSize(47, 25)
.adaptable(4)
.name("trade_button_unpressed")
.build();

public static final UITexture TILE_TRADE_BUTTON_PRESSED = UITexture.builder()
.location(VendingMachine.MODID, "gui/background/trade_button_pressed")
.canApplyTheme()
.imageSize(195, 136)
.imageSize(47, 25)
.adaptable(4)
.name("trade_button_pressed")
.build();

public static final UITexture LIST_TRADE_BUTTON_UNPRESSED = UITexture.builder()
.location(VendingMachine.MODID, "gui/background/list_trade_button_unpressed")
.canApplyTheme()
.imageSize(195, 136)
.adaptable(2)
.imageSize(154, 14)
.adaptable(4)
.name("list_trade_button_unpressed")
.build();

public static final UITexture LIST_TRADE_BUTTON_PRESSED = UITexture.builder()
.location(VendingMachine.MODID, "gui/background/list_trade_button_pressed")
.canApplyTheme()
.imageSize(195, 136)
.adaptable(2)
.imageSize(154, 14)
.name("list_trade_button_pressed")
.build();

public static final UITexture OVERLAY_TRADEABLE = UITexture.builder()
.location(VendingMachine.MODID, "gui/overlay/tile_tradeable")
.imageSize(20, 20)
.adaptable(2)
.imageSize(47, 25)
.adaptable(4)
.nonOpaque()
.name("overlay_tradeable")
.build();

public static final UITexture OVERLAY_SELECTED = UITexture.builder()
.location(VendingMachine.MODID, "gui/overlay/tile_selected")
.imageSize(20, 20)
.adaptable(2)
.imageSize(47, 25)
.adaptable(4)
.nonOpaque()
.name("overlay_selected")
.build();

public static final UITexture OVERLAY_COOLDOWN = UITexture.builder()
.location(VendingMachine.MODID, "gui/overlay/tile_cooldown")
.imageSize(47, 25)
.adaptable(4)
.nonOpaque()
.name("overlay_cooldown")
.build();

public static final UITexture MODE_TILE = UITexture.builder()
.location(VendingMachine.MODID, "gui/overlay/mode_tile")
.imageSize(32, 32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public enum GuiParams {
trade_display_list_tradable_now_color(0x883CFF00),
trade_display_list_untradable_now_color(0x88333333),
trade_display_list_current_selected_color(0xAA039BE5),
trade_display_tile_disabled_corner_radius(1),
trade_display_tile_disabled_corner_radius_segments(1),
trade_display_text_color(0xFFFFFF),

// new line to prevent merge conflicts
;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading