From bf50c37b823cab0a5bc20d8877ae4b5c23eee697 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 28 Aug 2026 00:04:43 +0300 Subject: [PATCH 1/3] fix containers scroll --- src/graphics/ui/elements/BasePanel.hpp | 1 + src/graphics/ui/elements/Container.cpp | 3 ++- src/graphics/ui/elements/Container.hpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/graphics/ui/elements/BasePanel.hpp b/src/graphics/ui/elements/BasePanel.hpp index 168776a9b..be61ebc56 100644 --- a/src/graphics/ui/elements/BasePanel.hpp +++ b/src/graphics/ui/elements/BasePanel.hpp @@ -8,6 +8,7 @@ namespace gui { virtual ~BasePanel() = default; virtual void setOrientation(Orientation orientation) { + this->mainScrollDir = orientation; this->orientation = orientation; refresh(); } diff --git a/src/graphics/ui/elements/Container.cpp b/src/graphics/ui/elements/Container.cpp index 3d03c2fe3..a9ab71e9d 100644 --- a/src/graphics/ui/elements/Container.cpp +++ b/src/graphics/ui/elements/Container.cpp @@ -114,7 +114,7 @@ void Container::act(float delta) { void Container::scrolled(int value) { auto size = getSize(); - bool isVertical = actualLengthY > size.y; + bool isVertical = mainScrollDir == Orientation::VERTICAL; int diff = (isVertical ? actualLengthY - size.y : actualLengthX - size.x); int& scroll = (isVertical ? scrollY : scrollX); @@ -245,6 +245,7 @@ void Container::setSize(const glm::vec2& size) { for (auto& node : nodes) { node->reposition(); } + scrolled(0); } int Container::getScrollStep() const { diff --git a/src/graphics/ui/elements/Container.hpp b/src/graphics/ui/elements/Container.hpp index 36c366010..b5664c139 100644 --- a/src/graphics/ui/elements/Container.hpp +++ b/src/graphics/ui/elements/Container.hpp @@ -20,6 +20,7 @@ namespace gui { int actualLengthY = 0; int actualLengthX = 0; bool scrollable = true; + Orientation mainScrollDir = Orientation::VERTICAL; bool isScrolling() const { return scrollbarTriggered; From c759e02cebc274bbf865ed9bb675c98dc23cb99d Mon Sep 17 00:00:00 2001 From: zaveshaa Date: Sun, 23 Aug 2026 19:18:17 +0300 Subject: [PATCH 2/3] fix typos in docs and dev test script --- dev/tests/network_http.lua | 2 +- doc/en/block-models.md | 46 +++++++++++------------ doc/en/scripting/builtins/libblock.md | 2 +- doc/en/scripting/builtins/libinventory.md | 2 +- doc/en/scripting/builtins/libplayer.md | 2 +- doc/en/scripting/ecs.md | 2 +- doc/specs/debugging_protocol.md | 2 +- doc/specs/vec3_model_spec.md | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/dev/tests/network_http.lua b/dev/tests/network_http.lua index 6bd9ba797..5861460de 100644 --- a/dev/tests/network_http.lua +++ b/dev/tests/network_http.lua @@ -4,7 +4,7 @@ network.get("https://api.github.com/repos/MihailRis/VoxelEngine-Cpp/releases/lat print(json.parse(s).name) response_received = true end, function (code) - print("repond with code", code) + print("respond with code", code) response_received = true end) diff --git a/doc/en/block-models.md b/doc/en/block-models.md index ba2f75858..4f598cad7 100644 --- a/doc/en/block-models.md +++ b/doc/en/block-models.md @@ -1,23 +1,23 @@ -# Block Models (depricated) - -> ![WARNING] -> The `model-primitives` property is deprecated. Use the [VCM format](vcm.md) for a textual description of the model's primitives. - -Block model may be created with following properties: - -```js -"model": "custom", -"model-primitives": { - "aabbs": [ - // list of AABB primitives - ], - // ... other primitives -} -``` - -**AABB** primitive is an array of values: -``` -[x, y, z, width, height, depth, texture names for all 6 sides] -``` - -**tetragon** primitive (more like parallelogram) an array of three vectors, describing primitive position, X vector \* width, Y vector \* height. +# Block Models (deprecated) + +> ![WARNING] +> The `model-primitives` property is deprecated. Use the [VCM format](vcm.md) for a textual description of the model's primitives. + +Block model may be created with following properties: + +```js +"model": "custom", +"model-primitives": { + "aabbs": [ + // list of AABB primitives + ], + // ... other primitives +} +``` + +**AABB** primitive is an array of values: +``` +[x, y, z, width, height, depth, texture names for all 6 sides] +``` + +**tetragon** primitive (more like parallelogram) an array of three vectors, describing primitive position, X vector \* width, Y vector \* height. diff --git a/doc/en/scripting/builtins/libblock.md b/doc/en/scripting/builtins/libblock.md index cc69e47d8..4f0b02809 100644 --- a/doc/en/scripting/builtins/libblock.md +++ b/doc/en/scripting/builtins/libblock.md @@ -151,7 +151,7 @@ block.raycast(start: vec3, dir: vec3, max_distance: number, [optional] dest: tab Casts a ray from the start point in the direction of *dir*. Max_distance specifies the maximum ray length. Argument `filter` can be used to tell ray what blocks can be skipped(passed through) during ray-casting. -To use filter `dest` argument must be filled with some value(can be nil), it's done for backwards compatability +To use filter `dest` argument must be filled with some value(can be nil), it's done for backwards compatibility The `include_non_selectable` argument determines whether blocks that cannot be selected by the cursor will be included. Example - `base:water` diff --git a/doc/en/scripting/builtins/libinventory.md b/doc/en/scripting/builtins/libinventory.md index 172ec63e6..63c25a3c9 100644 --- a/doc/en/scripting/builtins/libinventory.md +++ b/doc/en/scripting/builtins/libinventory.md @@ -186,7 +186,7 @@ inventory.clone(invid: int) -> int -- Move an item from slotA of invA to slotB of invB. -- invA may be the same as invB. --- If slotB will be chosen automaticly if argument is not specified. +-- If slotB will be chosen automatically if argument is not specified. -- The move may be incomplete if the available slot has no enough stack space. inventory.move(invA: int, slotA: int, invB: int, slotB: int) diff --git a/doc/en/scripting/builtins/libplayer.md b/doc/en/scripting/builtins/libplayer.md index 4b632d798..1dd628b0e 100644 --- a/doc/en/scripting/builtins/libplayer.md +++ b/doc/en/scripting/builtins/libplayer.md @@ -154,7 +154,7 @@ Returns position of the selected block or nil player.get_selected_entity(playerid: int) -> int ``` -Returns unique indentifier of the entity selected by player +Returns unique identifier of the entity selected by player ```lua player.get_entity(playerid: int) -> int diff --git a/doc/en/scripting/ecs.md b/doc/en/scripting/ecs.md index f8bce6d3f..c54165bd4 100644 --- a/doc/en/scripting/ecs.md +++ b/doc/en/scripting/ecs.md @@ -8,7 +8,7 @@ The entity object is available in components as a global variable **entity**. -- Deletes an entity (the entity may continue to exist until the frame ends, but will not be displayed in that frame) entity:despawn() --- Returns entity defintion index (integer ID) +-- Returns entity definition index (integer ID) entity:def_index() -> int -- Returns entity definition name (string ID) diff --git a/doc/specs/debugging_protocol.md b/doc/specs/debugging_protocol.md index ba4cf96a8..a66753a9b 100644 --- a/doc/specs/debugging_protocol.md +++ b/doc/specs/debugging_protocol.md @@ -79,7 +79,7 @@ Configuring connection. Disconnect-action is action that debugged instance must - `frame` - Call stack frame index (indexing from most recent call) - `local` - Local variable index (based on `paused` event stack trace) -- `path` - Requsted value path segments. Example: `['a', 'b', 5]` is `local_variable.a.b[5]` +- `path` - Requested value path segments. Example: `['a', 'b', 5]` is `local_variable.a.b[5]` Responds with: diff --git a/doc/specs/vec3_model_spec.md b/doc/specs/vec3_model_spec.md index b9c2868c7..80c6e7073 100644 --- a/doc/specs/vec3_model_spec.md +++ b/doc/specs/vec3_model_spec.md @@ -16,7 +16,7 @@ enum AttributeType:uint8 { sizeof(AttributeType) == 1; struct VertexAttribute { - AttributeType type; // data type is infered from attribute type + AttributeType type; // data type is inferred from attribute type uint8 flags; uint32 size; float data[]; // if compressed, first 4 bytes of compressed data is decompressed size From 515e27b402fd09a33d0e9800792e15f1f6caa7f8 Mon Sep 17 00:00:00 2001 From: zaveshaa Date: Sun, 23 Aug 2026 19:19:22 +0300 Subject: [PATCH 3/3] fix typos in comments and log messages --- src/audio/audio.hpp | 6 +++--- src/coders/wav.cpp | 2 +- src/frontend/hud.hpp | 2 +- src/logic/scripting/lua/lua_util.hpp | 2 +- src/network/Sockets.cpp | 2 +- src/presets/ParticlesPreset.hpp | 4 ++-- src/util/SmallHeap.hpp | 2 +- src/world/files/WorldRegions.cpp | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/audio/audio.hpp b/src/audio/audio.hpp index 39304fd41..9af27dde1 100644 --- a/src/audio/audio.hpp +++ b/src/audio/audio.hpp @@ -413,7 +413,7 @@ namespace audio { /// @brief Load audio file info and PCM data /// @param file audio file /// @param headerOnly read header only - /// @throws std::runtime_error if I/O error ocurred or format is unknown + /// @throws std::runtime_error if I/O error occurred or format is unknown /// @return PCM audio data std::unique_ptr load_PCM(const io::path& file, bool headerOnly); @@ -421,7 +421,7 @@ namespace audio { /// @param file audio file path /// @param keepPCM store PCM data in sound to make it accessible with /// Sound::getPCM - /// @throws std::runtime_error if I/O error ocurred or format is unknown + /// @throws std::runtime_error if I/O error occurred or format is unknown /// @return new Sound instance std::unique_ptr load_sound(const io::path& file, bool keepPCM); @@ -434,7 +434,7 @@ namespace audio { /// @brief Open new PCM stream from file /// @param file audio file path - /// @throws std::runtime_error if I/O error ocurred or format is unknown + /// @throws std::runtime_error if I/O error occurred or format is unknown /// @return new PCMStream instance std::unique_ptr open_PCM_stream(const io::path& file); diff --git a/src/coders/wav.cpp b/src/coders/wav.cpp index 1e260a0c1..1dedc9c24 100644 --- a/src/coders/wav.cpp +++ b/src/coders/wav.cpp @@ -69,7 +69,7 @@ public: return 0; } if (in.fail()) { - logger.error() << "Wav::load_pcm: I/O error ocurred"; + logger.error() << "Wav::load_pcm: I/O error occurred"; return -1; } return in.gcount(); diff --git a/src/frontend/hud.hpp b/src/frontend/hud.hpp index f40a53581..6b5d62130 100644 --- a/src/frontend/hud.hpp +++ b/src/frontend/hud.hpp @@ -119,7 +119,7 @@ class Hud : public util::ObjectsKeeper { /// @brief Allow actual pause bool allowPause = true; bool debug = false; - /// @brief UI element will be dynamicly positioned near to inventory or in screen center + /// @brief UI element will be dynamically positioned near to inventory or in screen center std::shared_ptr secondUI; std::shared_ptr debugMinimap; diff --git a/src/logic/scripting/lua/lua_util.hpp b/src/logic/scripting/lua/lua_util.hpp index d78afaad1..fd41134a2 100644 --- a/src/logic/scripting/lua/lua_util.hpp +++ b/src/logic/scripting/lua/lua_util.hpp @@ -323,7 +323,7 @@ namespace lua { if (found == usertypeNames.end()) { log_error( - "usertype is not registred: " + std::string(typeid(T).name()) + "usertype is not registered: " + std::string(typeid(T).name()) ); } else if (getglobal(L, found->second)) { setmetatable(L); diff --git a/src/network/Sockets.cpp b/src/network/Sockets.cpp index 86972ae7e..7db81849c 100644 --- a/src/network/Sockets.cpp +++ b/src/network/Sockets.cpp @@ -161,7 +161,7 @@ public: state = ConnectionState::CLOSED; break; } else if (size < 0) { - logger.warning() << "an error ocurred while receiving from " + logger.warning() << "an error occurred while receiving from " << to_string(addr); auto error = handle_socket_error("recv(...) error"); closesocket(descriptor); diff --git a/src/presets/ParticlesPreset.hpp b/src/presets/ParticlesPreset.hpp index 63e075271..0b6ce20d8 100644 --- a/src/presets/ParticlesPreset.hpp +++ b/src/presets/ParticlesPreset.hpp @@ -8,10 +8,10 @@ #include "util/EnumMetadata.hpp" enum class ParticleSpawnShape { - /// @brief Coordinates are regulary distributed within + /// @brief Coordinates are regularly distributed within /// the volume of a ball. BALL = 0, - /// @brief Coordinates are regulary distributed on + /// @brief Coordinates are regularly distributed on /// a sphere. SPHERE, /// @brief Coordinates are uniform distributed within diff --git a/src/util/SmallHeap.hpp b/src/util/SmallHeap.hpp index 6ff8cf238..548cecfbd 100644 --- a/src/util/SmallHeap.hpp +++ b/src/util/SmallHeap.hpp @@ -19,7 +19,7 @@ namespace util { /// @brief Simple heap implementation for memory-optimal sparse array of /// small different structures - /// @note alignment is not impemented + /// @note alignment is not implemented /// (impractical in the context of scripting and memory consumption) /// @tparam Tindex entry index type /// @tparam Tsize entry size type diff --git a/src/world/files/WorldRegions.cpp b/src/world/files/WorldRegions.cpp index d96ed46fb..2355b35c5 100644 --- a/src/world/files/WorldRegions.cpp +++ b/src/world/files/WorldRegions.cpp @@ -323,7 +323,7 @@ void WorldRegions::processBlocksData(int x, int z, const BlockDataProc& func) { try { func(&blocksData, std::move(voxData)); } catch (const std::exception& err) { - logger.error() << "an error ocurred while processing blocks " + logger.error() << "an error occurred while processing blocks " "data in chunk (" << gx << ", " << gz << "): " << err.what(); blocksData = {}; }