|
|
|
@ -317,10 +317,20 @@ enum class ItemName{ |
|
|
|
|
KEY_TO_THE_PALACE, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
using convert_t = std::codecvt_utf8<wchar_t>; |
|
|
|
|
std::wstring_convert<convert_t, wchar_t> strconverter; |
|
|
|
|
std::string to_string(std::wstring wstr){return strconverter.to_bytes(wstr);} |
|
|
|
|
std::wstring to_wstring(std::string str){return strconverter.from_bytes(str);} |
|
|
|
|
template<typename T, typename F> |
|
|
|
|
inline T
|
|
|
|
|
transform_to ( F str ) noexcept |
|
|
|
|
{ |
|
|
|
|
// note: F has to have
|
|
|
|
|
// the empty()method
|
|
|
|
|
if (str.empty()) |
|
|
|
|
return {}; |
|
|
|
|
// note: F must be able to work
|
|
|
|
|
// with std begin and end
|
|
|
|
|
return { std::begin(str), std::end(str) }; |
|
|
|
|
// also the above line requires, T has a constructor
|
|
|
|
|
// that will take begin and end values of type F.
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
namespace Battle{ |
|
|
|
|
class Move{ |
|
|
|
@ -1346,6 +1356,21 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
if (LeftPressed()||RightPressed()) { |
|
|
|
|
ITEM_SELECTION_CURSOR+=ITEM_SELECTION_CURSOR&1?-1:1; |
|
|
|
|
} |
|
|
|
|
if (UpPressed()) { |
|
|
|
|
ITEM_SELECTION_CURSOR-=2; |
|
|
|
|
if (ITEM_SELECTION_CURSOR<0) { |
|
|
|
|
ITEM_SELECTION_CURSOR+=PARTY_INVENTORY.size(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (DownPressed()) { |
|
|
|
|
ITEM_SELECTION_CURSOR+=2; |
|
|
|
|
if (ITEM_SELECTION_CURSOR<0) { |
|
|
|
|
ITEM_SELECTION_CURSOR+=PARTY_INVENTORY.size(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (ITEM_SELECTION_CURSOR>=PARTY_INVENTORY.size()) { |
|
|
|
|
ITEM_SELECTION_CURSOR=PARTY_INVENTORY.size()-1; |
|
|
|
|
}
|
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1606,10 +1631,10 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
DrawDialogBox({1,1},{(int)(WIDTH*0.75),HEIGHT/6},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); |
|
|
|
|
const std::string labels[6]={"Power","Attack","Item","Defend","Move","Run"}; |
|
|
|
|
for (int i=0;i<6;i+=2) { |
|
|
|
|
DrawStringPropDecal({3+8+i/2*64,9},labels[i]); |
|
|
|
|
DrawStringPropDecal({3+8+i/2*64,23},labels[i+1]); |
|
|
|
|
DrawStringPropDecal({static_cast<float>(3+8+i/2*64),9},labels[i]); |
|
|
|
|
DrawStringPropDecal({static_cast<float>(3+8+i/2*64),23},labels[i+1]); |
|
|
|
|
} |
|
|
|
|
DrawDecal({BATTLE_SELECTION_CURSOR/2*64+3,9+((BATTLE_SELECTION_CURSOR%2==0)?0:14)},SPRITES["cursor.png"]); |
|
|
|
|
DrawDecal({static_cast<float>(BATTLE_SELECTION_CURSOR/2*64+3),static_cast<float>(9+((BATTLE_SELECTION_CURSOR%2==0)?0:14))},SPRITES["cursor.png"]); |
|
|
|
|
} |
|
|
|
|
if (BATTLE_STATE==BattleState::POWER_SELECT||BATTLE_STATE==BattleState::GRADE_SELECT) { |
|
|
|
|
SetDrawTarget(layer::INTERFACE); |
|
|
|
@ -1623,24 +1648,24 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
DrawDialogBox(ppCostBoxPos,{(int)(WIDTH/6),HEIGHT/8},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); |
|
|
|
|
DrawStringPropDecal(ppCostBoxPos+textStartingOffset,"PP Cost",WHITE,{0.7,0.8}); |
|
|
|
|
std::string label = std::to_string(BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]][POWER_GRADE_CURSOR[-CURRENT_TURN-1]]->PPCost); |
|
|
|
|
DrawStringPropDecal({ppCostBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*1.5,ppCostBoxPos.y+textStartingOffset.y+8},label,WHITE,{1.5,1.5}); |
|
|
|
|
DrawStringPropDecal({static_cast<float>(ppCostBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*1.5),static_cast<float>(ppCostBoxPos.y+textStartingOffset.y+8)},label,WHITE,{1.5,1.5}); |
|
|
|
|
|
|
|
|
|
vd2d damageBoxPos = {WIDTH-WIDTH/3+WIDTH/6-1,HEIGHT/4+2}; |
|
|
|
|
DrawStringPropDecal(damageBoxPos+textStartingOffset,"Damage",WHITE,{0.7,0.8}); |
|
|
|
|
label = (BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]][POWER_GRADE_CURSOR[-CURRENT_TURN-1]]->baseDmg!=0)?std::to_string(BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]][POWER_GRADE_CURSOR[-CURRENT_TURN-1]]->baseDmg+PARTY_MEMBER_STATS[-CURRENT_TURN-1]->baseAtk)+"~"+std::to_string(BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]][POWER_GRADE_CURSOR[-CURRENT_TURN-1]]->randomDmg+BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]][POWER_GRADE_CURSOR[-CURRENT_TURN-1]]->baseDmg+PARTY_MEMBER_STATS[-CURRENT_TURN-1]->baseAtk):"N/A"; |
|
|
|
|
DrawStringPropDecal({damageBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5)),damageBoxPos.y+textStartingOffset.y+8},label,WHITE,{std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5),1.5}); |
|
|
|
|
DrawStringPropDecal({static_cast<float>(damageBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5))),static_cast<float>(damageBoxPos.y+textStartingOffset.y+8)},label,WHITE,{static_cast<float>(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5)),1.5}); |
|
|
|
|
DrawDialogBox({WIDTH-WIDTH/3+WIDTH/6-1,HEIGHT/4+2},{(int)(WIDTH/6),HEIGHT/8},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); |
|
|
|
|
|
|
|
|
|
vd2d rangeBoxPos = {WIDTH-WIDTH/3+WIDTH/6-1,HEIGHT/4+HEIGHT/8+3}; |
|
|
|
|
DrawStringPropDecal(rangeBoxPos+textStartingOffset,"Range",WHITE,{0.7,0.8}); |
|
|
|
|
label = std::to_string(BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]][POWER_GRADE_CURSOR[-CURRENT_TURN-1]]->range); |
|
|
|
|
DrawStringPropDecal({rangeBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5)),rangeBoxPos.y+textStartingOffset.y+8},label,WHITE,{std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5),1.5}); |
|
|
|
|
DrawStringPropDecal({static_cast<float>(rangeBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5))),static_cast<float>(rangeBoxPos.y+textStartingOffset.y+8)},label,WHITE,{static_cast<float>(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5)),1.5}); |
|
|
|
|
DrawDialogBox({WIDTH-WIDTH/3+WIDTH/6-1,HEIGHT/4+HEIGHT/8+3},{(int)(WIDTH/6),HEIGHT/8},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); |
|
|
|
|
|
|
|
|
|
vd2d channelTimeBoxPos = {WIDTH-WIDTH/3-1,HEIGHT/4+HEIGHT/8+3}; |
|
|
|
|
DrawStringPropDecal(channelTimeBoxPos+textStartingOffset,"Cast",WHITE,{0.7,0.8}); |
|
|
|
|
label = std::to_string((float)BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]][POWER_GRADE_CURSOR[-CURRENT_TURN-1]]->channelTime/60).erase(3); |
|
|
|
|
DrawStringPropDecal({channelTimeBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5)),channelTimeBoxPos.y+textStartingOffset.y+8},label,WHITE,{std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5),1.5}); |
|
|
|
|
DrawStringPropDecal({static_cast<float>(channelTimeBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5))),static_cast<float>(channelTimeBoxPos.y+textStartingOffset.y+8)},label,WHITE,{static_cast<float>(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5)),1.5}); |
|
|
|
|
DrawDialogBox({WIDTH-WIDTH/3-1,HEIGHT/4+HEIGHT/8+3},{(int)(WIDTH/6),HEIGHT/8},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); |
|
|
|
|
int counter=0; |
|
|
|
|
int displayLimit=0; |
|
|
|
@ -1650,28 +1675,28 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
std::vector<Battle::Move*> moves = BATTLE_MOVELIST_DISPLAY[i]; |
|
|
|
|
std::string name = moves[0]->name; |
|
|
|
|
if (GetTextSizeProp(name).x>WIDTH/4) { |
|
|
|
|
DrawStringPropDecal({12,12*counter+8+displayYOffset},name,WHITE,{(WIDTH/4)/(float)GetTextSizeProp(name).x,1}); |
|
|
|
|
DrawStringPropDecal({12,static_cast<float>(12*counter+8+displayYOffset)},name,WHITE,{(WIDTH/4)/(float)GetTextSizeProp(name).x,1}); |
|
|
|
|
} else { |
|
|
|
|
DrawStringPropDecal({12,12*counter+8+displayYOffset},name); |
|
|
|
|
DrawStringPropDecal({12,static_cast<float>(12*counter+8+displayYOffset)},name); |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<moves.size();i++) { |
|
|
|
|
if (BATTLE_STATE==BattleState::GRADE_SELECT&&POWER_SELECTION_CURSOR[-CURRENT_TURN-1]==counter) { |
|
|
|
|
if (POWER_GRADE_CURSOR[-CURRENT_TURN-1]==i) { |
|
|
|
|
DrawFancyStringDecal({8+WIDTH/4+12+i*8,12*counter+8+displayYOffset},std::wstring(1,moves[i]->grade)); |
|
|
|
|
DrawFancyStringDecal({static_cast<float>(8+WIDTH/4+12+i*8),static_cast<float>(12*counter+8+displayYOffset)},std::wstring(1,moves[i]->grade)); |
|
|
|
|
} else { |
|
|
|
|
DrawFancyStringDecal({8+WIDTH/4+12+i*8,12*counter+8+displayYOffset},std::wstring(1,moves[i]->grade),DARK_GREY); |
|
|
|
|
DrawFancyStringDecal({static_cast<float>(8+WIDTH/4+12+i*8),static_cast<float>(12*counter+8+displayYOffset)},std::wstring(1,moves[i]->grade),DARK_GREY); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
DrawFancyStringDecal({8+WIDTH/4+12+i*8,12*counter+8+displayYOffset},std::wstring(1,moves[i]->grade)); |
|
|
|
|
DrawFancyStringDecal({static_cast<float>(8+WIDTH/4+12+i*8),static_cast<float>(12*counter+8+displayYOffset)},std::wstring(1,moves[i]->grade)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
++counter; |
|
|
|
|
} |
|
|
|
|
if (BATTLE_STATE==BattleState::POWER_SELECT) { |
|
|
|
|
DrawDecal({4,12*(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1])+8},SPRITES["cursor.png"]); |
|
|
|
|
DrawDecal({4,static_cast<float>(12*(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1])+8)},SPRITES["cursor.png"]); |
|
|
|
|
} else { |
|
|
|
|
DrawDecal({WIDTH/4+4+POWER_GRADE_CURSOR[-CURRENT_TURN-1]*8+8,12*(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1])+8},SPRITES["cursor.png"]); |
|
|
|
|
DrawDecal({(float)(WIDTH/4+4+POWER_GRADE_CURSOR[-CURRENT_TURN-1]*8+8),static_cast<float>(12*(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1])+8)},SPRITES["cursor.png"]); |
|
|
|
|
} |
|
|
|
|
if (BATTLE_MOVELIST_DISPLAY.size()>4) { |
|
|
|
|
if (POWER_SELECTION_OFFSET[-CURRENT_TURN-1]>0) { |
|
|
|
@ -1684,7 +1709,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
} |
|
|
|
|
if (BATTLE_STATE==BattleState::ITEM_SELECT) { |
|
|
|
|
SetDrawTarget(layer::INTERFACE); |
|
|
|
|
DrawDecal({8+ITEM_SELECTION_CURSOR*(WIDTH-8)/2,12*(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1])+8},SPRITES["cursor.png"]); |
|
|
|
|
DrawDecal({static_cast<float>(8+ITEM_SELECTION_CURSOR*(WIDTH-8)/2),static_cast<float>(12*(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1])+8)},SPRITES["cursor.png"]); |
|
|
|
|
DrawDialogBox({4,4},{(int)(WIDTH-8),(int)(HEIGHT/2)},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); |
|
|
|
|
} |
|
|
|
|
if (BATTLE_STATE==BattleState::TARGET_SELECT) { |
|
|
|
@ -1692,7 +1717,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
if (SELECTED_TARGET<0) { |
|
|
|
|
vd2d scale = {PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->spr->width/(double)SPRITES["targetCircle.png"]->sprite->width,PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->spr->spr->sprite->height/(double)SPRITES["targetCircle.png"]->sprite->height}; |
|
|
|
|
vi2d size = {SPRITES["targetCircle.png"]->sprite->width,SPRITES["targetCircle.png"]->sprite->height}; |
|
|
|
|
DrawDecal(PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->GetPosWithOrigin()-cameraPos-size/2*scale,SPRITES["targetCircle.png"],{PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->spr->width/(double)SPRITES["targetCircle.png"]->sprite->width,PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->spr->spr->sprite->height/(double)SPRITES["targetCircle.png"]->sprite->height},GREEN); |
|
|
|
|
DrawDecal(PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->GetPosWithOrigin()-cameraPos-size/2*scale,SPRITES["targetCircle.png"],{static_cast<float>(PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->spr->width/(double)SPRITES["targetCircle.png"]->sprite->width),static_cast<float>(PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->spr->spr->sprite->height/(double)SPRITES["targetCircle.png"]->sprite->height)},GREEN); |
|
|
|
|
DrawTargetRangeGrid(PARTY_MEMBER_OBJ[-SELECTED_TARGET-1]->GetPosWithOrigin(),PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->range); |
|
|
|
|
} else { |
|
|
|
|
vd2d scale = {BATTLE_ENCOUNTER->objs[SELECTED_TARGET]->obj->spr->width/(double)SPRITES["targetCircle.png"]->sprite->width,BATTLE_ENCOUNTER->objs[SELECTED_TARGET]->obj->spr->spr->sprite->height/(double)SPRITES["targetCircle.png"]->sprite->height}; |
|
|
|
@ -1705,9 +1730,9 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
SetDrawTarget(layer::INTERFACE); |
|
|
|
|
std::wstring label=L""; |
|
|
|
|
if (CURRENT_TURN<0) { |
|
|
|
|
label=to_wstring(PARTY_MEMBER_OBJ[-CURRENT_TURN-1]->name)+L" uses "+to_wstring(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->name)+L" "+((PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->grade!=0)?std::wstring(1,PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->grade):L""); |
|
|
|
|
label=transform_to<std::wstring>(PARTY_MEMBER_OBJ[-CURRENT_TURN-1]->name)+L" uses "+transform_to<std::wstring>(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->name)+L" "+((PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->grade!=0)?std::wstring(1,PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->grade):L""); |
|
|
|
|
} else { |
|
|
|
|
label=to_wstring(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->obj->name)+L" uses "+to_wstring(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->name)+L" "+((BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->grade!=0)?std::wstring(1,BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->grade):L""); |
|
|
|
|
label=transform_to<std::wstring>(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->obj->name)+L" uses "+transform_to<std::wstring>(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->name)+L" "+((BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->grade!=0)?std::wstring(1,BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->grade):L""); |
|
|
|
|
} |
|
|
|
|
DrawFancyStringDecal({2,2},Wrap(label,ScreenWidth()-2,false,{2,2}),WHITE,{2,2}); |
|
|
|
|
} |
|
|
|
@ -1756,19 +1781,19 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
} else { |
|
|
|
|
DrawStringDecal({(float)(box.x+6),(float)(box.y+4)},obj->name,BLACK,{1,0.8}); |
|
|
|
|
} |
|
|
|
|
DrawPartialDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_back.png"],{0,0},{member->atb/1000.0*SPRITES["atbbar_back.png"]->sprite->width,SPRITES["atbbar_back.png"]->sprite->height}); |
|
|
|
|
DrawPartialDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_back.png"],{0,0},{static_cast<float>(member->atb/1000.0*SPRITES["atbbar_back.png"]->sprite->width),static_cast<float>(SPRITES["atbbar_back.png"]->sprite->height)}); |
|
|
|
|
DrawDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_front.png"]); |
|
|
|
|
if (member->selectedMove!=nullptr) { |
|
|
|
|
DrawPartialDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_back.png"],{0,0},{(1-((float)member->channelTimeRemaining/member->selectedMove->channelTime))*SPRITES["atbbar_back.png"]->sprite->width,SPRITES["atbbar_back.png"]->sprite->height},{1,1},GREEN*0.7); |
|
|
|
|
std::wstring label=to_wstring(member->selectedMove->name); |
|
|
|
|
DrawPartialDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_back.png"],{0,0},{(1-((float)member->channelTimeRemaining/member->selectedMove->channelTime))*SPRITES["atbbar_back.png"]->sprite->width,static_cast<float>(SPRITES["atbbar_back.png"]->sprite->height)},{1,1},GREEN*0.7); |
|
|
|
|
std::wstring label=transform_to<std::wstring>(member->selectedMove->name); |
|
|
|
|
label+=L" "; |
|
|
|
|
if (member->selectedMove->grade!=0) { |
|
|
|
|
label+=member->selectedMove->grade; |
|
|
|
|
} |
|
|
|
|
vd2d textOffset=GetTextSize(to_string(label))*0.6; |
|
|
|
|
vd2d textOffset=GetTextSize(transform_to<std::string>(label))*0.6; |
|
|
|
|
textOffset.y+=10; |
|
|
|
|
vd2d barPos = {(float)(box.x+4),(float)(box.y+5+8+2)}; |
|
|
|
|
DrawFancyStringDecal(barPos-textOffset/2,label,BLACK,{std::min((float)54/GetTextSize(to_string(label)).x,(float)1),0.6}); |
|
|
|
|
DrawFancyStringDecal(barPos-textOffset/2,label,BLACK,{std::min((float)54/GetTextSize(transform_to<std::string>(label)).x,(float)1),0.6}); |
|
|
|
|
} |
|
|
|
|
const vi2d hpTextPos = {box.x+5,box.y+25}; |
|
|
|
|
for (int x=-1;x<=1;x++) { |
|
|
|
@ -1795,14 +1820,14 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
Entity*obj = BATTLE_ENCOUNTER->objs[i]; |
|
|
|
|
if (obj->GetHP()>0&&obj->selectedMove!=nullptr) { |
|
|
|
|
vi2d barOffset={-SPRITES["atbbar_front.png"]->sprite->width/2,8}; |
|
|
|
|
DrawPartialDecal(obj->obj->GetPos()+obj->obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_back.png"],{0,0},{(1-((float)obj->channelTimeRemaining/obj->selectedMove->channelTime))*SPRITES["atbbar_back.png"]->sprite->width,SPRITES["atbbar_back.png"]->sprite->height},{1,1},YELLOW*0.8); |
|
|
|
|
DrawPartialDecal(obj->obj->GetPos()+obj->obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_back.png"],{0,0},{(1-((float)obj->channelTimeRemaining/obj->selectedMove->channelTime))*SPRITES["atbbar_back.png"]->sprite->width,static_cast<float>(SPRITES["atbbar_back.png"]->sprite->height)},{1,1},YELLOW*0.8); |
|
|
|
|
DrawDecal(obj->obj->GetPos()+obj->obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_front.png"]); |
|
|
|
|
std::wstring label=to_wstring(obj->selectedMove->name); |
|
|
|
|
std::wstring label=transform_to<std::wstring>(obj->selectedMove->name); |
|
|
|
|
if (obj->selectedMove->grade!=0) { |
|
|
|
|
label+=L" "; |
|
|
|
|
label+=obj->selectedMove->grade; |
|
|
|
|
} |
|
|
|
|
vd2d textOffset=GetTextSize(to_string(label))*0.6; |
|
|
|
|
vd2d textOffset=GetTextSize(transform_to<std::string>(label))*0.6; |
|
|
|
|
textOffset.y-=6; |
|
|
|
|
vi2d shadowOffset = {1,1}; |
|
|
|
|
DrawFancyStringDecal(obj->obj->GetPos()+obj->obj->originPoint-cameraPos+barOffset-textOffset/2+shadowOffset,label,BLACK,{0.6,0.6}); |
|
|
|
@ -2847,7 +2872,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string Wrap(std::string str,int width,bool proportional,vd2d scale) { |
|
|
|
|
return to_string(Wrap(to_wstring(str),width,proportional,scale)); |
|
|
|
|
return transform_to<std::string>(Wrap(transform_to<std::wstring>(str),width,proportional,scale)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::wstring Wrap(std::wstring str,int width,bool proportional,vd2d scale) { |
|
|
|
@ -2860,9 +2885,9 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
} |
|
|
|
|
vd2d siz; |
|
|
|
|
if (proportional) { |
|
|
|
|
siz={GetTextSizeProp(to_string(newStr)).x*scale.x,GetTextSizeProp(to_string(newStr)).y*scale.y}; |
|
|
|
|
siz={GetTextSizeProp(transform_to<std::string>(newStr)).x*scale.x,GetTextSizeProp(transform_to<std::string>(newStr)).y*scale.y}; |
|
|
|
|
} else { |
|
|
|
|
siz={GetTextSize(to_string(newStr)).x*scale.x,GetTextSize(to_string(newStr)).y*scale.y}; |
|
|
|
|
siz={GetTextSize(transform_to<std::string>(newStr)).x*scale.x,GetTextSize(transform_to<std::string>(newStr)).y*scale.y}; |
|
|
|
|
} |
|
|
|
|
if (siz.x>width) { |
|
|
|
|
do { |
|
|
|
@ -3457,20 +3482,20 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
vd2d size={32,32}; |
|
|
|
|
vd2d size2={30,30}; |
|
|
|
|
if (abs(x)+abs(y-1)>=range) { |
|
|
|
|
DrawLineDecal(pos,{pos.x+size.x,pos.y},outlinecol); //Top
|
|
|
|
|
DrawLineDecal(pos2,{pos2.x+size2.x,pos2.y},outlinecol); //Top
|
|
|
|
|
DrawLineDecal(pos,{static_cast<float>(pos.x+size.x),static_cast<float>(pos.y)},outlinecol); //Top
|
|
|
|
|
DrawLineDecal(pos2,{static_cast<float>(pos2.x+size2.x),static_cast<float>(pos2.y)},outlinecol); //Top
|
|
|
|
|
} |
|
|
|
|
if (abs(x-1)+abs(y)>=range) { |
|
|
|
|
DrawLineDecal({pos.x,pos.y},{pos.x,pos.y+size.y},outlinecol); //Left
|
|
|
|
|
DrawLineDecal({pos2.x,pos2.y},{pos2.x,pos2.y+size2.y},outlinecol); //Left
|
|
|
|
|
DrawLineDecal({static_cast<float>(pos.x),static_cast<float>(pos.y)},{static_cast<float>(pos.x),static_cast<float>(pos.y+size.y)},outlinecol); //Left
|
|
|
|
|
DrawLineDecal({static_cast<float>(pos2.x),static_cast<float>(pos2.y)},{static_cast<float>(pos2.x),static_cast<float>(pos2.y+size2.y)},outlinecol); //Left
|
|
|
|
|
} |
|
|
|
|
if (abs(x)+abs(y+1)>=range) { |
|
|
|
|
DrawLineDecal({pos.x,pos.y+size.y},{pos.x+size.x,pos.y+size.y},outlinecol); //Bottom
|
|
|
|
|
DrawLineDecal({pos2.x,pos2.y+size2.y},{pos2.x+size2.x,pos2.y+size2.y},outlinecol); //Bottom
|
|
|
|
|
DrawLineDecal({static_cast<float>(pos.x),static_cast<float>(pos.y+size.y)},{static_cast<float>(pos.x+size.x),static_cast<float>(pos.y+size.y)},outlinecol); //Bottom
|
|
|
|
|
DrawLineDecal({static_cast<float>(pos2.x),static_cast<float>(pos2.y+size2.y)},{static_cast<float>(pos2.x+size2.x),static_cast<float>(pos2.y+size2.y)},outlinecol); //Bottom
|
|
|
|
|
} |
|
|
|
|
if (abs(x+1)+abs(y)>=range) { |
|
|
|
|
DrawLineDecal({pos.x+size.x,pos.y},{pos.x+size.x,pos.y+size.y},outlinecol); //Right
|
|
|
|
|
DrawLineDecal({pos2.x+size2.x,pos2.y},{pos2.x+size2.x,pos2.y+size2.y},outlinecol); //Right
|
|
|
|
|
DrawLineDecal({static_cast<float>(pos.x+size.x),static_cast<float>(pos.y)},{static_cast<float>(pos.x+size.x),static_cast<float>(pos.y+size.y)},outlinecol); //Right
|
|
|
|
|
DrawLineDecal({static_cast<float>(pos2.x+size2.x),static_cast<float>(pos2.y)},{static_cast<float>(pos2.x+size2.x),static_cast<float>(pos2.y+size2.y)},outlinecol); //Right
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|