diff --git a/C++ProjectTemplate b/C++ProjectTemplate index d04337d..fc8d31a 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/assets/crosshair.png b/assets/crosshair.png new file mode 100644 index 0000000..f47ca9b Binary files /dev/null and b/assets/crosshair.png differ diff --git a/main.cpp b/main.cpp index ddf98a9..3e692c1 100644 --- a/main.cpp +++ b/main.cpp @@ -550,6 +550,7 @@ public: std::vector PARTICLES; std::vector DAMAGE_NUMBERS; std::map,vd2d> MOVEMENT_GRID; + vi2d SELECTED_MOVE_SQUARE; Effect*CURRENT_EFFECT=nullptr; @@ -1026,6 +1027,7 @@ goes on a very long time, I hope you can understand this is only for testing pur case 4:{ //Move selected. //DisplayMessageBox("Not implemented yet."); BATTLE_STATE=BattleState::MOVE_SELECT; + SELECTED_MOVE_SQUARE={0,0}; PopulateMovementGrid(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->obj->GetPosWithOrigin(),PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->speed/2); }break; case 5:{ //Run selected. @@ -1653,6 +1655,20 @@ goes on a very long time, I hope you can understand this is only for testing pur } } } + + //////////////////INTERFACE LAYER. + SetDrawTarget(layer::INTERFACE); + + if (BATTLE_ENCOUNTER!=nullptr&&BATTLE_STATE==BattleState::MOVE_SELECT) { + vd2d cursorOffset = {-2,-2}; + vd2d cursorScale = {1,1}; + if ((cos(frameCount*M_PI/20)/2+0.5)>0.8) { + cursorScale={1.08F,1.08F}; + cursorOffset.x-=36*0.08; + cursorOffset.y-=36*0.08; + } + DrawDecal((vi2d)((PARTY_MEMBER_OBJ[-CURRENT_TURN-1]->GetPosWithOrigin()-cameraPos)/32)*32+cursorOffset,SPRITES["crosshair.png"],cursorScale); + } for (auto numb:DAMAGE_NUMBERS) { vd2d shadowOffset={1,1}; vd2d textSize = GetTextSizeProp((numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage)); @@ -1661,11 +1677,9 @@ goes on a very long time, I hope you can understand this is only for testing pur DrawStringPropDecal(numb->pos-cameraPos-textSize/2,(numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage),Pixel(255,255,255,abs(sin((M_PI*frameCount)/30)*128)),{1,2}); } if (messageBoxVisible) { - SetDrawTarget(layer::INTERFACE); DrawDialogBox({1,1},{WIDTH/2,HEIGHT/4},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); DrawStringPropDecal({6,6},messageBoxText); } - SetDrawTarget(layer::INTERFACE); for (int i=0;irender(this); } @@ -2100,6 +2114,7 @@ goes on a very long time, I hope you can understand this is only for testing pur CreateSprite("cursor.png"); CreateSprite("targetCircle.png"); CreateSprite("targetRange.png"); + CreateSprite("crosshair.png"); } void SetupObjectInfo() {