'ifnot' template property + hpp

This commit is contained in:
MihailRis 2024-05-06 00:45:43 +03:00
parent 8b1c102cfe
commit 9ea67deb13
59 changed files with 204 additions and 201 deletions

View File

@ -64,7 +64,6 @@ function check_dependencies(packinfo)
local depid = dep:sub(2,-1) local depid = dep:sub(2,-1)
if dep:sub(1,1) == '!' then if dep:sub(1,1) == '!' then
if not table.has(packs_all, depid) then if not table.has(packs_all, depid) then
packinfo.description = ""
return string.format( return string.format(
"%s (%s)", gui.str("error.dependency-not-found"), depid "%s (%s)", gui.str("error.dependency-not-found"), depid
) )

View File

@ -8,7 +8,7 @@
%{creator} %{creator}
</label> </label>
<label if='%{error}' pos='80,28' size='355,50' multiline='true' color='#FF4040'>%{error}</label> <label if='%{error}' pos='80,28' size='355,50' multiline='true' color='#FF4040'>%{error}</label>
<label pos='80,28' size='355,50' multiline='true' color='#FFFFFFB2'> <label ifnot='%{error}' pos='80,28' size='355,50' multiline='true' color='#FFFFFFB2'>
%{description} %{description}
</label> </label>
<image pos='8,8' src='%{icon}' size='64'/> <image pos='8,8' src='%{icon}' size='64'/>

View File

@ -1,11 +1,11 @@
#include "Assets.h" #include "Assets.h"
#include "../audio/audio.h" #include "../audio/audio.hpp"
#include "../graphics/core/Texture.hpp" #include "../graphics/core/Texture.hpp"
#include "../graphics/core/Shader.hpp" #include "../graphics/core/Shader.hpp"
#include "../graphics/core/Atlas.hpp" #include "../graphics/core/Atlas.hpp"
#include "../graphics/core/Font.hpp" #include "../graphics/core/Font.hpp"
#include "../frontend/UiDocument.h" #include "../frontend/UiDocument.hpp"
#include "../logic/scripting/scripting.h" #include "../logic/scripting/scripting.h"
Assets::~Assets() { Assets::~Assets() {

View File

@ -1,13 +1,8 @@
#include "AssetsLoader.h" #include "AssetsLoader.h"
#include "Assets.h" #include "Assets.h"
#include "assetload_funcs.hpp"
#include "assetload_funcs.h"
#include <iostream>
#include <memory>
#include "../util/ThreadPool.hpp" #include "../util/ThreadPool.hpp"
#include "../constants.h" #include "../constants.h"
#include "../data/dynamic.h" #include "../data/dynamic.h"
#include "../debug/Logger.hpp" #include "../debug/Logger.hpp"
@ -19,6 +14,9 @@
#include "../graphics/core/Texture.hpp" #include "../graphics/core/Texture.hpp"
#include "../logic/scripting/scripting.h" #include "../logic/scripting/scripting.h"
#include <iostream>
#include <memory>
static debug::Logger logger("assets-loader"); static debug::Logger logger("assets-loader");
AssetsLoader::AssetsLoader(Assets* assets, const ResPaths* paths) AssetsLoader::AssetsLoader(Assets* assets, const ResPaths* paths)

View File

@ -1,7 +1,8 @@
#include "assetload_funcs.h" #include "assetload_funcs.hpp"
#include "Assets.h" #include "Assets.h"
#include "AssetsLoader.h" #include "AssetsLoader.h"
#include "../audio/audio.h" #include "../audio/audio.hpp"
#include "../files/files.h" #include "../files/files.h"
#include "../files/engine_paths.h" #include "../files/engine_paths.h"
#include "../coders/imageio.hpp" #include "../coders/imageio.hpp"
@ -13,7 +14,7 @@
#include "../graphics/core/Atlas.hpp" #include "../graphics/core/Atlas.hpp"
#include "../graphics/core/Font.hpp" #include "../graphics/core/Font.hpp"
#include "../graphics/core/TextureAnimation.hpp" #include "../graphics/core/TextureAnimation.hpp"
#include "../frontend/UiDocument.h" #include "../frontend/UiDocument.hpp"
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>

View File

@ -1,5 +1,5 @@
#ifndef ASSETS_ASSET_LOADERS_H_ #ifndef ASSETS_ASSET_LOADERS_HPP_
#define ASSETS_ASSET_LOADERS_H_ #define ASSETS_ASSET_LOADERS_HPP_
#include "Assets.h" #include "Assets.h"
@ -59,4 +59,4 @@ namespace assetload {
); );
} }
#endif // ASSETS_ASSET_LOADERS_H_ #endif // ASSETS_ASSET_LOADERS_HPP_

