-
Notifications
You must be signed in to change notification settings - Fork 23
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
Implement MAKE_ITEM_GROUP handling. #267
Open
xGuTeK
wants to merge
5
commits into
master
Choose a base branch
from
item_group
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refactored N3Utils.h to introduce various platform-agnostic string utilities, improving code consistency and cross-platform compatibility. Changes include: - Added concepts for CharType, StringType, StringViewType, and PathType. - Introduced case-insensitive comparison functions (iequals, istarts_with, iends_with) for strings and filesystem paths, using a custom ToLower functor to handle case transformations across char types. - Defined platform-specific mappings for string functions, improving portability across Windows, macOS, and Linux. - Updated comments and instructions for verifying compatibility with C++20 compilers (GCC, Clang, MSVC) on godbolt.org. These improvements enhance code reuse and ensure compatibility across multiple platforms, supporting the goal of a more robust, standardized codebase.
This commit introduces `fs::pathx`, a custom wrapper around `std::filesystem::path`, to address limitations in the standard implementation. This extended class provides additional functionality and optimizations while maintaining compatibility with existing code. Key features include: - **Automatic Path Normalization**: FS_AUTO_NORMALIZE automatically standardizes path separators during concatenation with `operator/` or `operator/=`, simplifying path handling, especially on Windows. - **Extended Path Manipulation**: Added functions for case-insensitive path comparisons (`icontains`), relative path construction, and converting paths to lowercase, improving flexibility in handling paths. - **Operator Overloading**: Implemented `operator/` and `operator+=` to streamline path concatenation, along with other convenient overloads. - **Temporary File Creation**: Added `mktemp_file`, a function for creating temporary files with customizable prefixes, suffixes, and directory locations. - **Namespace Redirection**: The new class uses namespace redirection and aliasing to remain unobtrusive in the codebase, making it behave like a native `std::filesystem::path` object. These enhancements offer a more versatile and efficient approach to path management, particularly on Windows, and allow for a cleaner, more maintainable codebase. This approach should remain effective until future standard updates to `std::filesystem` address current limitations.
Added a console log output in CLogWriter::Write to display log messages directly in the console in addition to file output. This enhancement helps improve real-time debugging by making logs immediately visible.
This commit replaces numerous platform-specific WinAPI functions and custom implementations with C++17’s std::filesystem, streamlining and modernizing path and file management across the codebase. The refactor enhances code readability, reduces platform-specific dependencies, and improves cross-platform compatibility. Summary of changes: - **Path Handling**: Replaced custom and WinAPI-based path handling across files, standardizing operations like path concatenation, normalization, and extraction using std::filesystem methods. - **File I/O Operations**: Migrated file reading, writing, and existence checks to use std::filesystem, ensuring cleaner and more uniform file operations across platforms. - **Legacy Code Removal**: Removed obsolete components such as `CAVIPlayer` and other WinAPI-based implementations no longer required with std::filesystem support. - **Bug Fixes**: Addressed existing path-related bugs and inconsistencies that stemmed from the manual path handling methods previously used. - **Code Cleanup**: Deleted unnecessary code comments and unused functions, including those related to deprecated path handling, for a cleaner, more maintainable codebase. This update provides a solid foundation for improved cross-platform support and prepares the codebase for future C++ standard upgrades.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#247
Description
This PR introduces support for MAKE_ITEM_GROUP, enhancing the existing drop system. Previously, only up to 5 items could be directly assigned as drops. With this PR, you can now assign a group of up to 30 items. When the group is selected as a drop, the system will randomly choose one item from within that group. Item groups are managed in the MAKE_ITEM_GROUP table.
Instructions for Use:
Creating an Item Group:
Assigning an Item Group to a Monster:
💔 Thank you!