Skip to content

Conversation

@pavledev
Copy link
Contributor

New Features

  • Added UTF-8 text rendering support for 3D text.
  • Implemented full actor inventory management in the Actors menu:
    • Display inventory items
    • Add and remove items
    • Select main weapon
  • Introduced editor-style freecam setting with persistent checkbox state.
  • Added new item-related structures and types:
    • SItemConfig
    • Extended ZItemConfigDescriptor
    • New ZHM5ItemWeapon class

Editor & UI Improvements

  • Menus (Items, Actors, Debug Channels) are now independent of editor window visibility.
  • Improved alignment and layout consistency across multiple UI sections.
  • Enhanced InputWithAutocomplete:
    • Uses type registry directly
    • Supports optional filter callbacks
    • Updated documentation
  • Actor selection UX improvements:
    • Automatic scrolling to selected actor
    • Contextual selection button in Entity Properties
  • Reorganized and clarified CharSet Character Type controls.

Refactoring & Cleanup

  • Refactored actor-related naming (NPC -> Actor) and internal fields.
  • Replaced std::vector with std::unordered_set for m_PendingDynamicEntities
    and ensured proper cleanup when entities are deleted.
  • Removed redundant prefixes and unused variables.
  • Improved const-correctness and API clarity:
    • ZEntityImpl::GetID marked const
    • ZDynamicObject::ToString now takes a reference parameter

SDK / Engine-Level Changes

  • Added Unicode-aware string handling and diacritic-insensitive search.
  • Included missing headers and fixed dependency ordering.
  • Adjusted virtual destructors where required for correctness.

…tead and remove unnecessary std::string conversion and compare ZString keys directly
…s menu when an actor entity or its sub-entity is selected
…ng and selection and move CharSet Character Type combobox above the autocomplete input
…utfit” button, change its ID to ##CharSetCharacterType3, switch to s_CurrentCharSetCharacterType3, and remove m_GlobalOutfitKit checks from the ##CharSetCharacterType2 and ##CharSetCharacterType3 comboboxes
@thecatontheceiling
Copy link

when merge :RoccoSmile:

@pavledev pavledev changed the title Editor and SDK Improvements: Unicode Text, Actor Inventory, UI Refinements and Crash Fixes Editor and SDK Update: Unicode Text, Actor Inventory, Rooms, Outfits, Randomizer, UI Refinements, and Crash Fixes Jan 3, 2026
@OrfeasZ OrfeasZ requested a review from Copilot January 3, 2026 16:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces significant enhancements to the ZHM Mod SDK and Editor, focusing on Unicode text rendering support, actor inventory management, and new features for outfit and item randomization. The changes include refactored internal APIs, new SDK functions for resource management, and comprehensive UI improvements.

Key Changes:

  • Added UTF-8 text rendering support for both 2D ImGui and 3D in-game text with expanded character ranges
  • Implemented actor inventory management system with full item CRUD operations
  • Introduced new mods: Randomizer (item/weapon randomization) and Outfits (dynamic outfit loading from other scenes)
  • Enhanced Editor with rooms menu, improved property editors with copy-to-clipboard functionality, and actor inventory management
  • Refactored hook signatures (OnLoadScene now returns bool instead of void) and internal data structures

Reviewed changes

Copilot reviewed 81 out of 82 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ZHMModSDK/Src/ResourceLoading.cpp Adds UnmountChunk function for unmounting resource packages with optional remounting
ZHMModSDK/Src/Rendering/Renderers/ImGuiRenderer.cpp Extends font Unicode ranges to include Latin-1 Supplement and punctuation
ZHMModSDK/Src/Rendering/Renderers/DirectXTKRenderer.cpp Refactors 3D text rendering to support UTF-8 encoding with improved code clarity
ZHMModSDK/Src/ModSDK.h/cpp Changes OnLoadScene hook return type from void to bool
ZHMModSDK/Src/Hooks.cpp/h Adds new hooks for scene creation, level management, inventory, and item spawning
ZHMModSDK/Src/Globals.cpp/h Adds global pointers for TargetManager, RoomManager, UIMapTrackerManager, ContractsManager
ZHMModSDK/Include/Util/StringUtils.h Implements UTF-8 string utilities with diacritic-insensitive search
ZHMModSDK/Include/Util/ResourceUtils.h Adds chunk index parsing from resource package paths
ZHMModSDK/Include/Util/ImGuiUtils.h Enhances InputWithAutocomplete with optional filter callback support
ZHMModSDK/Include/Glacier/* Adds new entity classes and structures for items, rooms, outfits, and inventory
Mods/Randomizer/* New mod for randomizing items and weapons in world, stash, player, and actor inventories
Mods/Outfits/* New mod for loading outfit bricks from other scenes with chunk management
Mods/Player/Src/Player.cpp Improves outfit selection UI with autocomplete and better error handling
Mods/Editor/Src/* Adds rooms menu, inventory management, copy-to-clipboard for properties, and actor selection improvements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Owner

@OrfeasZ OrfeasZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial notes from a quick run through. I haven't looked at everything yet, so more to come once you've added the rest of your changes.

Globals::ResourceManager->LoadResource(s_JsonResourcePtr, s_JsonReferenceInfo.rid);

if (!s_JsonReferenceInfo.resourceData) {
Logger::Error("{:016x} JSON resource isn't installed!", s_JsonReferenceInfo.rid.GetID());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what cases would this happen? Could we call something like ResourceManager::Update to get it to load?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it could happen. That check can be removed

s_CodeNameHint = s_CodeNameHint.substr(s_CodeNameHint.find_last_of("/") + 1);
}

s_Location = m_CodeNameHintToSceneName[s_CodeNameHint];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if s_CodeNameHint doesn't exist in the map?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it to use iterator and set ERR_UNKNOWN_LOCATION if s_CodeNameHint doesn't exist in map

Comment on lines 11 to 17
p_Hook->CallOriginal(th, result);

for (auto& s_Brick : p_parameters.m_aAdditionalBrickResources)
Logger::Debug("+ With brick: {}", s_Brick);
if (result == "assembly:/_PRO/Scenes/Frontend/Boot.entity") {
result = "assembly:/_PRO/Scenes/Frontend/MainMenu.entity";
}

if (p_parameters.m_SceneResource == "assembly:/_PRO/Scenes/Frontend/Boot.entity")
p_parameters.m_SceneResource = "assembly:/_PRO/Scenes/Frontend/MainMenu.entity";

return HookResult<void>(HookAction::Continue());
return HookResult<ZString*>(HookAction::Return(), &result);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A side-effect of this change is that if this mod is enabled, no other mod will be able to use the ZEngineAppCommon_GetBootScene hook (depending on load order), since it calls the original function and returns. That's not necessarily a bad thing, but something to note.

namespace Util {
class ResourceUtils {
public:
static bool TryParseChunkIndexFromResourcePackagePath(const ZString& s_ResourcePackagePath, uint32_t& p_OutChunkIndex) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could use some comments to explain what the difference between the two functions is (an example of what to call them with would be helpful too). Could also return an std::optional<uint32_t> instead of using an out parameter.

@@ -0,0 +1,3 @@
#include "Glacier/ZPrimitives.h"

const ZGuid ZGuid::Empty {}; No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be inline?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get error "incomplete type "const ZGuid" is not allowed" if I declare it as inline in ZGuid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants