Skip to content

eui/message: Implemented MessageString#2

Open
Muz-dev wants to merge 1 commit intoopen-ead:mainfrom
Muz-dev:euiMessageString
Open

eui/message: Implemented MessageString#2
Muz-dev wants to merge 1 commit intoopen-ead:mainfrom
Muz-dev:euiMessageString

Conversation

@Muz-dev
Copy link

@Muz-dev Muz-dev commented Oct 5, 2025

I also added Globbing to the CMake Stuff.
I didn't impl that one function because I couldn't get it to match. If anybody has any idea then that would be great.


This change is Reviewable

Copy link

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

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

@MonsterDruide1 reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 9 unresolved discussions (waiting on @Muz-dev)


a discussion (no related file):
For header and source: Replace char16_t with char16 from sead


CMakeLists.txt line 4 at r1 (raw file):

file(GLOB_RECURSE HEADER_FILES "include/*.h")
file(GLOB_RECURSE SRC "src/*.cpp")

Suggestion:

file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS include/*.h)
file(GLOB_RECURSE SRC CONFIGURE_DEPENDS src/*.cpp)

CMakeLists.txt line 21 at r1 (raw file):

target_link_libraries(eui PUBLIC agl)
if(NOT TARGET sead)
	add_subdirectory(../sead)

Suggestion:

  add_subdirectory(../sead)

CMakeLists.txt line 24 at r1 (raw file):

endif()

target_link_libraries(eui PUBLIC sead)

Suggestion:

endif()
target_link_libraries(eui PUBLIC sead)

include/message/euiMessageString.h line 12 at r1 (raw file):

    class iterator {
    public:
        iterator(const char16_t* ptr, u32 index = 0) : mPtr(ptr), mIndex(index) {}

Suggestion:

iterator(const char16_t* ptr, s32 index = 0) : mPtr(ptr), mIndex(index) {}

include/message/euiMessageString.h line 39 at r1 (raw file):

private:
    const char16_t* mStr;
    u32 mStrLen;

Suggestion:

s32 mStrLen;

src/message/euiMessageString.cpp line 10 at r1 (raw file):

    mStr = nullptr;
    mStrLen = 0;
}

Move default values to header

Suggestion:

MessageString::MessageString() = default;

src/message/euiMessageString.cpp line 30 at r1 (raw file):

    mStr = str.getStr();
    mStrLen = str.getStrLen();
}

Can all of these use initializer lists?
MessageString(s32 len, const char16_t* str) : mStr(str), mStrLen(len) {}

Code quote:

MessageString::MessageString(s32 len, const char16_t* str) {
    mStr = str;
    mStrLen = len;
}

MessageString::MessageString(const char16_t* str, const char16_t* str2) {
    mStr = str;
    mStrLen = (str2 - str);
}

MessageString::MessageString(const sead::SafeStringBase<char16_t>& str) {
    mStr = str.cstr();
    mStrLen = str.calcLength();
}

MessageString::MessageString(const MessageString& str) {
    mStr = str.getStr();
    mStrLen = str.getStrLen();
}

src/message/euiMessageString.cpp line 57 at r1 (raw file):

        mStr,
        size
    };

Suggestion:

    return {
        mStr,
        sead::Mathi::clampMax(len, mStrLen)
    };

@german77
Copy link

german77 commented Feb 7, 2026

GLOB_RECURSE has proven to give issues with NEX as it doesn't recreate the file list on subprojects.

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.

3 participants