-
Notifications
You must be signed in to change notification settings - Fork 39
Editor and SDK Update: Unicode Text, Actor Inventory, Rooms, Outfits, Randomizer, UI Refinements, and Crash Fixes #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…nd rename it to result
… menus to prevent game crashes
…tead and remove unnecessary std::string conversion and compare ZString keys directly
…y-based actor names
…ame and s_ButtonId to s_ActorSelectableId
… search input above the list
…use in game and remove s_SelectedID
…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
|
when merge :RoccoSmile: |
There was a problem hiding this 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.
OrfeasZ
left a comment
There was a problem hiding this 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()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Mods/SkipIntro/Src/SkipIntro.cpp
Outdated
| 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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
…esToRuntimeResourceIds
…et_Camera_Tagging
New Features
SItemConfigZItemConfigDescriptorZHM5ItemWeaponclassEditor & UI Improvements
InputWithAutocomplete:Refactoring & Cleanup
NPC->Actor) and internal fields.std::vectorwithstd::unordered_setform_PendingDynamicEntitiesand ensured proper cleanup when entities are deleted.
ZEntityImpl::GetIDmarked constZDynamicObject::ToStringnow takes a reference parameterSDK / Engine-Level Changes