diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index 6d684c27..b25ec06d 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -1268,6 +1268,13 @@ void Crawler::RenderCooldowns(){ Decal*overlayIcon=GFX["skill_overlay_icon.png"].Decal(); if(!circle)overlayIcon=GFX["square_skill_overlay_icon.png"].Decal(); DrawDecal(pos,overlayIcon); + if(a.input->Held()){ + if(circle){ + DrawPie(pos+vf2d{12,12},12,0,{255,255,255,64}); + }else{ + DrawSquarePie(pos+vf2d{12,12},10,0,{255,255,255,64}); + } + } Pixel shortNameCol=BLUE,manaCostShadowCol=DARK_BLUE,keyDisplayCol=YELLOW; if(player->GetMana()DrawSprite(parentPos+rect.middle()-icon->sprite->Size()/2,icon->sprite,1,Sprite::Flip::NONE); + vi2d iconScale=rect.size/24; + game->DrawSprite(parentPos+rect.middle()-icon->sprite->Size()*iconScale/2,icon->sprite,iconScale.x,Sprite::Flip::NONE); } } } @@ -71,7 +72,8 @@ protected: if(decal){ MenuComponent::DrawDecal(game,parentPos,focused); if(icon!=nullptr){ - game->DrawDecal(Menu::menus[parentMenu]->pos+parentPos+rect.middle()-icon->sprite->Size()/2,icon); + vf2d iconScale=rect.size/24.f; + game->DrawDecal(Menu::menus[parentMenu]->pos+parentPos+rect.middle()-icon->sprite->Size()*iconScale/2,icon,iconScale); } } } diff --git a/Crawler/MenuItemButton.h b/Crawler/MenuItemButton.h index 5cbdcd16..f292e7d8 100644 --- a/Crawler/MenuItemButton.h +++ b/Crawler/MenuItemButton.h @@ -154,10 +154,11 @@ protected: itemQuantity=invRef.at(inventoryIndex).Amt(); //So the item quantity comes from the stack itself and not our main inventory. } std::string quantityText="x"+std::to_string(itemQuantity); - vf2d textSize=vf2d(game->GetTextSizeProp(quantityText))*0.5; + vf2d quantityTextScale=rect.size/48.f; + vf2d textSize=vf2d(game->GetTextSizeProp(quantityText))*quantityTextScale; vf2d drawPos=parentPos+rect.pos+rect.size-textSize; if(PointWithinParent(this,drawPos)){ - game->DrawShadowStringDecal(drawPos,quantityText,WHITE,BLACK,{0.5,0.5},0.5); + game->DrawShadowStringDecal(drawPos,quantityText,WHITE,BLACK,quantityTextScale,quantityTextScale.x); } } } diff --git a/Crawler/MenuItemItemButton.h b/Crawler/MenuItemItemButton.h index fe9442f2..1a70605d 100644 --- a/Crawler/MenuItemItemButton.h +++ b/Crawler/MenuItemItemButton.h @@ -97,14 +97,6 @@ protected: onMouseOut(MenuFuncData{*Menu::menus[parentMenu],game,this,(ScrollableWindowComponent*)(parentComponent)}); } } - virtual inline void AfterCreate()override{ - if(itemNameLabelName!=""){ - Component(parentMenu,itemNameLabelName)->Enable(false); - } - if(itemDescriptionLabelName!=""){ - Component(parentMenu,itemDescriptionLabelName)->Enable(false); - } - } virtual inline void Update(Crawler*game)override{ MenuIconButton::Update(game); valid=!itemRef.get().IsBlank(); @@ -146,10 +138,11 @@ protected: MenuIconButton::DrawDecal(game,parentPos,focused); if(valid&&!hideQty){ std::string quantityText="x"+std::to_string(itemRef.get().Amt()); - vf2d textSize=vf2d(game->GetTextSizeProp(quantityText))*0.5; + vf2d quantityTextScale=rect.size/48.f; + vf2d textSize=vf2d(game->GetTextSizeProp(quantityText))*quantityTextScale; vf2d drawPos=Menu::menus[parentMenu]->pos+parentPos+rect.pos+rect.size-textSize; if(PointWithinParent(this,drawPos)){ - game->DrawShadowStringDecal(drawPos,quantityText,WHITE,BLACK,{0.5,0.5},0.5); + game->DrawShadowStringDecal(drawPos,quantityText,WHITE,BLACK,quantityTextScale,quantityTextScale.x); } } } diff --git a/Crawler/Player.cpp b/Crawler/Player.cpp index bc7bb30c..ccea24e0 100644 --- a/Crawler/Player.cpp +++ b/Crawler/Player.cpp @@ -247,7 +247,7 @@ void Player::Update(float fElapsedTime){ notificationDisplay.second=std::max(0.f,notificationDisplay.second-fElapsedTime); lastHitTimer=std::max(0.f,lastHitTimer-fElapsedTime); blockTimer=std::max(0.f,blockTimer-fElapsedTime); - lastCombatTime=lastCombatTime+fElapsedTime; + lastCombatTime=lastCombatTime+fElapsedTime;\ manaTickTimer-=fElapsedTime; CheckEndZoneCollision(); diff --git a/Crawler/Player.h b/Crawler/Player.h index 539c2662..acf67eb6 100644 --- a/Crawler/Player.h +++ b/Crawler/Player.h @@ -83,6 +83,7 @@ struct Player{ friend struct Witch; friend class State_GameRun; friend class Inventory; + friend void ItemOverlay::Draw(); private: int hp="Warrior.BaseHealth"_I; int mana="Player.BaseMana"_I,maxmana=mana; diff --git a/Crawler/Turret.cpp b/Crawler/Turret.cpp index 4bf217c9..5faacb21 100644 --- a/Crawler/Turret.cpp +++ b/Crawler/Turret.cpp @@ -65,7 +65,7 @@ void Monster::STRATEGY::TURRET(Monster&m,float fElapsedTime,int strategyNumber){ } auto dist=geom2d::line(m.GetPos(),game->GetPlayer()->GetPos()).length(); - if(distGetPlayer()->OnUpperLevel()==m.OnUpperLevel()){ if(m.attackCooldownTimer==0){ m.attackCooldownTimer=ConfigFloat("ShootingSpeed"); m.queueShotTimer=std::min(m.attackCooldownTimer-0.001f,0.3f); diff --git a/Crawler/Version.h b/Crawler/Version.h index 1d63bbcf..8b582ff8 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 3809 +#define VERSION_BUILD 3827 #define stringify(a) stringify_(a) #define stringify_(a) #a