diff --git a/README.md b/README.md index e672ef541..1fd77cc8c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Installing last version that supports C++17. ```sh git clone --branch v3.16.0 https://github.com/skypjack/entt.git cd entt -mkdir build && cd build +mkdir -p build && cd build cmake -DCMAKE_BUILD_TYPE=Release -DENTT_INSTALL=ON .. sudo make install ``` diff --git a/doc/en/content-packs.md b/doc/en/content-packs.md index c193fb188..48ec57e6d 100644 --- a/doc/en/content-packs.md +++ b/doc/en/content-packs.md @@ -12,7 +12,7 @@ Content-pack folder must contain file **package.json** with following contents: { "id": "pack_id", "title": "pack name will be displayed in the content menu", - "version": "content-pack version - major.minor", + "version": "content-pack version - major.minor.[patch])", "creator": "content-pack creator", "description": "short description", "dependencies": [ @@ -26,6 +26,7 @@ Dependency levels are indicated by prefixes in the name: - '!' - required dependency - '?' - optional dependency - '~' - weak dependency + If prefix is not specified, '!' level will be used. Example: '~randutil' - weak dependency 'randutil'. diff --git a/doc/en/scripting/ui.md b/doc/en/scripting/ui.md index 2d338a5aa..7a11b2f5e 100644 --- a/doc/en/scripting/ui.md +++ b/doc/en/scripting/ui.md @@ -53,7 +53,7 @@ Properties that apply to all elements: | contentOffset | vec2 | yes | *no* | element content offset | | cursor | string | yes | yes | cursor displayed on hover | | parent | Element | yes | *no* | parent element or nil | -| zIndex | bool | yes | *no* | z-index value. In panel, it determines the order | +| zIndex | int | yes | *no* | z-index value. In panel, it determines the order | Common element methods: diff --git a/doc/ru/content-packs.md b/doc/ru/content-packs.md index 32f9be593..4ab002104 100644 --- a/doc/ru/content-packs.md +++ b/doc/ru/content-packs.md @@ -12,7 +12,7 @@ { "id": "выбранное_имя_пака", "title": "имя контент-пака для отображения в меню контента", - "version": "версия контент-пака в формате major.minor", + "version": "версия контент-пака в формате major.minor.[patch]", "creator": "создатель контент-пака", "description": "краткое описание", "dependencies": [ @@ -28,6 +28,7 @@ - '!' - обязательная зависимость - '?' - опциональная зависимость - '~' - слабая зависимость + Отсутствие префикса интерпретируется как '!'. Пример: '~randutil' - слабая зависимость 'randutil'. diff --git a/doc/ru/scripting/ui.md b/doc/ru/scripting/ui.md index 631d5e00f..09e296f9b 100644 --- a/doc/ru/scripting/ui.md +++ b/doc/ru/scripting/ui.md @@ -53,7 +53,7 @@ document["worlds-panel"]:clear() | contentOffset | vec2 | да | *нет* | смещение содержимого | | cursor | string | да | да | курсор, отображаемый при наведении | | parent | Element | да | *нет* | родительский элемент или nil | -| zIndex | bool | да | *нет* | значение z-индекса. В panel определяет порядок | +| zIndex | int | да | *нет* | значение z-индекса. В panel определяет порядок | Общие методы элементов: diff --git a/res/modules/internal/stdcomp.lua b/res/modules/internal/stdcomp.lua index ebc314615..8e87dc431 100644 --- a/res/modules/internal/stdcomp.lua +++ b/res/modules/internal/stdcomp.lua @@ -132,7 +132,7 @@ return { goto continue end for _, component in ipairs(entity.ordered_components) do - local callback = component.on_update + local callback = rawget(component, "on_update") if not component.__disabled and callback then local _, err = pcall(callback, tps) if err then @@ -146,7 +146,7 @@ return { physics_update = function(delta) for uid, entity in pairs(entities) do for _, component in ipairs(entity.ordered_components) do - local callback = component.on_physics_update + local callback = rawget(component, "on_physics_update") if not component.__disabled and callback then local result, err = pcall(callback, delta) if err then @@ -159,7 +159,7 @@ return { render = function(delta) for _,entity in pairs(entities) do for _, component in ipairs(entity.ordered_components) do - local callback = component.on_render + local callback = rawget(component, "on_render") if not component.__disabled and callback then local _, err = pcall(callback, delta) if err then diff --git a/src/graphics/render/WorldRenderer.cpp b/src/graphics/render/WorldRenderer.cpp index 9668ac59e..72c9cdb32 100644 --- a/src/graphics/render/WorldRenderer.cpp +++ b/src/graphics/render/WorldRenderer.cpp @@ -470,8 +470,11 @@ void WorldRenderer::renderFrame( setupWorldShader(entityShader, hudcam, engine.getSettings(), 0.0f); hands->render(camera); } - renderBlockOverlay(pctx); - + { + auto bctx = pctx.sub(); + bctx.useTexture(advanced_pipeline::TARGET_COLOR, nullptr); + renderBlockOverlay(pctx); + } glActiveTexture(GL_TEXTURE0); } diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index 8f0f60520..6169a2578 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -188,8 +188,8 @@ void GUI::actMouse(Frame& frame, float delta, const CursorState& cursor) { doubleClicked = true; } else { pressed->click(cursorPos.x, cursorPos.y); + doubleClickTimer = 0.0f; } - doubleClickTimer = 0.0f; if (focus && focus != pressed) { focus->defocus(); } diff --git a/src/graphics/ui/elements/CheckBox.hpp b/src/graphics/ui/elements/CheckBox.hpp index 5ca144618..0f520d43f 100644 --- a/src/graphics/ui/elements/CheckBox.hpp +++ b/src/graphics/ui/elements/CheckBox.hpp @@ -6,7 +6,7 @@ #include "Panel.hpp" namespace gui { - class CheckBox : public UINode { + class CheckBox final : public UINode { protected: glm::vec4 checkColor {1.0f, 1.0f, 1.0f, 0.4f}; boolsupplier supplier = nullptr; @@ -15,23 +15,22 @@ namespace gui { public: explicit CheckBox(GUI& gui, bool checked = false); - virtual void draw(const DrawContext& pctx, const Assets& assets) - override; + void draw(const DrawContext& pctx, const Assets& assets) override; - virtual void mouseRelease(int x, int y) override; + void mouseRelease(int x, int y) override; - virtual void setSupplier(boolsupplier supplier); - virtual void setConsumer(boolconsumer consumer); + void setSupplier(boolsupplier supplier); + void setConsumer(boolconsumer consumer); - virtual CheckBox* setChecked(bool flag); + CheckBox* setChecked(bool flag); - virtual bool isChecked() const { + bool isChecked() const { if (supplier) return supplier(); return checked; } }; - class FullCheckBox : public Panel { + class FullCheckBox final : public Panel { protected: std::shared_ptr checkbox; std::shared_ptr