Skip to content

Conversation

@Mosch0512
Copy link
Owner

No description provided.

Mosch0512 and others added 30 commits January 24, 2026 13:07
…IBUTE

- Create GameData/SkillData/SkillStructs.h with SKILL_ATTRIBUTE definition
- Remove duplicate SKILL_ATTRIBUTE from _struct.h, replace with include
- SkillStructs.h is now single source of truth for ALL builds (editor and release)
- Keep SKILL_ATTRIBUTE_FILE in _struct.h for binary file I/O
- Establishes pattern: all game data structures will be organized in GameData/ directory

This modernizes the codebase structure and eliminates duplicate definitions.
- Create SkillFieldDefs.h with X-macro definitions for all SKILL_ATTRIBUTE fields
- Define 20 simple fields (Level, Damage, Mana, Distance, etc.)
- Define 10 array fields (RequireDutyClass, RequireClass)
- Include 2 DWORD fields (Distance, SkillBrand) using DWord type from Commit 1
- Add type helper macros for C++ type conversion
- Total: 30 editable fields + Name field (31 columns in skill editor table)

This is the single source of truth for skill field metadata.
- Created GameData/Common/FieldMetadataHelper.h with shared EFieldType enum,
  generic FieldDescriptor<TStruct> template, and RenderFieldByDescriptor() function
- Refactored GameData/ItemData/ItemFieldMetadata.h (51% code reduction, 112 → 55 lines)
- Created GameData/SkillData/SkillFieldMetadata.h using shared infrastructure
- Added FIELD_TYPE_DWord to GameData/ItemData/ItemFieldDefs.h
- Updated 9 ItemEditor files to use explicit ItemFieldDescriptor type
- Fixed friend declaration to match generic template signature with 8 parameters

Eliminates ~80 lines of duplication, establishes single source of truth for
field metadata patterns, and prepares for future editors without code duplication.
- 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
- 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 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.
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
@gemini-code-assist
Copy link

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 introduces a comprehensive skill editor feature to the MuEditor, providing a robust and user-friendly interface for managing game skills. The implementation leverages a newly developed metadata-driven architecture, which streamlines field definition and rendering for both skills and items, enhancing code reusability and future extensibility. Significant effort has also been put into expanding internationalization, with new translation files and improved font handling to support a global user base. The underlying data handling for skills has been refactored into a modular system, ensuring reliable loading, saving, and exporting of skill attributes.

Highlights

  • Skill Editor Implementation: A complete skill editor UI has been added, allowing users to view, search, and modify skill attributes, mirroring the functionality of the existing item editor.
  • Metadata-Driven Architecture: Both the new skill editor and the existing item editor now utilize a shared, generic metadata system (FieldMetadataHelper.h) and X-macros for defining and rendering fields, promoting code reuse, consistency, and maintainability across data editors.
  • Internationalization (i18n) Expansion: Extensive translation support has been added for the new skill editor UI elements and metadata fields across multiple languages (German, Indonesian, Polish, Russian, Tagalog), and existing translations were updated to include new skill-related strings.
  • Robust Data Handling: Dedicated classes for loading, saving, and exporting skill data (including legacy format support, checksum verification, and CSV export) have been introduced, centralizing and modularizing skill data management.
  • Enhanced Font Support: The core editor initialization now includes advanced font loading logic to support a wider range of Unicode characters, improving internationalization for the UI across different operating systems.

🧠 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

@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 pull request introduces a substantial new feature: the Skill Editor. The implementation is well-structured, largely mirroring the existing Item Editor, which is a good approach for consistency. A major positive is the refactoring of metadata handling into a generic helper (FieldMetadataHelper.h), which will make future editor additions much easier. The PR also adds extensive font loading capabilities for better internationalization support.

However, there are a few areas for improvement that should be addressed:

  • A security regression was introduced by replacing safe swprintf_s calls with unsafe swprintf calls, creating potential buffer overflow vulnerabilities.
  • There are inconsistencies in string handling; some new code uses C-style manipulation while other parts use safer std::string or the new StringUtils helper. Adopting the helper universally would improve code quality.
  • Some new code patterns, like long strcmp chains, could be made more maintainable.

Overall, it's a solid feature addition with good refactoring, but the identified issues, especially the security concern, should be addressed before merging.

@Mosch0512
Copy link
Owner Author

/gemini review

Copy link

@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 pull request introduces a comprehensive Skill Editor feature, which is a significant and well-executed addition. The implementation mirrors the existing Item Editor, ensuring consistency. I'm particularly impressed with the refactoring efforts to create generic helpers for metadata-driven UI (FieldMetadataHelper.h) and a robust, common data backup system (CommonDataSaver.cpp). The improved font loading for internationalization is also a great enhancement.

My review includes a couple of minor suggestions to improve code clarity and consistency, particularly around logging in the new Skill Editor UI components and cleaning up a confusing comment in the Item Editor code. Overall, this is a high-quality contribution.

@Mosch0512 Mosch0512 closed this Jan 25, 2026
@Mosch0512 Mosch0512 deleted the feature-skill-editor branch January 25, 2026 22:04
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