mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Add ability to override item images using meta (#12614)
This commit is contained in:
parent
8c2c7fadbf
commit
4158b72971
13 changed files with 200 additions and 151 deletions
|
@ -120,14 +120,16 @@ public:
|
|||
virtual bool isKnown(const std::string &name) const=0;
|
||||
#ifndef SERVER
|
||||
// Get item inventory texture
|
||||
virtual video::ITexture* getInventoryTexture(const std::string &name,
|
||||
Client *client) const=0;
|
||||
// Get item wield mesh
|
||||
virtual ItemMesh* getWieldMesh(const std::string &name,
|
||||
Client *client) const=0;
|
||||
virtual video::ITexture* getInventoryTexture(const ItemStack &item, Client *client) const=0;
|
||||
|
||||
/**
|
||||
* Get wield mesh
|
||||
*
|
||||
* Returns nullptr if there is an inventory image
|
||||
*/
|
||||
virtual ItemMesh* getWieldMesh(const ItemStack &item, Client *client) const = 0;
|
||||
// Get item palette
|
||||
virtual Palette* getPalette(const std::string &name,
|
||||
Client *client) const = 0;
|
||||
virtual Palette* getPalette(const ItemStack &item, Client *client) const = 0;
|
||||
// Returns the base color of an item stack: the color of all
|
||||
// tiles that do not define their own color.
|
||||
virtual video::SColor getItemstackColor(const ItemStack &stack,
|
||||
|
@ -144,23 +146,6 @@ public:
|
|||
|
||||
virtual ~IWritableItemDefManager() = default;
|
||||
|
||||
// Get item definition
|
||||
virtual const ItemDefinition& get(const std::string &name) const=0;
|
||||
// Get alias definition
|
||||
virtual const std::string &getAlias(const std::string &name) const=0;
|
||||
// Get set of all defined item names and aliases
|
||||
virtual void getAll(std::set<std::string> &result) const=0;
|
||||
// Check if item is known
|
||||
virtual bool isKnown(const std::string &name) const=0;
|
||||
#ifndef SERVER
|
||||
// Get item inventory texture
|
||||
virtual video::ITexture* getInventoryTexture(const std::string &name,
|
||||
Client *client) const=0;
|
||||
// Get item wield mesh
|
||||
virtual ItemMesh* getWieldMesh(const std::string &name,
|
||||
Client *client) const=0;
|
||||
#endif
|
||||
|
||||
// Replace the textures of registered nodes with the ones specified in
|
||||
// the texture pack's override.txt files
|
||||
virtual void applyTextureOverrides(const std::vector<TextureOverride> &overrides)=0;
|
||||
|
@ -177,11 +162,7 @@ public:
|
|||
virtual void registerAlias(const std::string &name,
|
||||
const std::string &convert_to)=0;
|
||||
|
||||
virtual void serialize(std::ostream &os, u16 protocol_version)=0;
|
||||
virtual void deSerialize(std::istream &is, u16 protocol_version)=0;
|
||||
|
||||
// Do stuff asked by threads that can only be done in the main thread
|
||||
virtual void processQueue(IGameDef *gamedef)=0;
|
||||
};
|
||||
|
||||
IWritableItemDefManager* createItemDefManager();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue