1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Selected ItemStack: Reduce black magic (#6520)

* Selected ItemStack: Reduce black magic
Better button variable value naming
This commit is contained in:
SmallJoker 2018-04-03 11:15:58 +02:00 committed by GitHub
parent 528908a4c3
commit baca933b6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 144 additions and 191 deletions

View file

@ -348,7 +348,7 @@ public:
void regenerateGui(v2u32 screensize);
ItemSpec getItemAtPos(v2s32 p) const;
void drawList(const ListDrawSpec &s, int phase, bool &item_hovered);
void drawList(const ListDrawSpec &s, int layer, bool &item_hovered);
void drawSelectedItem();
void drawMenu();
void updateSelectedItem();
@ -404,14 +404,9 @@ protected:
std::vector<std::pair<FieldSpec, std::vector<std::string> > > m_dropdowns;
ItemSpec *m_selected_item = nullptr;
u32 m_selected_amount = 0;
u16 m_selected_amount = 0;
bool m_selected_dragging = false;
// WARNING: BLACK MAGIC
// Used to guess and keep up with some special things the server can do.
// If name is "", no guess exists.
ItemStack m_selected_content_guess;
InventoryLocation m_selected_content_guess_inventory;
ItemStack m_selected_swap;
v2s32 m_pointer;
v2s32 m_old_pointer; // Mouse position after previous mouse event