1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Inventory mouse shortcut improvements (#13146)

Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
This commit is contained in:
OgelGames 2023-06-05 20:00:32 +10:00 committed by GitHub
parent 23f7aab354
commit 252c79d53a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 520 additions and 168 deletions

View file

@ -64,6 +64,19 @@ enum FormspecQuitMode {
quit_mode_cancel
};
enum ButtonEventType : u8
{
BET_LEFT,
BET_RIGHT,
BET_MIDDLE,
BET_WHEEL_UP,
BET_WHEEL_DOWN,
BET_UP,
BET_DOWN,
BET_MOVE,
BET_OTHER
};
struct TextDest
{
virtual ~TextDest() = default;
@ -258,6 +271,8 @@ public:
void updateSelectedItem();
ItemStack verifySelectedItem();
s16 getNextInventoryRing(const InventoryLocation &inventoryloc, const std::string &listname);
void acceptInput(FormspecQuitMode quitmode=quit_mode_no);
bool preprocessEvent(const SEvent& event);
bool OnEvent(const SEvent& event);
@ -332,6 +347,13 @@ protected:
u16 m_selected_amount = 0;
bool m_selected_dragging = false;
ItemStack m_selected_swap;
ButtonEventType m_held_mouse_button = BET_OTHER;
bool m_shift_move_after_craft = false;
u16 m_left_drag_amount = 0;
ItemStack m_left_drag_stack;
std::vector<std::pair<GUIInventoryList::ItemSpec, ItemStack>> m_left_drag_stacks;
bool m_left_dragging = false;
gui::IGUIStaticText *m_tooltip_element = nullptr;
@ -340,8 +362,6 @@ protected:
u64 m_hovered_time = 0;
s32 m_old_tooltip_id = -1;
bool m_auto_place = false;
bool m_allowclose = true;
bool m_lock = false;
v2u32 m_lockscreensize;