mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-16 18:01:40 +00:00
Add wear bar color API (#13328)
--------- Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com> Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com> Co-authored-by: grorp <gregor.parzefall@posteo.de>
This commit is contained in:
parent
e10d8080ba
commit
176e674a51
19 changed files with 598 additions and 26 deletions
|
@ -22,13 +22,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "metadata.h"
|
||||
#include "tool.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
class Inventory;
|
||||
class IItemDefManager;
|
||||
|
||||
class ItemStackMetadata : public SimpleMetadata
|
||||
{
|
||||
public:
|
||||
ItemStackMetadata() : toolcaps_overridden(false) {}
|
||||
ItemStackMetadata():
|
||||
toolcaps_overridden(false)
|
||||
{}
|
||||
|
||||
// Overrides
|
||||
void clear() override;
|
||||
|
@ -46,9 +50,20 @@ public:
|
|||
void setToolCapabilities(const ToolCapabilities &caps);
|
||||
void clearToolCapabilities();
|
||||
|
||||
const std::optional<WearBarParams> &getWearBarParamOverride() const
|
||||
{
|
||||
return wear_bar_override;
|
||||
}
|
||||
|
||||
|
||||
void setWearBarParams(const WearBarParams ¶ms);
|
||||
void clearWearBarParams();
|
||||
|
||||
private:
|
||||
void updateToolCapabilities();
|
||||
void updateWearBarParams();
|
||||
|
||||
bool toolcaps_overridden;
|
||||
ToolCapabilities toolcaps_override;
|
||||
std::optional<WearBarParams> wear_bar_override;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue