diff --git a/Crawler/CharacterInfoWindow.cpp b/Crawler/CharacterInfoWindow.cpp index dd0efdc9..fe7e878c 100644 --- a/Crawler/CharacterInfoWindow.cpp +++ b/Crawler/CharacterInfoWindow.cpp @@ -3,8 +3,10 @@ #include "DEFINES.h" #include "Menu.h" #include "MenuLabel.h" +#include "CharacterRotatingDisplay.h" INCLUDE_game +INCLUDE_GFX typedef Attribute A; void Menu::InitializeClassInfoWindow(){ @@ -13,4 +15,8 @@ void Menu::InitializeClassInfoWindow(){ MenuLabel*label=new MenuLabel(CLASS_INFO,{{classInfoWindow->pos.x,classInfoWindow->pos.y+8},{classInfoWindow->size.x,16}},"Warrior",2,true,true); classInfoWindow->AddComponent("Class Name",label); + + CharacterRotatingDisplay*classDisplay=new CharacterRotatingDisplay(CLASS_INFO,{classInfoWindow->center()-vf2d{classInfoWindow->size.x/4,0},{72,120}},GFX["knight_full_render1.png"].Decal()); + + classInfoWindow->AddComponent("Rotating Character Display",classDisplay); } \ No newline at end of file diff --git a/Crawler/CharacterRotatingDisplay.h b/Crawler/CharacterRotatingDisplay.h new file mode 100644 index 00000000..4e21e0e2 --- /dev/null +++ b/Crawler/CharacterRotatingDisplay.h @@ -0,0 +1,38 @@ +#pragma once +#include "MenuComponent.h" +#include "DEFINES.h" +#include "Crawler.h" + +INCLUDE_game + +class CharacterRotatingDisplay:public MenuComponent{ +protected: + Decal*icon; + float timer; + float rotatingFactor=18; + float perspectiveFactor=6; +public: + inline CharacterRotatingDisplay(MenuType parent,geom2d::rectrect,Decal*icon) + :MenuComponent(parent,rect,"",DO_NOTHING),icon(icon){} +protected: + virtual inline void Update(Crawler*game)override{ + MenuComponent::Update(game); + timer+=game->GetElapsedTime(); + if(timer>=2*PI){ + timer-=2*PI; + } + } + virtual inline void Draw(Crawler*game,vf2d parentPos,bool focused)override{ + //MenuComponent::Draw(game,parentPos,focused); + } + virtual inline void DrawDecal(Crawler*game,vf2d parentPos,bool focused)override{ + //MenuComponent::DrawDecal(game,parentPos,focused); + std::cout<DrawWarpedDecal(icon,std::array{ + rect.pos-icon->sprite->Size()/2+vf2d{abs(sin(timer)),sin(float(timer+PI))}*vf2d{rotatingFactor,perspectiveFactor}, + rect.pos+vf2d{0,rect.size.y}-icon->sprite->Size()/2+vf2d{abs(sin(timer)),sin(timer)}*vf2d{rotatingFactor,perspectiveFactor}, + rect.pos+rect.size-icon->sprite->Size()/2+vf2d{-abs(sin(float(timer+PI))),sin(float(timer+PI))}*vf2d{rotatingFactor,perspectiveFactor}, + rect.pos+vf2d{rect.size.x,0}-icon->sprite->Size()/2+vf2d{-abs(sin(float(timer+PI))),sin(timer)}*vf2d{rotatingFactor,perspectiveFactor}, + }); + } +}; \ No newline at end of file diff --git a/Crawler/Crawler.vcxproj b/Crawler/Crawler.vcxproj index 73cfed00..6214bd90 100644 --- a/Crawler/Crawler.vcxproj +++ b/Crawler/Crawler.vcxproj @@ -264,6 +264,7 @@ + diff --git a/Crawler/Crawler.vcxproj.filters b/Crawler/Crawler.vcxproj.filters index 544946ba..75671faf 100644 --- a/Crawler/Crawler.vcxproj.filters +++ b/Crawler/Crawler.vcxproj.filters @@ -195,6 +195,9 @@ Header Files\Interface + + Header Files\Interface + diff --git a/Crawler/DEFINES.h b/Crawler/DEFINES.h index 781681be..48a49b58 100644 --- a/Crawler/DEFINES.h +++ b/Crawler/DEFINES.h @@ -15,6 +15,7 @@ #define INCLUDE_GFX extern safemapGFX; #define INCLUDE_ITEM_DATA extern safemapITEM_DATA; #define INCLUDE_ITEM_CATEGORIES extern safemap>ITEM_CATEGORIES; +#define DO_NOTHING [](MenuFuncData data){} #define ACCESS_PLAYER Player*p=game->GetPlayer(); diff --git a/Crawler/Version.h b/Crawler/Version.h index c6c9a709..a151bdad 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -2,7 +2,7 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 0 -#define VERSION_BUILD 2184 +#define VERSION_BUILD 2196 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Crawler/assets/config/gfx/gfx.txt b/Crawler/assets/config/gfx/gfx.txt index ab560c1a..456f03b4 100644 --- a/Crawler/assets/config/gfx/gfx.txt +++ b/Crawler/assets/config/gfx/gfx.txt @@ -54,4 +54,7 @@ Images GFX_Ranger_RapidFire_Icon = Ability Icons/rapidfire.png GFX_Ranger_ChargedShot_Icon = Ability Icons/chargedshot.png GFX_Ranger_MultiShot_Icon = Ability Icons/multishot.png + + # Full Class Icons + GFX_Warrior_Full = knight_full_render1.png } \ No newline at end of file