core:empty as default picking-item for hidden blocks
This commit is contained in:
parent
6447db583b
commit
69f4e165a4
@ -13,6 +13,7 @@
|
||||
#include "../files/files.h"
|
||||
#include "../coders/json.h"
|
||||
#include "../typedefs.h"
|
||||
#include "../core_defs.h"
|
||||
#include "../data/dynamic.h"
|
||||
|
||||
#include "ContentPack.h"
|
||||
@ -207,6 +208,10 @@ void ContentLoader::loadBlock(Block& def, std::string name, fs::path file) {
|
||||
root->str("script-name", def.scriptName);
|
||||
root->str("ui-layout", def.uiLayout);
|
||||
root->num("inventory-size", def.inventorySize);
|
||||
|
||||
if (def.hidden && def.pickingItem == def.name+BLOCK_ITEM_SUFFIX) {
|
||||
def.pickingItem = CORE_EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
void ContentLoader::loadCustomBlockModel(Block& def, dynamic::Map* primitives) {
|
||||
|
||||
@ -1,27 +1,30 @@
|
||||
#ifndef SRC_CORE_DEFS_H_
|
||||
#define SRC_CORE_DEFS_H_
|
||||
#ifndef CORE_DEFS_H_
|
||||
#define CORE_DEFS_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
const std::string TEXTURE_NOTFOUND = "notfound";
|
||||
inline const std::string CORE_EMPTY = "core:empty";
|
||||
inline const std::string CORE_AIR = "core:air";
|
||||
|
||||
inline const std::string TEXTURE_NOTFOUND = "notfound";
|
||||
|
||||
/* bindings used in engine code */
|
||||
const std::string BIND_MOVE_FORWARD = "movement.forward";
|
||||
const std::string BIND_MOVE_BACK = "movement.back";
|
||||
const std::string BIND_MOVE_LEFT = "movement.left";
|
||||
const std::string BIND_MOVE_RIGHT = "movement.right";
|
||||
const std::string BIND_MOVE_JUMP = "movement.jump";
|
||||
const std::string BIND_MOVE_SPRINT = "movement.sprint";
|
||||
const std::string BIND_MOVE_CROUCH = "movement.crouch";
|
||||
const std::string BIND_MOVE_CHEAT = "movement.cheat";
|
||||
const std::string BIND_CAM_ZOOM = "camera.zoom";
|
||||
const std::string BIND_CAM_MODE = "camera.mode";
|
||||
const std::string BIND_PLAYER_NOCLIP = "player.noclip";
|
||||
const std::string BIND_PLAYER_FLIGHT = "player.flight";
|
||||
const std::string BIND_PLAYER_ATTACK = "player.attack";
|
||||
const std::string BIND_PLAYER_BUILD = "player.build";
|
||||
const std::string BIND_PLAYER_PICK = "player.pick";
|
||||
const std::string BIND_HUD_INVENTORY = "hud.inventory";
|
||||
inline const std::string BIND_MOVE_FORWARD = "movement.forward";
|
||||
inline const std::string BIND_MOVE_BACK = "movement.back";
|
||||
inline const std::string BIND_MOVE_LEFT = "movement.left";
|
||||
inline const std::string BIND_MOVE_RIGHT = "movement.right";
|
||||
inline const std::string BIND_MOVE_JUMP = "movement.jump";
|
||||
inline const std::string BIND_MOVE_SPRINT = "movement.sprint";
|
||||
inline const std::string BIND_MOVE_CROUCH = "movement.crouch";
|
||||
inline const std::string BIND_MOVE_CHEAT = "movement.cheat";
|
||||
inline const std::string BIND_CAM_ZOOM = "camera.zoom";
|
||||
inline const std::string BIND_CAM_MODE = "camera.mode";
|
||||
inline const std::string BIND_PLAYER_NOCLIP = "player.noclip";
|
||||
inline const std::string BIND_PLAYER_FLIGHT = "player.flight";
|
||||
inline const std::string BIND_PLAYER_ATTACK = "player.attack";
|
||||
inline const std::string BIND_PLAYER_BUILD = "player.build";
|
||||
inline const std::string BIND_PLAYER_PICK = "player.pick";
|
||||
inline const std::string BIND_HUD_INVENTORY = "hud.inventory";
|
||||
|
||||
class ContentBuilder;
|
||||
|
||||
@ -30,4 +33,4 @@ namespace corecontent {
|
||||
extern void setup(ContentBuilder* builder);
|
||||
}
|
||||
|
||||
#endif // SRC_CORE_DEFS_H_
|
||||
#endif // CORE_DEFS_H_
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user