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 @@ -30,6 +30,7 @@
import com.cleanroommc.modularui.widgets.ListWidget;
import com.cleanroommc.modularui.widgets.PagedWidget;
import com.cleanroommc.modularui.widgets.SlotGroupWidget;
import com.cleanroommc.modularui.widgets.TextWidget;
import com.cleanroommc.modularui.widgets.ToggleButton;
import com.cleanroommc.modularui.widgets.layout.Column;
import com.cleanroommc.modularui.widgets.layout.Flow;
Expand Down Expand Up @@ -500,6 +501,13 @@ private IWidget createTradeUI(TradeMainPanel rootPanel, PagedWidget.Controller t
.collapseDisabledChild(true);

tradeList.child(new Row().height(2));

// Incomplete Structure status message
Flow statusRow = new Row().height(10).width(TRADE_ROW_WIDTH).marginLeft(2)
.child(new TextWidget(IKey.lang("vendingmachine.gui.error.incomplete_structure")))
.setEnabledIf(slot -> !this.getBase().getActive());
tradeList.child(statusRow);

// Higher first row top margin
Flow row = new TradeRow().height(TILE_ITEM_HEIGHT +2).width(TRADE_ROW_WIDTH).marginLeft(2);

Expand All @@ -518,6 +526,9 @@ private IWidget createTradeUI(TradeMainPanel rootPanel, PagedWidget.Controller t
})
.tooltipAutoUpdate(true)
.setEnabledIf(slot -> {
if (!this.getBase().getActive()) {
return false;
}
TradeItemDisplayWidget display = ((TradeItemDisplayWidget) slot);
return VMConfig.gui.display_type == display.displayType && display.getDisplay() != null;
})
Expand Down Expand Up @@ -548,6 +559,9 @@ private IWidget createTradeUI(TradeMainPanel rootPanel, PagedWidget.Controller t
})
.tooltipAutoUpdate(true)
.setEnabledIf(slot -> {
if (!this.getBase().getActive()) {
return false;
}
TradeItemDisplayWidget display = ((TradeItemDisplayWidget) slot);
return VMConfig.gui.display_type == display.displayType && display.getDisplay() != null;
}));
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/vendingmachine/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ vendingmachine.gui.cooldown_display.minute=m
vendingmachine.gui.cooldown_display.hour=h
vendingmachine.gui.cooldown_display.day=d

vendingmachine.gui.error.incomplete_structure=Incomplete Structure.
vendingmachine.gui.error.player_using=Someone is using the vending machine at the moment.
vendingmachine.chat.trade_restock=Vending Machine Restocked: %s

Expand Down