-
Notifications
You must be signed in to change notification settings - Fork 161
Add imgui and item editor #267
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: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @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
🧠 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 AssistThe 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
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 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
|
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.
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.
Source Main 5.2/source/MuEditor/UI/Console/MuEditorConsoleUI.cpp
Outdated
Show resolved
Hide resolved
Source Main 5.2/source/DataHandler/ItemData/ItemDataExporter.cpp
Outdated
Show resolved
Hide resolved
Source Main 5.2/source/DataHandler/ItemData/ItemDataExporter.cpp
Outdated
Show resolved
Hide resolved
Source Main 5.2/source/MuEditor/UI/ItemEditor/ItemEditorColumns.cpp
Outdated
Show resolved
Hide resolved
Source Main 5.2/source/MuEditor/UI/ItemEditor/MuItemEditorUI.cpp
Outdated
Show resolved
Hide resolved
8c0d52f to
777ea64
Compare
|
/gemini review |
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.
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.
|
@sven-n we need to discuss if adding imgui as submodule is the way we want to go |
…oss-compiler debugging support.
…n = 1` for consistent wide character handling.
…e `_USE_32BIT_TIME_T`, and automate DLL copying post-build.
…eLists.txt` for editor support.
…tor-specific functionality.
… 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`.
…dio launch configuration file.
…d clarify IDE-specific steps.
…actices and improve readability.
…o detect and respond to new/removed `.cs` files dynamically.
…th cross-platform build and run instructions
…c discovery and improve maintainability.
|
i think going for submodule is the right choice :D |
- 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.
…roved readability and maintainability.
…place existing implementations.
…emDataExporter` for consistency and reusability
Skill editor
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
--editorcommand-line flag. This editor is conditionally compiled, ensuring zero overhead in release builds.wprintf,fwprintf, andg_ErrorReportoutput 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.