diff --git a/Adventures in Lestoria Tests/EngineTests.cpp b/Adventures in Lestoria Tests/EngineTests.cpp index 41499a62..36bf6879 100644 --- a/Adventures in Lestoria Tests/EngineTests.cpp +++ b/Adventures in Lestoria Tests/EngineTests.cpp @@ -51,6 +51,23 @@ namespace EngineTests TEST_METHOD_INITIALIZE(PlayerInitialize){ testGame.reset(new AiL(true)); } + TEST_METHOD(StripColorTest){ + std::string noColCode{"Hello World!"}; + Assert::AreEqual("Hello World!"s,testGame->stripCol(noColCode),L"Function should not strip out any text when there's no color codes."); + std::string leadingColCode{"#FFFFFFHello World!"}; + Assert::AreEqual("Hello World!"s,testGame->stripCol(leadingColCode),L"Function should strip out all color codes."); + std::string extraColCodes{"#FFFFFFHello #00FF00World!"}; + Assert::AreEqual("Hello World!"s,testGame->stripCol(extraColCodes),L"Function should strip out all color codes."); + std::u32string u32noColCode{noColCode.begin(),noColCode.end()}; + std::u32string u32noColCodeResult{testGame->stripCol(u32noColCode)}; + Assert::AreEqual("Hello World!"s,std::string{u32noColCodeResult.begin(),u32noColCodeResult.end()},L"Function should not strip out any text when there's no color codes."); + std::u32string u32leadingColCode{noColCode.begin(),noColCode.end()}; + std::u32string u32leadingColCodeResult{testGame->stripCol(u32leadingColCode)}; + Assert::AreEqual("Hello World!"s,std::string{u32leadingColCodeResult.begin(),u32leadingColCodeResult.end()},L"Function should strip out all color codes."); + std::u32string u32extraColCodes{extraColCodes.begin(),extraColCodes.end()}; + std::u32string u32extraColCodesResult{testGame->stripCol(u32extraColCodes)}; + Assert::AreEqual("Hello World!"s,std::string{u32extraColCodesResult.begin(),u32extraColCodesResult.end()},L"Function should strip out all color codes."); + } TEST_METHOD(StripLeadingColorTest){ std::string noColCode{"Hello World!"}; Assert::AreEqual("Hello World!"s,testGame->stripLeadingCol(noColCode),L"Function should not strip out any text when there's no color codes."); @@ -72,7 +89,7 @@ namespace EngineTests Assert::AreEqual(WHITE.n,testGame->GetFinalRenderColor(WHITE,"Hello World!").n,L"Should use source color as there's no HTML color code."); Assert::AreEqual(BLUE.n,testGame->GetFinalRenderColor(WHITE,"#0000FFHello World!").n,L"Should use color in string since it has a leading HTML color code."); Assert::AreEqual(BLUE.n,testGame->GetFinalRenderColor(WHITE,"#0000FFHello #00FF00World!").n,L"Should use color in string since it has a leading HTML color code."); - Assert::AreEqual(WHITE.n,testGame->GetFinalRenderColor(WHITE,"Hello #00FF00World!").n,L"Should use color in string since it has a leading HTML color code."); + Assert::AreEqual(WHITE.n,testGame->GetFinalRenderColor(WHITE,"Hello #00FF00World!").n,L"Should use source color since there's no leading HTML color code."); std::string testStr{"Hello World!"}; std::u32string u32testStr{testStr.begin(),testStr.end()}; Assert::AreEqual(WHITE.n,testGame->GetFinalRenderColor(WHITE,testStr).n,L"Should use source color as there's no HTML color code."); @@ -84,7 +101,7 @@ namespace EngineTests Assert::AreEqual(BLUE.n,testGame->GetFinalRenderColor(WHITE,extraColorCodeStr).n,L"Should use color in string since it has a leading HTML color code."); std::string middleColorCodeStr{"Hello #00FF00World!"}; std::u32string u32middleColorCodeStr{middleColorCodeStr.begin(),middleColorCodeStr.end()}; - Assert::AreEqual(WHITE.n,testGame->GetFinalRenderColor(WHITE,middleColorCodeStr).n,L"Should use color in string since it has a leading HTML color code."); + Assert::AreEqual(WHITE.n,testGame->GetFinalRenderColor(WHITE,middleColorCodeStr).n,L"Should use source color since there's no leading HTML color code."); } }; } \ No newline at end of file diff --git a/Adventures in Lestoria/Item.h b/Adventures in Lestoria/Item.h index 5e7e5de6..e2652de6 100644 --- a/Adventures in Lestoria/Item.h +++ b/Adventures in Lestoria/Item.h @@ -188,7 +188,6 @@ private: Stats randomizedStats; bool locked=false; std::optionalenchant; - Pixel displayNameColor{WHITE}; void SetAmt(uint32_t newAmt); static ItemEnhancementFunctionPrimingData enhanceFunctionPrimed; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 04fd7b7c..176a0b61 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 3 -#define VERSION_BUILD 10604 +#define VERSION_BUILD 10607 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index d79ef1e9..065cebd8 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