Skip to content

Commit

Permalink
Fix setting screen crash
Browse files Browse the repository at this point in the history
  • Loading branch information
DisabledMallis committed Dec 14, 2023
1 parent e8d836c commit 1a4e9d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ if(MSVC)
$<$<CONFIG:>:/MT> #---------|
$<$<CONFIG:Debug>:/MTd> #---|-- Statically link the runtime libraries
$<$<CONFIG:Release>:/MT> #--|
$<$<CONFIG:RelWithDebInfo>:/MT> #--|
)
endif()

Expand Down
8 changes: 4 additions & 4 deletions NKHook5/Classes/CTextObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ namespace NKHook5::Classes
CTextObject() {
ThisConstruct<Sigs::CTextObject_CCTOR_A>(this);
}
CTextObject(Vec2F position, boost::shared_ptr<CFont>& font, std::string text) {
ThisConstruct<Sigs::CTextObject_CCTOR_B>(this, position, font, std::move(text));
CTextObject(const Vec2F& position, const boost::shared_ptr<CFont>& font, const nfw::string& text) {
ThisConstruct<Sigs::CTextObject_CCTOR_B>(this, &position, &font, &text);
}
CTextObject(boost::shared_ptr<CFont>& font, std::string text) {
ThisConstruct<Sigs::CTextObject_CCTOR_C>(this, font, std::move(text));
CTextObject(const boost::shared_ptr<CFont>& font, const nfw::string& text) {
ThisConstruct<Sigs::CTextObject_CCTOR_C>(this, &font, &text);
}

~CTextObject() override = default;
Expand Down
4 changes: 2 additions & 2 deletions NKHook5/Patches/CSettingsScreen/InitLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ namespace NKHook5::Patches::CSettingsScreen
PLH::FnCast(o_func, &cb_hook)(self, pad, param_1);

//Add the NKHook version information text
std::string verInfoString("NKHook5 v" STRING(NKHOOK_BUILD_TAG) " (" STRING(NKHOOK_BUILD_VERSION) ")");
auto* verInfoText = new Classes::CTextObject({ 160, -100 }, self->mScreenFont, verInfoString);
nfw::string verInfoString("NKHook5 v" STRING(NKHOOK_BUILD_TAG) " (" STRING(NKHOOK_BUILD_VERSION) ")");
auto* verInfoText = new Classes::CTextObject({160, -100}, self->mScreenFont, verInfoString);
Classes::Vec2F textScale(0.5, 0.5);
verInfoText->Scale(textScale);
verInfoText->SetRotation(40);
Expand Down

0 comments on commit 1a4e9d2

Please sign in to comment.