Variable enchant attributes show up in a different color in their descriptions. Release Build 10608.
This commit is contained in:
parent
d208772107
commit
cd986d16fa
@ -44,10 +44,12 @@ All rights reserved.
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "AdventuresInLestoria.h"
|
#include "AdventuresInLestoria.h"
|
||||||
|
#include <ranges>
|
||||||
|
|
||||||
INCLUDE_game
|
INCLUDE_game
|
||||||
INCLUDE_DATA
|
INCLUDE_DATA
|
||||||
|
|
||||||
|
const Pixel ItemEnchantInfo::enchantAttributeCol{0x00DFE2};
|
||||||
std::unordered_map<std::string,ItemEnchantInfo>ItemEnchantInfo::ENCHANT_LIST;
|
std::unordered_map<std::string,ItemEnchantInfo>ItemEnchantInfo::ENCHANT_LIST;
|
||||||
std::unordered_map<ItemEnchantInfo::ItemEnchantCategory,ItemEnchantInfo::ItemEnchantCategoryData>ItemEnchantInfo::ENCHANT_CATEGORIES;
|
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))};
|
const std::string wrappedConfigStr{std::vformat("{{{}}}",std::make_format_args(configName))};
|
||||||
size_t configValInd{enchantDescription.find(wrappedConfigStr)};
|
size_t configValInd{enchantDescription.find(wrappedConfigStr)};
|
||||||
if(configValInd==std::string::npos)continue;
|
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);
|
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()))};
|
const std::string wrappedConfigStr{std::vformat("{{{}}}",std::make_format_args(attr.ActualName()))};
|
||||||
size_t configValInd{description.find(wrappedConfigStr)};
|
size_t configValInd{description.find(wrappedConfigStr)};
|
||||||
if(configValInd==std::string::npos)continue;
|
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);
|
description=description.replace(configValInd,wrappedConfigStr.length(),formattedFloat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,8 @@ public:
|
|||||||
UNIQUE,
|
UNIQUE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const static Pixel enchantAttributeCol;
|
||||||
|
|
||||||
static void Initialize();
|
static void Initialize();
|
||||||
const static ItemEnchantInfo&GetEnchant(const std::string_view enchantName);
|
const static ItemEnchantInfo&GetEnchant(const std::string_view enchantName);
|
||||||
const static std::unordered_map<std::string,ItemEnchantInfo>&GetEnchants();
|
const static std::unordered_map<std::string,ItemEnchantInfo>&GetEnchants();
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 3
|
#define VERSION_PATCH 3
|
||||||
#define VERSION_BUILD 10607
|
#define VERSION_BUILD 10608
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user