View File

@ -1,10 +1,11 @@
#include "ALAudio.h" #include "ALAudio.hpp"
#include "alutil.h"
#include "alutil.hpp"
#include "../../debug/Logger.hpp"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include "../../debug/Logger.hpp"
static debug::Logger logger("al-audio"); static debug::Logger logger("al-audio");
using namespace audio; using namespace audio;

View File

@ -1,5 +1,8 @@
#ifndef SRC_AUDIO_AUDIO_H_ #ifndef SRC_AUDIO_AUDIO_HPP_
#define SRC_AUDIO_AUDIO_H_ #define SRC_AUDIO_AUDIO_HPP_
#include "../audio.hpp"
#include "../../typedefs.h"
#include <queue> #include <queue>
#include <vector> #include <vector>
@ -15,9 +18,6 @@
#include <AL/alc.h> #include <AL/alc.h>
#endif #endif
#include "../audio.h"
#include "../../typedefs.h"
namespace audio { namespace audio {
struct ALBuffer; struct ALBuffer;
class ALAudio; class ALAudio;
@ -168,4 +168,4 @@ namespace audio {
}; };
} }
#endif /* SRC_AUDIO_AUDIO_H_ */ #endif // SRC_AUDIO_AUDIO_HPP_

View File

@ -1,4 +1,4 @@
#include "alutil.h" #include "alutil.hpp"
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>

View File

@ -1,5 +1,7 @@
#ifndef SRC_AUDIO_AUDIOUTIL_H_ #ifndef AUDIO_AUDIOUTIL_HPP_
#define SRC_AUDIO_AUDIOUTIL_H_ #define AUDIO_AUDIOUTIL_HPP_
#include "../../typedefs.h"
#include <string> #include <string>
#include <type_traits> #include <type_traits>
@ -12,7 +14,6 @@
#endif #endif
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "../../typedefs.h"
#define AL_CHECK(STATEMENT) STATEMENT; AL::check_errors(__FILE__, __LINE__) #define AL_CHECK(STATEMENT) STATEMENT; AL::check_errors(__FILE__, __LINE__)
#define AL_GET_ERROR() AL::check_errors(__FILE__, __LINE__) #define AL_GET_ERROR() AL::check_errors(__FILE__, __LINE__)
@ -80,4 +81,4 @@ namespace AL {
} }
} }
#endif /* SRC_AUDIO_AUDIOUTIL_H_ */ #endif // AUDIO_AUDIOUTIL_HPP_

View File

@ -1,4 +1,4 @@
#include "NoAudio.h" #include "NoAudio.hpp"
using namespace audio; using namespace audio;

View File

