Skip to content

Conversation

@Mosch0512
Copy link
Contributor

@Mosch0512 Mosch0512 commented Jan 11, 2026

This pull request introduces a significant new feature: an in-game editor built with ImGui. The primary focus is on a robust Item Editor that allows real-time modification and export of game item attributes. Alongside this, a new internationalization system has been integrated to support multi-language content for both the game and the editor. The entire editor framework is designed with conditional compilation, ensuring that it is completely excluded from release builds to maintain performance and binary size. This change greatly enhances development and content creation workflows by providing powerful in-game tooling and a flexible translation system.

Highlights

  • In-Game Editor Integration: Integrated ImGui to provide a powerful in-game editor, accessible via F12 or the --editor command-line flag. This editor is conditionally compiled, ensuring zero overhead in release builds.
  • Comprehensive Item Editor: Introduced a new Item Editor within the ImGui framework, allowing for live editing of item attributes. It features search, filtering, configurable column visibility, and export capabilities to CSV and legacy S6E3 formats.
  • Internationalization (i18n) System: Implemented a new translation system supporting multiple languages (English, Spanish, Portuguese) across different domains: Game, Editor, and Metadata. Translations are loaded from JSON files, with editor-specific translations also being conditionally compiled.
  • Enhanced Console Logging: Redirected all wprintf, fwprintf, and g_ErrorReport output to a dual-panel ImGui console within the editor. This eliminates the need for a separate Windows console window and includes logging to a timestamped file.
  • Robust Input Management: Developed an input blocking mechanism that prevents game mouse and keyboard input from interfering with the ImGui editor UI when it is active or being hovered over.
  • Metadata-Driven Item Data Handling: Refactored item data structures and handling to use X-macros and metadata, providing a single source of truth for item field definitions. This simplifies UI generation, data loading/saving, and change tracking.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Mosch0512, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the development workflow by introducing a fully integrated, in-game editor. The core of this editor is a feature-rich item attribute modification tool, complemented by a robust, domain-based translation system for multi-language support. Crucially, all editor functionalities, including console output redirection, are designed for conditional compilation, ensuring that release builds remain lean and performant without any editor-related overhead.

Highlights

  • ImGui Integration: Added ImGui as a Git submodule and integrated its rendering and input handling into the game loop, specifically for debug builds, allowing for a powerful in-game editor.
  • Comprehensive Item Editor: Introduced a powerful in-game item editor that allows real-time modification of all item attributes, featuring sortable/filterable tables, column visibility toggles, index swapping, name editing, and export to CSV and S6E3 formats.
  • Advanced Translation System: Implemented a multi-language translation system supporting English, Spanish, and Portuguese, organized by domains (game, editor, metadata), with dynamic language switching and conditional compilation for _EDITOR builds.
  • Integrated Console Redirection: Redirected all game console output (including wprintf, fwprintf, and g_ConsoleDebug) to a dual-panel ImGui console within the editor, featuring selectable text, copy functionality, and log rotation.
  • Modular & Conditionally Compiled Architecture: Structured the editor into modular components (Core, UI, Console, Item Editor, Input Blocker) and ensured all editor-specific code is wrapped in #ifdef _EDITOR, resulting in zero overhead for release builds.
  • Item Data Refactoring with X-Macros: Centralized item attribute definitions using X-macros, enabling a single source of truth for item fields across game structures, file formats, and editor metadata, simplifying maintenance and ensuring consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is an impressive pull request that adds a significant amount of new functionality with the ImGui-based editor, item editor, and translation system. The overall architecture is well-thought-out, especially the use of X-macros for metadata and the conditional compilation to separate editor code from release builds. I've identified a few critical issues related to file I/O and performance, along with several suggestions to improve maintainability and adhere to modern C++ practices. Addressing these will make the new features more robust and easier to extend in the future.

@Mosch0512 Mosch0512 marked this pull request as draft January 11, 2026 03:48
@Mosch0512 Mosch0512 marked this pull request as ready for review January 11, 2026 12:18
@Mosch0512 Mosch0512 force-pushed the add-imgui-and-item-editor branch from 8c0d52f to 777ea64 Compare January 11, 2026 12:39
@sven-n
Copy link
Owner

