Integrate display color provided in Item Enchant configuration to show up for enchanted items displayed in menus and their descriptions. Release Build 10737.
This commit is contained in:
parent
0e3d57be24
commit
00e22877c4
@ -769,7 +769,7 @@ const std::string Item::Description(CompactText compact)const{
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
@ -1459,6 +1459,6 @@ const bool Item::HasEnchant()const{
|
||||
}
|
||||
const Pixel Item::GetDisplayNameColor()const{
|
||||
Pixel col{WHITE};
|
||||
if(HasEnchant())col=0xD8BDFF;
|
||||
if(HasEnchant())col=enchant.value().DisplayCol();
|
||||
return col;
|
||||
}
|
@ -268,3 +268,7 @@ std::map<ItemAttribute,float>::const_iterator ItemEnchant::begin()const{
|
||||
std::map<ItemAttribute,float>::const_iterator ItemEnchant::end()const{
|
||||
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;
|
||||
std::map<ItemAttribute,float>::const_iterator begin()const;
|
||||
std::map<ItemAttribute,float>::const_iterator end()const;
|
||||
const Pixel&DisplayCol()const;
|
||||
private:
|
||||
void UpdateDescription();
|
||||
const ItemEnchantInfo&GetEnchantInfo()const;
|
||||
|
@ -1920,8 +1920,7 @@ const bool Player::HasEnchant(const std::string_view enchantName)const{
|
||||
}
|
||||
|
||||
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.name==GetRightClickAbility().name)return;
|
||||
if(ability.itemAbility||ability.name==GetRightClickAbility().name)return;
|
||||
if(HasEnchant("Wizard's Soul")){
|
||||
const auto ReduceCooldown=[this,&ability](Ability&a){
|
||||
if(ability.name==a.name)return;
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 3
|
||||
#define VERSION_BUILD 10729
|
||||
#define VERSION_BUILD 10737
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user