Integrate display color provided in Item Enchant configuration to show up for enchanted items displayed in menus and their descriptions. Release Build 10737.

mac-build
sigonasr2 4 months ago
parent 0e3d57be24
commit 00e22877c4
  1. 4
      Adventures in Lestoria/Item.cpp
  2. 4
      Adventures in Lestoria/ItemEnchant.cpp
  3. 1
      Adventures in Lestoria/ItemEnchant.h
  4. 3
      Adventures in Lestoria/Player.cpp
  5. 2
      Adventures in Lestoria/Version.h
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -769,7 +769,7 @@ const std::string Item::Description(CompactText compact)const{
} }
} }
if(HasEnchant()){ if(HasEnchant()){
description+=std::format("\n#D48EFF{}\n#E0E0E0{}#FFFFFF",GetEnchant().value().Name(),GetEnchant().value().Description()); description+=std::format("\n{}{}\n#E0E0E0{}#FFFFFF",GetEnchant().value().DisplayCol().toHTMLColorCode(),GetEnchant().value().Name(),GetEnchant().value().Description());
} }
return description; return description;
} }
@ -1459,6 +1459,6 @@ const bool Item::HasEnchant()const{
} }
const Pixel Item::GetDisplayNameColor()const{ const Pixel Item::GetDisplayNameColor()const{
Pixel col{WHITE}; Pixel col{WHITE};
if(HasEnchant())col=0xD8BDFF; if(HasEnchant())col=enchant.value().DisplayCol();
return col; return col;
} }

@ -267,4 +267,8 @@ std::map<ItemAttribute,float>::const_iterator ItemEnchant::begin()const{
} }
std::map<ItemAttribute,float>::const_iterator ItemEnchant::end()const{ std::map<ItemAttribute,float>::const_iterator ItemEnchant::end()const{
return stats.end(); return stats.end();
}
const Pixel&ItemEnchant::DisplayCol()const{
return ItemEnchantInfo::GetEnchant(Name()).enchantAttributeCol;
} }

@ -108,6 +108,7 @@ public:
const float&GetAttribute(const std::string_view attr)const; const float&GetAttribute(const std::string_view attr)const;
std::map<ItemAttribute,float>::const_iterator begin()const; std::map<ItemAttribute,float>::const_iterator begin()const;
std::map<ItemAttribute,float>::const_iterator end()const; std::map<ItemAttribute,float>::const_iterator end()const;
const Pixel&DisplayCol()const;
private: private:
void UpdateDescription(); void UpdateDescription();
const ItemEnchantInfo&GetEnchantInfo()const; const ItemEnchantInfo&GetEnchantInfo()const;

@ -1920,8 +1920,7 @@ const bool Player::HasEnchant(const std::string_view enchantName)const{
} }
void Player::OnAbilityUse(const Ability&ability){ void Player::OnAbilityUse(const Ability&ability){
if(ability.itemAbility)ERR(std::format("WARNING! Somehow triggered an item ability called {} in OnAbilityUse Callback function. THIS SHOULD NOT BE HAPPENING!",ability.name)); if(ability.itemAbility||ability.name==GetRightClickAbility().name)return;
if(ability.name==GetRightClickAbility().name)return;
if(HasEnchant("Wizard's Soul")){ if(HasEnchant("Wizard's Soul")){
const auto ReduceCooldown=[this,&ability](Ability&a){ const auto ReduceCooldown=[this,&ability](Ability&a){
if(ability.name==a.name)return; if(ability.name==a.name)return;

@ -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 10729 #define VERSION_BUILD 10737
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save