sven-n commented Jan 11, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is an extensive and well-crafted pull request that introduces a powerful in-game editor using ImGui. The architecture is robust, featuring a clean separation of concerns, a data-driven UI for the item editor using X-Macros, and a comprehensive translation system. The conditional compilation strategy to exclude all editor code from release builds is implemented correctly, ensuring no performance overhead in production. I've identified a critical issue related to potential data corruption with legacy files, along with some minor maintainability improvements in the project file. Once these are addressed, this will be an excellent addition to the project.

@Mosch0512 Mosch0512 mentioned this pull request Jan 11, 2026
@Mosch0512
Copy link
Contributor Author

@sven-n we need to discuss if adding imgui as submodule is the way we want to go

…n = 1` for consistent wide character handling.
…e `_USE_32BIT_TIME_T`, and automate DLL copying post-build.
… paths, and streamline DLL copying logic in `CMakeLists.txt`.
…Lists.txt`. which get included in `Include.h`
…watch for C# changes, rebuild on updates, and link DLL to `Main`.
…o detect and respond to new/removed `.cs` files dynamically.
@Mosch0512 Mosch0512 marked this pull request as draft January 14, 2026 11:29
…th cross-platform build and run instructions
@Mosch0512
Copy link
Contributor Author

i think going for submodule is the right choice :D

Mosch0512 and others added 30 commits January 18, 2026 22:31
- Added 20 skill field translations to bin/Translations/en/metadata.json
  (field_Damage, field_Mana, field_AbilityGuage, field_Distance, etc.)
- Added 3 RequireDutyClass array field translations
- Added skill-specific buttons, messages, and labels to bin/Translations/en/editor.json
  (btn_save_skills, msg_save_skills_success, label_skill_editor_title, etc.)

Note: Some fields (field_Level, field_Strength, field_Dexterity) already existed
from item editor and are reused for skills.
- Created DataHandler/SkillData/SkillDataLoader.h/cpp
- Ported logic from ZzzInfomation.cpp::OpenSkillScript() (lines 245-294)
- Implements file size verification (88 bytes × 650 + 4 = 57,204 bytes)
- Checksum verification using GenerateCheckSum2() with magic key 0x5A18
- BuxConvert decryption for each skill entry
- UTF-8→UTF-16 string conversion for skill names via CMultiLanguage::ConvertFromUtf8()
- Logs to MuEditorConsoleUI instead of MessageBox for better editor UX
- Operates on global SkillAttribute array
- Created DataHandler/SkillData/SkillDataSaver.h/cpp
- Automatic .bak file creation before saving
- Change tracking system using X-macros for field-by-field comparison
- UTF-16→UTF-8 conversion for skill names via CMultiLanguage::ConvertToUtf8()
- BuxConvert encryption for each skill entry
- Checksum generation using GenerateCheckSum2() with magic key 0x5A18
- Detailed change log showing old→new values for modified fields
- Logs to MuEditorConsoleUI with success message and modification count
- Operates on global SkillAttribute array
- Created DataHandler/SkillData/SkillDataExporter.h/cpp
- X-macro driven CSV generation using SKILL_FIELDS_SIMPLE and SKILL_FIELDS_ARRAYS
- UTF-8 BOM for proper encoding in Excel/LibreOffice
- CSV header automatically generated from field definitions (31 columns)
- UTF-16→UTF-8 conversion for skill names via WideCharToMultiByte()
- Quote escaping for CSV safety (doubles quotes in skill names)
- Only exports skills with non-empty names
- Logs exported count to MuEditorConsoleUI
- Operates on global SkillAttribute array
- Created DataHandler/SkillData/SkillDataHandler.h/cpp
- Singleton pattern matching ItemDataHandler architecture
- Delegates Load() to SkillDataLoader (available in all builds)
- Delegates Save() and ExportToCsv() to SkillDataSaver/Exporter (editor-only)
- Provides data access methods: GetSkillAttributes(), GetSkillAttribute(), GetSkillCount()
- Bounds checking in GetSkillAttribute() returns nullptr for invalid indices
- Non-copyable singleton with deleted copy constructor and assignment operator
- Macro g_SkillDataHandler for convenient access
- Operates on global SkillAttribute array
- Modified ZzzOpenData.cpp to use g_SkillDataHandler.Load() instead of OpenSkillScript()
- Added include for DataHandler/SkillData/SkillDataHandler.h
- Applies to ALL builds (editor and release), not just editor builds
- SkillDataHandler provides cleaner abstraction and better error handling
- Editor builds log to console, release builds show MessageBox errors
- Old OpenSkillScript() function in ZzzInfomation.cpp now deprecated
- Consistent with ItemDataHandler migration pattern
- Created MuEditor/UI/SkillEditor/SkillEditorColumns.h/cpp
- X-macro-driven rendering using SkillFieldDescriptor
- Delegates to generic RenderFieldByDescriptor template from FieldMetadataHelper.h
- Type-specific rendering: Byte, Word, Int, DWord, Bool, WCharArray
- RenderIndexColumn for skill index swapping with bounds checking (MAX_SKILLS)
- UTF-8 conversion for skill names via WideCharToMultiByte/MultiByteToWideChar
- Logs all changes to MuEditorConsoleUI
- Works with global SkillAttribute array
- Supports DWORD fields for Distance and SkillBrand
- Created MuEditor/UI/SkillEditor/SkillEditorTable.h/cpp
- Case-insensitive skill name filtering with UTF-8 conversion
- ImGui table with resizable/reorderable/hideable/sortable columns
- Column freezing support for Index and Name columns
- Virtual scrolling with ImGuiListClipper for 650 skills
- Metadata-driven column setup using GetSkillFieldDescriptors()
- Delegates row rendering to CSkillEditorColumns
- Static RequestScrollToIndex() for navigation
- Works with MAX_SKILLS (650) instead of MAX_ITEM
- Updated SkillEditorColumns.cpp to include SkillEditorTable.h
- add GetSkillFieldDisplayName() function to SkillFieldMetadata.h
- Created MuEditor/UI/SkillEditor/SkillEditorActions.h/cpp
  - Save button calls g_SkillDataHandler.Save() with changelog tracking
  - Export CSV button calls g_SkillDataHandler.ExportToCsv()
  - Metadata-driven export helpers for CSV and readable formats
  - GetFieldValueAsString() supports all field types including DWord
  - UTF-8 conversion for skill names
