Variable enchant attributes show up in a different color in their descriptions. Release Build 10608.

mac-build
sigonasr2 7 months ago
parent d208772107
commit cd986d16fa
  1. 6
      Adventures in Lestoria/ItemEnchant.cpp
  2. 2
      Adventures in Lestoria/ItemEnchant.h
  3. 2
      Adventures in Lestoria/Version.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -44,10 +44,12 @@ All rights reserved.
#include <algorithm>
#include "util.h"
#include "AdventuresInLestoria.h"
#include <ranges>
INCLUDE_game
INCLUDE_DATA
const Pixel ItemEnchantInfo::enchantAttributeCol{0x00DFE2};
std::unordered_map<std::string,ItemEnchantInfo>ItemEnchantInfo::ENCHANT_LIST;
std::unordered_map<ItemEnchantInfo::ItemEnchantCategory,ItemEnchantInfo::ItemEnchantCategoryData>ItemEnchantInfo::ENCHANT_CATEGORIES;
@ -117,7 +119,7 @@ void ItemEnchantInfo::Initialize(){
const std::string wrappedConfigStr{std::vformat("{{{}}}",std::make_format_args(configName))};
size_t configValInd{enchantDescription.find(wrappedConfigStr)};
if(configValInd==std::string::npos)continue;
std::string formattedFloat{std::format("{}",val)};
std::string formattedFloat{std::format("{}{}#FFFFFF",ItemEnchantInfo::enchantAttributeCol.toHTMLColorCode(),val)};
enchantDescription=enchantDescription.replace(configValInd,wrappedConfigStr.length(),formattedFloat);
}
@ -169,7 +171,7 @@ ItemEnchant::ItemEnchant(const std::string_view enchantName)
const std::string wrappedConfigStr{std::vformat("{{{}}}",std::make_format_args(attr.ActualName()))};
size_t configValInd{description.find(wrappedConfigStr)};
if(configValInd==std::string::npos)continue;
std::string formattedFloat{std::format("{}",val)};
std::string formattedFloat{std::format("{}{}#FFFFFF",ItemEnchantInfo::enchantAttributeCol.toHTMLColorCode(),val)};
description=description.replace(configValInd,wrappedConfigStr.length(),formattedFloat);
}
}

@ -56,6 +56,8 @@ public:
UNIQUE,
};
const static Pixel enchantAttributeCol;
static void Initialize();
const static ItemEnchantInfo&GetEnchant(const std::string_view enchantName);
const static std::unordered_map<std::string,ItemEnchantInfo>&GetEnchants();

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 3
#define VERSION_BUILD 10607
#define VERSION_BUILD 10608
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save