abstract class
Rosegold::Menu
- Rosegold::Menu
- Reference
- Object
Overview
Abstract base for all menu types (player inventory, chest, furnace, etc.) Replaces the previous InventoryOperations module + InventoryMenu/ContainerMenu split.
Direct Known Subclasses
Defined in:
rosegold/inventory/menu.crConstructors
Instance Method Summary
-
#[](index : Int32) : Rosegold::Slot
Slot access
- #[]=(index : Int32, slot : Rosegold::Slot)
- #allow_modification?(slot_index : Int32) : Bool
- #can_stack?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
- #check_and_fix_desync
- #close
- #container_slots : Array(Rosegold::WindowSlot)
- #content : Array(Rosegold::WindowSlot)
- #copy_slot(slot : Rosegold::Slot) : Rosegold::Slot
- #cursor : Rosegold::Slot
- #cursor=(cursor : Rosegold::Slot)
- #get_max_stack_size(item_slot : Rosegold::Slot) : Int32
- #get_slot_max_stack_size(slot_index : Int32, item_slot : Rosegold::Slot) : Int32
- #handle_close
- #hotbar : Array(Rosegold::WindowSlot)
- #hotbar_slot_index(hotbar_nr : Int32) : Int32
- #hotbar_slots : Array(Rosegold::Slot)
- #hotbar_window_slots : Array(Rosegold::WindowSlot)
- #id : UInt8
- #inventory : Array(Rosegold::WindowSlot)
- #inventory_slots : Array(Rosegold::WindowSlot)
- #main_hand : Rosegold::Slot
- #main_inventory_slots : Array(Rosegold::Slot)
- #may_pickup?(slot_index : Int32) : Bool
-
#may_place?(slot_index : Int32, item_slot : Rosegold::Slot) : Bool
Slot validation
- #menu_id : UInt8
- #move_item_stack_to(source_index : Int32, target_start : Int32, target_end : Int32, reverse : Bool = false) : Bool
-
#offhand_slot_index : Int32
Slot group accessors
- #perform_cursor_drop_operation(button : Int32)
- #perform_drop_operation(slot_index : Int32, button : Int32)
- #perform_hotbar_swap(slot_index : Int32, button : Int32)
- #perform_offhand_swap_operation(slot_index : Int32)
- #perform_regular_click(slot_index : Int32, button : Int32)
- #perform_shift_click(slot_index : Int32)
- #player_inventory_slots : Array(Rosegold::Slot)
-
#player_inventory_start : Int32
Player inventory start offset within this menu
- #player_window_slots : Array(Rosegold::WindowSlot)
-
#quick_move_stack(slot_index : Int32) : Rosegold::Slot
Shift-click routing (each menu subclass defines where items move)
- #safe_insert(target_slot_index : Int32, cursor_slot : Rosegold::Slot, amount : Int32)
- #safe_take(source_slot_index : Int32, amount : Int32)
- #same_item_same_components?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
- #send_click(slot_index : Int32, button : Int32, click_type)
- #send_click(slot_index : Int32, operation : ClickOperation)
- #slots : Array(Rosegold::WindowSlot)
- #slots=(new_slots : Array(Rosegold::WindowSlot))
- #slots_match?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
- #state_id : UInt32
- #state_id=(state_id : UInt32)
- #swap_hotbar(hotbar_nr, slot : Rosegold::WindowSlot)
- #swap_hotbar(hotbar_nr, slot_number)
- #to_s(io)
- #total_slots : Int32
- #update_all_slots(slots : Array(Rosegold::Slot), cursor : Rosegold::Slot, packet_state_id : UInt32)
- #update_slot(index : Int32, slot : Rosegold::Slot, packet_state_id : UInt32)
Constructor Detail
Instance Method Detail
Slot validation
def move_item_stack_to(source_index : Int32, target_start : Int32, target_end : Int32, reverse : Bool = false) : Bool
#
Player inventory start offset within this menu
Shift-click routing (each menu subclass defines where items move)
def update_all_slots(slots : Array(Rosegold::Slot), cursor : Rosegold::Slot, packet_state_id : UInt32)
#