- Created MuEditor/UI/SkillEditor/SkillEditorPopups.h/cpp
  - Success/failure popups for Save and Export CSV operations
  - Changelog display in save success popup
  - Static state management for popup visibility
  - RenderPopups() to display all active modal dialogs
- Created MuEditor/UI/SkillEditor/MuSkillEditorUI.h/cpp
- Singleton pattern with g_MuSkillEditorUI define
- Main ImGui window with translated "Skill Editor" title
- Case-insensitive search bar for filtering skills by name
- Column visibility menu with Select All/Unselect All buttons
- Freeze columns checkbox (freezes Index and Name columns)
- Window position clamping between toolbar and console
- Integrates SkillEditorTable, SkillEditorActions, SkillEditorPopups
- Default visible columns: Name, Level, Damage, Mana, Distance, Delay, Energy, Strength, Dexterity
- Saves/loads column preferences via MuEditorConfig
- Hover detection for input blocking
Add skill editor column visibility persistence to the configuration system.
Methods GetSkillEditorColumnVisibility() and SetSkillEditorColumnVisibility()
now allow MuSkillEditorUI to save/load column preferences.

Changes:
- Add GetSkillEditorColumnVisibility() and SetSkillEditorColumnVisibility() methods
- Add m_skillEditorColumnVisibility map member
- Update Load() to parse [SkillEditorColumnVisibility] section
- Update Save() to write [SkillEditorColumnVisibility] section
- Fix: Escape backslash in m_configPath ("MuEditor\\MuEditor.ini")
Add skill editor window rendering support to the editor core.
The skill editor window is now conditionally rendered when m_bShowSkillEditor is true.

Changes:
- Add m_bShowSkillEditor member and IsShowingSkillEditor() accessor
- Include MuSkillEditorUI.h header
- Initialize m_bShowSkillEditor to false in constructor
- Render skill editor window in Render() when m_bShowSkillEditor is true
- Save skill editor column preferences in Shutdown()
Add skill editor button to the main toolbar next to the Item Editor button.
The button toggles the skill editor window visibility.

Changes:
- Update RenderToolbar() and RenderToolbarFull() to accept showSkillEditor parameter
- Add "Skill Editor" button in toolbar after "Item Editor" button
- Update MuEditorCore to pass m_bShowSkillEditor to RenderToolbar()
- Update MuEditorCenterPaneUI to render skill editor window
… (Tagalog) translations for editor UI, metadata, and game placeholders.
… UI language selector with dynamic population based on available translations.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…support; fallback to default font if unavailable.
…emDataExporter` for consistency and reusability
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.

2 participants