UiDocument
This commit is contained in:
@@ -16,6 +16,7 @@ class Player;
|
||||
class ItemDef;
|
||||
struct block_funcs_set;
|
||||
struct item_funcs_set;
|
||||
struct uidocscript;
|
||||
class BlocksController;
|
||||
|
||||
namespace scripting {
|
||||
@@ -25,18 +26,35 @@ namespace scripting {
|
||||
extern Level* level;
|
||||
extern BlocksController* blocks;
|
||||
|
||||
class Environment {
|
||||
int env;
|
||||
public:
|
||||
Environment(int env);
|
||||
~Environment();
|
||||
|
||||
int getId() const;
|
||||
};
|
||||
|
||||
void initialize(Engine* engine);
|
||||
|
||||
runnable create_runnable(
|
||||
const std::string& filename,
|
||||
const std::string& source
|
||||
);
|
||||
|
||||
runnable create_runnable(
|
||||
const std::string& filename,
|
||||
const std::string& source,
|
||||
const Environment& env
|
||||
);
|
||||
|
||||
wstringconsumer create_wstring_consumer(
|
||||
const std::string& src,
|
||||
const std::string& file="<string>"
|
||||
);
|
||||
|
||||
std::unique_ptr<Environment> create_environment();
|
||||
|
||||
void on_world_load(Level* level, BlocksController* blocks);
|
||||
void on_world_save();
|
||||
void on_world_quit();
|
||||
@@ -48,8 +66,9 @@ namespace scripting {
|
||||
bool on_block_interact(Player* player, const Block* block, int x, int y, int z);
|
||||
bool on_item_use_on_block(Player* player, const ItemDef* item, int x, int y, int z);
|
||||
bool on_item_break_block(Player* player, const ItemDef* item, int x, int y, int z);
|
||||
void load_block_script(std::string prefix, fs::path file, block_funcs_set* funcsset);
|
||||
void load_item_script(std::string prefix, fs::path file, item_funcs_set* funcsset);
|
||||
void load_block_script(std::string prefix, fs::path file, block_funcs_set& funcsset);
|
||||
void load_item_script(std::string prefix, fs::path file, item_funcs_set& funcsset);
|
||||
void load_world_script(std::string prefix, fs::path file);
|
||||
void load_layout_script(fs::path file, uidocscript& script);
|
||||
void close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user