@ -1,7 +1,7 @@
#ifndef AUDIO_NOAUDIO_H_ #ifndef AUDIO_NOAUDIO_HPP_
#define AUDIO_NOAUDIO_H_ #define AUDIO_NOAUDIO_HPP_
#include "audio.h" #include "audio.hpp"
namespace audio { namespace audio {
class NoSound : public Sound { class NoSound : public Sound {
@ -85,4 +85,4 @@ namespace audio {
}; };
} }
#endif // AUDIO_NOAUDIO_H_ #endif // AUDIO_NOAUDIO_HPP_

View File

@ -1,14 +1,14 @@
#include "audio.h" #include "audio.hpp"
#include "NoAudio.hpp"
#include "AL/ALAudio.hpp"
#include "../coders/wav.hpp"
#include "../coders/ogg.hpp"
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include "NoAudio.h"
#include "AL/ALAudio.h"
#include "../coders/wav.h"
#include "../coders/ogg.h"
namespace audio { namespace audio {
static speakerid_t nextId = 1; static speakerid_t nextId = 1;
static Backend* backend; static Backend* backend;

View File

@ -1,11 +1,12 @@
#ifndef AUDIO_AUDIO_H_ #ifndef AUDIO_AUDIO_HPP_
#define AUDIO_AUDIO_H_ #define AUDIO_AUDIO_HPP_
#include "../typedefs.h"
#include <vector> #include <vector>
#include <memory> #include <memory>
#include <filesystem> #include <filesystem>
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "../typedefs.h"
namespace fs = std::filesystem; namespace fs = std::filesystem;
@ -512,4 +513,4 @@ namespace audio {
void close(); void close();
}; };
#endif // AUDIO_AUDIO_H_ #endif // AUDIO_AUDIO_HPP_

View File

@ -1,12 +1,14 @@
#include "ogg.h" #include "ogg.hpp"
#include "../debug/Logger.hpp"
#include "../audio/audio.hpp"
#include "../typedefs.h"
#include <string> #include <string>
#include <iostream>
#include <vorbis/codec.h> #include <vorbis/codec.h>
#include <vorbis/vorbisfile.h> #include <vorbis/vorbisfile.h>
#include "../audio/audio.h" static debug::Logger logger("ogg");
#include "../typedefs.h"
using namespace audio; using namespace audio;
@ -56,7 +58,7 @@ audio::PCM* ogg::load_pcm(const std::filesystem::path& file, bool headerOnly) {
if (ret == 0) { if (ret == 0) {
eof = true; eof = true;
} else if (ret < 0) { } else if (ret < 0) {
std::cerr << "ogg::load_pcm: " << vorbis_error_message(ret) << std::endl; logger.error() << "ogg::load_pcm: " << vorbis_error_message(ret);
} else { } else {
data.insert(data.end(), std::begin(buffer), std::begin(buffer)+ret); data.insert(data.end(), std::begin(buffer), std::begin(buffer)+ret);
} }
@ -98,7 +100,7 @@ public:
int bitstream = 0; int bitstream = 0;
long bytes = ov_read(&vf, buffer, bufferSize, 0, 2, true, &bitstream); long bytes = ov_read(&vf, buffer, bufferSize, 0, 2, true, &bitstream);
if (bytes < 0) { if (bytes < 0) {
std::cerr << "ogg::load_pcm: " << vorbis_error_message(bytes) << " " << bytes << std::endl; logger.error() << "ogg::load_pcm: " << vorbis_error_message(bytes) << " " << bytes;
return PCMStream::ERROR; return PCMStream::ERROR;
} }
return bytes; return bytes;

View File

@ -1,5 +1,5 @@
#ifndef CODERS_OGG_H_ #ifndef CODERS_OGG_HPP_
#define CODERS_OGG_H_ #define CODERS_OGG_HPP_
#include <filesystem> #include <filesystem>
@ -13,4 +13,4 @@ namespace ogg {
extern audio::PCMStream* create_stream(const std::filesystem::path& file); extern audio::PCMStream* create_stream(const std::filesystem::path& file);
} }
#endif // CODERS_OGG_H_ #endif // CODERS_OGG_HPP_

View File

@ -1,4 +1,6 @@
#include "wav.h" #include "wav.hpp"
#include "../audio/audio.hpp"
#include <vector> #include <vector>
#include <string> #include <string>
@ -7,8 +9,6 @@
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include "../audio/audio.h"
bool is_big_endian() { bool is_big_endian() {
uint32_t ui32_v = 0x01020304; uint32_t ui32_v = 0x01020304;
char bytes[sizeof(uint32_t)]; char bytes[sizeof(uint32_t)];

View File

@ -1,5 +1,5 @@
#ifndef CODERS_WAV_H_ #ifndef CODERS_WAV_HPP_
#define CODERS_WAV_H_ #define CODERS_WAV_HPP_
#include <filesystem> #include <filesystem>
@ -13,4 +13,4 @@ namespace wav {
extern audio::PCMStream* create_stream(const std::filesystem::path& file); extern audio::PCMStream* create_stream(const std::filesystem::path& file);
} }
#endif // CODERS_WAV_H_ #endif // CODERS_WAV_HPP_

View File

@ -1,9 +1,10 @@
#include "xml.h" #include "xml.hpp"
#include "../util/stringutil.h"
#include <charconv> #include <charconv>
#include <stdexcept> #include <stdexcept>
#include <sstream> #include <sstream>
#include "../util/stringutil.h"
using namespace xml; using namespace xml;

View File

@ -1,5 +1,5 @@
#ifndef CODERS_XML_H_ #ifndef CODERS_XML_HPP_
#define CODERS_XML_H_ #define CODERS_XML_HPP_
#include <string> #include <string>
#include <memory> #include <memory>
@ -141,4 +141,4 @@ namespace xml {
extern xmldocument parse(std::string filename, std::string source); extern xmldocument parse(std::string filename, std::string source);
} }
#endif // CODERS_XML_H_ #endif // CODERS_XML_HPP_

View File

@ -4,7 +4,7 @@
#include "debug/Logger.hpp" #include "debug/Logger.hpp"
#include "assets/AssetsLoader.h" #include "assets/AssetsLoader.h"
#include "audio/audio.h" #include "audio/audio.hpp"
#include "coders/GLSLExtension.h" #include "coders/GLSLExtension.h"
#include "coders/imageio.hpp" #include "coders/imageio.hpp"
#include "coders/json.h" #include "coders/json.h"
@ -42,8 +42,6 @@
static debug::Logger logger("engine"); static debug::Logger logger("engine");
namespace fs = std::filesystem; namespace fs = std::filesystem;
void addWorldGenerators() { void addWorldGenerators() {
@ -64,7 +62,6 @@ Engine::Engine(EngineSettings& settings, SettingsHandler& settingsHandler, Engin
: settings(settings), settingsHandler(settingsHandler), paths(paths) : settings(settings), settingsHandler(settingsHandler), paths(paths)
{ {
corecontent::setup_bindings(); corecontent::setup_bindings();
loadSettings(); loadSettings();
controller = std::make_unique<EngineController>(this); controller = std::make_unique<EngineController>(this);

View File

@ -1,6 +1,4 @@
#include "ContentGfxCache.h" #include "ContentGfxCache.hpp"
#include <string>
#include "../assets/Assets.h" #include "../assets/Assets.h"
#include "../content/Content.h" #include "../content/Content.h"
@ -9,7 +7,9 @@
#include "../graphics/core/Atlas.hpp" #include "../graphics/core/Atlas.hpp"
#include "../maths/UVRegion.hpp" #include "../maths/UVRegion.hpp"
#include "../voxels/Block.h" #include "../voxels/Block.h"
#include "UiDocument.h" #include "UiDocument.hpp"
#include <string>
ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets) : content(content) { ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets) : content(content) {
auto indices = content->getIndices(); auto indices = content->getIndices();

View File

@ -1,5 +1,5 @@
#ifndef FRONTEND_BLOCKS_GFX_CACHE_H_ #ifndef FRONTEND_BLOCKS_GFX_CACHE_HPP_
#define FRONTEND_BLOCKS_GFX_CACHE_H_ #define FRONTEND_BLOCKS_GFX_CACHE_HPP_
#include "../typedefs.h" #include "../typedefs.h"
@ -24,4 +24,4 @@ public:
const Content* getContent() const; const Content* getContent() const;
}; };
#endif // FRONTEND_BLOCKS_GFX_CACHE_H_ #endif // FRONTEND_BLOCKS_GFX_CACHE_HPP_

View File

@ -1,7 +1,7 @@
#include "LevelFrontend.h" #include "LevelFrontend.h"
#include "../assets/Assets.h" #include "../assets/Assets.h"
#include "../audio/audio.h" #include "../audio/audio.hpp"
#include "../content/Content.h" #include "../content/Content.h"
#include "../graphics/core/Atlas.hpp" #include "../graphics/core/Atlas.hpp"
#include "../graphics/render/BlocksPreview.hpp" #include "../graphics/render/BlocksPreview.hpp"
@ -9,7 +9,7 @@
#include "../logic/PlayerController.h" #include "../logic/PlayerController.h"
#include "../voxels/Block.h" #include "../voxels/Block.h"
#include "../world/Level.h" #include "../world/Level.h"
#include "ContentGfxCache.h" #include "ContentGfxCache.hpp"
LevelFrontend::LevelFrontend(LevelController* controller, Assets* assets) LevelFrontend::LevelFrontend(LevelController* controller, Assets* assets)
: level(controller->getLevel()), : level(controller->getLevel()),

View File

@ -1,4 +1,4 @@
#include "UiDocument.h" #include "UiDocument.hpp"
#include "../files/files.h" #include "../files/files.h"
#include "../graphics/ui/elements/UINode.hpp" #include "../graphics/ui/elements/UINode.hpp"

View File

@ -1,5 +1,5 @@
#ifndef FRONTEND_UI_DOCUMENT_H_ #ifndef FRONTEND_UI_DOCUMENT_HPP_
#define FRONTEND_UI_DOCUMENT_H_ #define FRONTEND_UI_DOCUMENT_HPP_
#include "../typedefs.h" #include "../typedefs.h"
@ -50,4 +50,4 @@ public:
static std::shared_ptr<gui::UINode> readElement(fs::path file); static std::shared_ptr<gui::UINode> readElement(fs::path file);
}; };
#endif // FRONTEND_UI_DOCUMENT_H_ #endif // FRONTEND_UI_DOCUMENT_HPP_

View File

@ -1,8 +1,4 @@
#include <string> #include "../audio/audio.hpp"
#include <memory>
#include <sstream>
#include "../audio/audio.h"
#include "../delegates.h" #include "../delegates.h"
#include "../engine.h" #include "../engine.h"
#include "../graphics/core/Mesh.hpp" #include "../graphics/core/Mesh.hpp"
@ -20,6 +16,10 @@
#include "../world/Level.h" #include "../world/Level.h"
#include "../world/World.h" #include "../world/World.h"
#include <string>
#include <memory>
#include <sstream>
using namespace gui; using namespace gui;
static std::shared_ptr<Label> create_label(wstringsupplier supplier) { static std::shared_ptr<Label> create_label(wstringsupplier supplier) {

View File

@ -1,4 +1,4 @@
#include "hud.h" #include "hud.hpp"
#include "../assets/Assets.h" #include "../assets/Assets.h"
#include "../content/Content.h" #include "../content/Content.h"
@ -39,9 +39,9 @@
#include "../window/Window.hpp" #include "../window/Window.hpp"
#include "../world/Level.h" #include "../world/Level.h"
#include "../world/World.h" #include "../world/World.h"
#include "ContentGfxCache.h" #include "ContentGfxCache.hpp"
#include "LevelFrontend.h" #include "LevelFrontend.h"
#include "UiDocument.h" #include "UiDocument.hpp"
#include <assert.h> #include <assert.h>
#include <memory> #include <memory>

View File

@ -1,5 +1,5 @@
#ifndef FRONTEND_HUD_H_ #ifndef FRONTEND_HUD_HPP_
#define FRONTEND_HUD_H_ #define FRONTEND_HUD_HPP_
#include "../typedefs.h" #include "../typedefs.h"
#include "../util/ObjectsKeeper.hpp" #include "../util/ObjectsKeeper.hpp"
@ -164,4 +164,4 @@ public:
std::shared_ptr<Inventory> getBlockInventory(); std::shared_ptr<Inventory> getBlockInventory();
}; };
#endif // FRONTEND_HUD_H_ #endif // FRONTEND_HUD_HPP_

View File

@ -17,7 +17,7 @@
#include "../util/stringutil.h" #include "../util/stringutil.h"
#include "../window/Window.hpp" #include "../window/Window.hpp"
#include "locale/langs.h" #include "locale/langs.h"
#include "UiDocument.h" #include "UiDocument.hpp"
namespace fs = std::filesystem; namespace fs = std::filesystem;
using namespace gui; using namespace gui;

View File

@ -1,9 +1,9 @@
#include "LevelScreen.hpp" #include "LevelScreen.hpp"
#include "../hud.h" #include "../hud.hpp"
#include "../LevelFrontend.h" #include "../LevelFrontend.h"
#include "../../debug/Logger.hpp" #include "../../debug/Logger.hpp"
#include "../../audio/audio.h" #include "../../audio/audio.hpp"
#include "../../coders/imageio.hpp" #include "../../coders/imageio.hpp"
#include "../../graphics/core/PostProcessing.h" #include "../../graphics/core/PostProcessing.h"
#include "../../graphics/core/DrawContext.hpp" #include "../../graphics/core/DrawContext.hpp"

View File

@ -1,8 +1,9 @@
#include "BlocksPreview.hpp" #include "BlocksPreview.hpp"
#include "../../assets/Assets.h" #include "../../assets/Assets.h"
#include "../../constants.h" #include "../../constants.h"
#include "../../content/Content.h" #include "../../content/Content.h"
#include "../../frontend/ContentGfxCache.h" #include "../../frontend/ContentGfxCache.hpp"
#include "../../voxels/Block.h" #include "../../voxels/Block.h"
#include "../../window/Camera.hpp" #include "../../window/Camera.hpp"
#include "../../window/Window.hpp" #include "../../window/Window.hpp"

View File

@ -1,4 +1,5 @@
#include "BlocksRenderer.hpp" #include "BlocksRenderer.hpp"
#include "../core/Mesh.hpp" #include "../core/Mesh.hpp"
#include "../../maths/UVRegion.hpp" #include "../../maths/UVRegion.hpp"
#include "../../constants.h" #include "../../constants.h"
@ -8,7 +9,7 @@
#include "../../voxels/VoxelsVolume.h" #include "../../voxels/VoxelsVolume.h"
#include "../../voxels/ChunksStorage.h" #include "../../voxels/ChunksStorage.h"
#include "../../lighting/Lightmap.h" #include "../../lighting/Lightmap.h"
#include "../../frontend/ContentGfxCache.h" #include "../../frontend/ContentGfxCache.hpp"
#include "../../settings.h" #include "../../settings.h"
#include <glm/glm.hpp> #include <glm/glm.hpp>

View File

@ -6,7 +6,7 @@
#include <algorithm> #include <algorithm>
#include "../../assets/Assets.h" #include "../../assets/Assets.h"
#include "../../frontend/UiDocument.h" #include "../../frontend/UiDocument.hpp"
#include "../../graphics/core/Batch2D.hpp" #include "../../graphics/core/Batch2D.hpp"
#include "../../graphics/core/Shader.hpp" #include "../../graphics/core/Shader.hpp"
#include "../../graphics/core/DrawContext.hpp" #include "../../graphics/core/DrawContext.hpp"

View File

@ -533,9 +533,13 @@ void UiXmlReader::addIgnore(const std::string& tag) {
std::shared_ptr<UINode> UiXmlReader::readUINode(xml::xmlelement element) { std::shared_ptr<UINode> UiXmlReader::readUINode(xml::xmlelement element) {
if (element->has("if")) { if (element->has("if")) {
const auto& cond = element->attr("if").getText(); const auto& cond = element->attr("if").getText();
if (cond.empty() || cond == "false" || cond == "nil") { if (cond.empty() || cond == "false" || cond == "nil")
return nullptr;
}
if (element->has("ifnot")) {
const auto& cond = element->attr("ifnot").getText();
if (!(cond.empty() || cond == "false" || cond == "nil"))
return nullptr; return nullptr;
}
} }
const std::string& tag = element->getTag(); const std::string& tag = element->getTag();

View File

@ -1,14 +1,14 @@
#ifndef FRONTEND_GUI_GUI_XML_HPP_ #ifndef FRONTEND_GUI_GUI_XML_HPP_
#define FRONTEND_GUI_GUI_XML_HPP_ #define FRONTEND_GUI_GUI_XML_HPP_
#include "GUI.hpp"
#include "../../coders/xml.hpp"
#include <memory> #include <memory>
#include <stack> #include <stack>
#include <unordered_set> #include <unordered_set>
#include <unordered_map> #include <unordered_map>
#include "GUI.hpp"
#include "../../coders/xml.h"
namespace gui { namespace gui {
class UiXmlReader; class UiXmlReader;

View File

@ -1,11 +1,12 @@
#include "LuaState.h" #include "LuaState.hpp"
#include "lua_util.hpp"
#include "api_lua.hpp"
#include "../../../debug/Logger.hpp"
#include "../../../util/stringutil.h"
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include "lua_util.h"
#include "api_lua.h"
#include "../../../debug/Logger.hpp"
#include "../../../util/stringutil.h"
inline std::string LAMBDAS_TABLE = "$L"; inline std::string LAMBDAS_TABLE = "$L";

View File

@ -1,9 +1,7 @@
#ifndef LOGIC_SCRIPTING_LUA_STATE_H_ #ifndef LOGIC_SCRIPTING_LUA_STATE_HPP_
#define LOGIC_SCRIPTING_LUA_STATE_H_ #define LOGIC_SCRIPTING_LUA_STATE_HPP_
#include "lua_commons.h" #include "lua_commons.hpp"
#include <string>
#include <stdexcept>
#include "../../../data/dynamic.h" #include "../../../data/dynamic.h"
#include "../../../delegates.h" #include "../../../delegates.h"
@ -12,6 +10,9 @@
#error LuaJIT required #error LuaJIT required
#endif #endif
#include <string>
#include <stdexcept>
namespace lua { namespace lua {
class luaerror : public std::runtime_error { class luaerror : public std::runtime_error {
public: public:
@ -76,4 +77,4 @@ namespace lua {
}; };
} }
#endif // LOGIC_SCRIPTING_LUA_STATE_H_ #endif // LOGIC_SCRIPTING_LUA_STATE_HPP_

View File

@ -1,8 +1,9 @@
#ifndef LOGIC_SCRIPTING_API_LUA_H_ #ifndef LOGIC_SCRIPTING_API_LUA_HPP_
#define LOGIC_SCRIPTING_API_LUA_H_ #define LOGIC_SCRIPTING_API_LUA_HPP_
#include "lua_commons.hpp"
#include <exception> #include <exception>
#include "lua_commons.h"
// Libraries // Libraries
extern const luaL_Reg audiolib []; extern const luaL_Reg audiolib [];
@ -23,4 +24,4 @@ extern const luaL_Reg inputlib [];
// Lua Overrides // Lua Overrides
extern int l_print(lua_State* L); extern int l_print(lua_State* L);
#endif // LOGIC_SCRIPTING_API_LUA_H_ #endif // LOGIC_SCRIPTING_API_LUA_HPP_

View File

@ -1,8 +1,8 @@
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_commons.h" #include "lua_commons.hpp"
#include "lua_util.h" #include "lua_util.hpp"
#include "../../../audio/audio.h" #include "../../../audio/audio.hpp"
#include "../../../engine.h" #include "../../../engine.h"
#include "../scripting.h" #include "../scripting.h"

View File

@ -1,6 +1,6 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_util.h" #include "lua_util.hpp"
#include "../scripting.h" #include "../scripting.h"
#include "../../../world/Level.h" #include "../../../world/Level.h"
#include "../../../voxels/Chunks.h" #include "../../../voxels/Chunks.h"

View File

@ -1,6 +1,6 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "LuaState.h" #include "LuaState.hpp"
#include "../../../engine.h" #include "../../../engine.h"
#include "../../../files/settings_io.hpp" #include "../../../files/settings_io.hpp"

View File

@ -1,5 +1,5 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "../scripting.h" #include "../scripting.h"
#include "../../../engine.h" #include "../../../engine.h"
#include "../../../files/files.h" #include "../../../files/files.h"

View File

@ -1,11 +1,9 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_util.hpp"
#include "LuaState.hpp"
#include <iostream>
#include "../scripting.h" #include "../scripting.h"
#include "lua_util.h"
#include "LuaState.h"
#include "../../../engine.h" #include "../../../engine.h"
#include "../../../assets/Assets.h" #include "../../../assets/Assets.h"
#include "../../../items/Inventories.h" #include "../../../items/Inventories.h"
@ -18,7 +16,7 @@
#include "../../../graphics/ui/elements/Panel.hpp" #include "../../../graphics/ui/elements/Panel.hpp"
#include "../../../graphics/ui/elements/Menu.hpp" #include "../../../graphics/ui/elements/Menu.hpp"
#include "../../../graphics/ui/elements/InventoryView.hpp" #include "../../../graphics/ui/elements/InventoryView.hpp"
#include "../../../frontend/UiDocument.h" #include "../../../frontend/UiDocument.hpp"
#include "../../../frontend/locale/langs.h" #include "../../../frontend/locale/langs.h"
#include "../../../util/stringutil.h" #include "../../../util/stringutil.h"
#include "../../../world/Level.h" #include "../../../world/Level.h"

View File

@ -1,11 +1,12 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "LuaState.h" #include "LuaState.hpp"
#include "../../../assets/Assets.h" #include "../../../assets/Assets.h"
#include "../../../content/Content.h" #include "../../../content/Content.h"
#include "../../../engine.h" #include "../../../engine.h"
#include "../../../frontend/hud.h" #include "../../../frontend/hud.hpp"
#include "../../../frontend/UiDocument.h" #include "../../../frontend/UiDocument.hpp"
#include "../../../graphics/ui/elements/InventoryView.hpp" #include "../../../graphics/ui/elements/InventoryView.hpp"
#include "../../../items/Inventories.h" #include "../../../items/Inventories.h"
#include "../../../logic/BlocksController.h" #include "../../../logic/BlocksController.h"

View File

@ -1,15 +1,14 @@
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_commons.h" #include "lua_commons.hpp"
#include "LuaState.hpp"
#include "../scripting.h" #include "../scripting.h"
#include "../../../window/input.hpp" #include "../../../window/input.hpp"
#include "../../../window/Events.hpp" #include "../../../window/Events.hpp"
#include "../../../frontend/screens/Screen.hpp" #include "../../../frontend/screens/Screen.hpp"
#include "../../../frontend/hud.h" #include "../../../frontend/hud.hpp"
#include "../../../engine.h" #include "../../../engine.h"
#include "LuaState.h"
namespace scripting { namespace scripting {
extern lua::LuaState* state; extern lua::LuaState* state;
extern Hud* hud; extern Hud* hud;

View File

@ -1,7 +1,6 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_util.hpp"
#include "lua_util.h"
#include "../scripting.h" #include "../scripting.h"
#include "../../../content/Content.h" #include "../../../content/Content.h"
#include "../../../world/Level.h" #include "../../../world/Level.h"

View File

@ -1,5 +1,5 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "../scripting.h" #include "../scripting.h"
#include "../../../content/Content.h" #include "../../../content/Content.h"
#include "../../../items/ItemDef.h" #include "../../../items/ItemDef.h"

View File

@ -1,7 +1,6 @@
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_commons.h" #include "lua_commons.hpp"
#include "LuaState.hpp"
#include "LuaState.h"
#include "../../../coders/json.h" #include "../../../coders/json.h"
#include "../../../data/dynamic.h" #include "../../../data/dynamic.h"

View File

@ -1,5 +1,5 @@
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_commons.h" #include "lua_commons.hpp"
#include "../scripting.h" #include "../scripting.h"
#include "../../../engine.h" #include "../../../engine.h"
#include "../../../assets/AssetsLoader.h" #include "../../../assets/AssetsLoader.h"

View File

@ -1,5 +1,5 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "../scripting.h" #include "../scripting.h"
#include "../../../world/Level.h" #include "../../../world/Level.h"
#include "../../../objects/Player.h" #include "../../../objects/Player.h"

View File

@ -1,5 +1,5 @@
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_commons.h" #include "lua_commons.hpp"
#include "../scripting.h" #include "../scripting.h"
#include "../../../engine.h" #include "../../../engine.h"
#include "../../../window/Window.hpp" #include "../../../window/Window.hpp"

View File

@ -1,5 +1,5 @@
#include "lua_commons.h" #include "lua_commons.hpp"
#include "api_lua.h" #include "api_lua.hpp"
#include "../scripting.h" #include "../scripting.h"
#include "../../../assets/Assets.h" #include "../../../assets/Assets.h"
#include "../../../assets/AssetsLoader.h" #include "../../../assets/AssetsLoader.h"

View File

@ -1,5 +1,5 @@
#ifndef LOGIC_SCRIPTING_LUA_H_ #ifndef LOGIC_SCRIPTING_LUA_HPP_
#define LOGIC_SCRIPTING_LUA_H_ #define LOGIC_SCRIPTING_LUA_HPP_
#ifdef __linux__ #ifdef __linux__
#include <luajit-2.1/luaconf.h> #include <luajit-2.1/luaconf.h>
@ -30,4 +30,4 @@ template <lua_CFunction func> int lua_wrap_errors(lua_State *L) {
return result; return result;
} }
#endif // LOGIC_SCRIPTING_LUA_H_ #endif // LOGIC_SCRIPTING_LUA_HPP_

View File

@ -1,5 +1,5 @@
#include "api_lua.h" #include "api_lua.hpp"
#include "lua_commons.h" #include "lua_commons.hpp"
#include <iostream> #include <iostream>

View File

@ -1,6 +1,8 @@
#ifndef LOGIC_SCRIPTING_LUA_UTIL_H_ #ifndef LOGIC_SCRIPTING_LUA_UTIL_H_
#define LOGIC_SCRIPTING_LUA_UTIL_H_ #define LOGIC_SCRIPTING_LUA_UTIL_H_
#include "LuaState.hpp"
#ifdef __linux__ #ifdef __linux__
#include <luajit-2.1/luaconf.h> #include <luajit-2.1/luaconf.h>
#include <luajit-2.1/lua.hpp> #include <luajit-2.1/lua.hpp>
@ -8,7 +10,6 @@
#include <lua.hpp> #include <lua.hpp>
#endif #endif
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "LuaState.h"
namespace lua { namespace lua {
inline int pushivec3(lua_State* L, luaint x, luaint y, luaint z) { inline int pushivec3(lua_State* L, luaint x, luaint y, luaint z) {

View File

@ -1,26 +1,26 @@
#include "scripting.h" #include "scripting.h"
#include "../../content/ContentPack.h"
#include "../../debug/Logger.hpp"
#include "../../engine.h"
#include "../../files/engine_paths.h"
#include "../../files/files.h"
#include "../../frontend/UiDocument.hpp"
#include "../../items/Inventory.h"
#include "../../items/ItemDef.h"
#include "../../logic/BlocksController.h"
#include "../../logic/LevelController.h"
#include "../../objects/Player.h"
#include "../../util/stringutil.h"
#include "../../util/timeutil.h"
#include "../../util/timeutil.h"
#include "../../voxels/Block.h"
#include "../../world/Level.h"
#include "lua/LuaState.hpp"
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include "../../debug/Logger.hpp"
#include "../../content/ContentPack.h"
#include "../../files/engine_paths.h"
#include "../../files/files.h"
#include "../../util/timeutil.h"
#include "../../world/Level.h"
#include "../../objects/Player.h"
#include "../../voxels/Block.h"
#include "../../items/ItemDef.h"
#include "../../items/Inventory.h"
#include "../../logic/BlocksController.h"
#include "../../logic/LevelController.h"
#include "../../frontend/UiDocument.h"
#include "../../engine.h"
#include "lua/LuaState.h"
#include "../../util/stringutil.h"
#include "../../util/timeutil.h"
using namespace scripting; using namespace scripting;
namespace scripting { namespace scripting {

View File

@ -1,8 +1,6 @@
#include "scripting_functional.h" #include "scripting_functional.h"
#include <iostream> #include "lua/LuaState.hpp"
#include "lua/LuaState.h"
#include "../../debug/Logger.hpp" #include "../../debug/Logger.hpp"
#include "../../util/stringutil.h" #include "../../util/stringutil.h"

View File

@ -1,17 +1,15 @@
#include "scripting_hud.hpp" #include "scripting_hud.hpp"
#include "scripting.h" #include "scripting.h"
#include "lua/api_lua.h" #include "lua/api_lua.hpp"
#include "lua/LuaState.h" #include "lua/LuaState.hpp"
#include "../../debug/Logger.hpp" #include "../../debug/Logger.hpp"
#include "../../frontend/hud.h" #include "../../frontend/hud.hpp"
#include "../../objects/Player.h" #include "../../objects/Player.h"
#include "../../files/files.h" #include "../../files/files.h"
#include "../../engine.h" #include "../../engine.h"
#include <iostream>
namespace scripting { namespace scripting {
extern lua::LuaState* state; extern lua::LuaState* state;
} }