diff --git a/Crawler/Ability.cpp b/Crawler/Ability.cpp index b15cffae..ba0b7ca6 100644 --- a/Crawler/Ability.cpp +++ b/Crawler/Ability.cpp @@ -14,5 +14,5 @@ InputGroup Ability::DEFAULT; Ability::Ability() :name("???"),shortName("???"),cooldown(0),COOLDOWN_TIME(0),input(&DEFAULT){}; -Ability::Ability(std::string name,std::string shortName,float cooldownTime,int manaCost,InputGroup*input,Pixel barColor1,Pixel barColor2,PrecastData precastInfo,bool canCancelCast) - :name(name),shortName(shortName),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),input(input),barColor1(barColor1),barColor2(barColor2),precastInfo(precastInfo),canCancelCast(canCancelCast){} \ No newline at end of file +Ability::Ability(std::string name,std::string shortName,float cooldownTime,int manaCost,InputGroup*input,std::string icon,Pixel barColor1,Pixel barColor2,PrecastData precastInfo,bool canCancelCast) + :name(name),shortName(shortName),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),input(input),icon("Ability Icons/"+icon),barColor1(barColor1),barColor2(barColor2),precastInfo(precastInfo),canCancelCast(canCancelCast){} \ No newline at end of file diff --git a/Crawler/Ability.h b/Crawler/Ability.h index 6c1d340c..3e2da7f3 100644 --- a/Crawler/Ability.h +++ b/Crawler/Ability.h @@ -27,8 +27,10 @@ struct Ability{ PrecastData precastInfo; bool canCancelCast=false; InputGroup*input; + std::string icon; std::functionaction=[](Player*,vf2d){return false;}; static InputGroup DEFAULT; Ability(); - Ability(std::string name,std::string shortName,float cooldownTime,int manaCost,InputGroup*input,Pixel barColor1=VERY_DARK_RED,Pixel barColor2=DARK_RED,PrecastData precastInfo={},bool canCancelCast=false); + //NOTE: icon expects the actual name relative to the "Ability Icons" directory for this constructor! + Ability(std::string name,std::string shortName,float cooldownTime,int manaCost,InputGroup*input,std::string icon,Pixel barColor1=VERY_DARK_RED,Pixel barColor2=DARK_RED,PrecastData precastInfo={},bool canCancelCast=false); }; \ No newline at end of file diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index 43a8716d..6e8031c9 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -1043,11 +1043,15 @@ void Crawler::RenderCooldowns(){ const auto DrawCooldown=[&](vf2d pos,Ability&a){ if(a.name!="???"){ if(a.cooldown>0.1){ + DrawDecal(pos,GFX[a.icon].Decal(),{1,1},{255,255,255,64}); DrawPie(pos+vf2d{12,12},12,360-(a.cooldown/a.COOLDOWN_TIME)*360,PixelLerp(a.barColor1,a.barColor2,(a.cooldown/a.COOLDOWN_TIME))); std::stringstream cooldownTimeDisplay; cooldownTimeDisplay<