Stat labels no longer cause funny newline wrapping. Release Build 7170.

pull/35/head
sigonasr2 10 months ago
parent 48ba282fa5
commit 29005e366c
  1. 4
      Adventures in Lestoria/CharacterMenuWindow.cpp
  2. 2
      Adventures in Lestoria/StatLabel.h
  3. 2
      Adventures in Lestoria/Version.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -105,7 +105,7 @@ void Menu::InitializeCharacterMenuWindow(){
equipSelectionSelectButton->Disable(); equipSelectionSelectButton->Disable();
const static auto GetLabelText=[](ItemAttribute attribute){ const static auto GetLabelText=[](ItemAttribute attribute){
std::string attrStr=std::string(attribute.Name())+":\n "; std::string attrStr=std::string(attribute.Name())+"\n ";
attrStr+=std::to_string(game->GetPlayer()->GetStat(attribute)); attrStr+=std::to_string(game->GetPlayer()->GetStat(attribute));
if(attribute.DisplayAsPercent()){ if(attribute.DisplayAsPercent()){
attrStr+="%"; attrStr+="%";
@ -297,7 +297,7 @@ void Menu::InitializeCharacterMenuWindow(){
int yOffset=0; int yOffset=0;
for(const std::string&attribute:displayAttrs){ for(const std::string&attribute:displayAttrs){
std::string attrStr=GetLabelText(ItemAttribute::Get(attribute)); std::string attrStr=GetLabelText(ItemAttribute::Get(attribute));
auto attrLabel=characterMenuWindow->ADD("Attribute "+std::string(ItemAttribute::Get(attribute).Name())+" Label",StatLabel)(geom2d::rect<float>{{245,28+2+float(yOffset)},{62,18}},ItemAttribute::Get(attribute),1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; auto attrLabel=characterMenuWindow->ADD("Attribute "+std::string(ItemAttribute::Get(attribute).Name())+" Label",StatLabel)(geom2d::rect<float>{{245,28+2+float(yOffset)},{62,18}},ItemAttribute::Get(attribute),1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END;
Menu::AddEquipStatListener(attrLabel); Menu::AddEquipStatListener(attrLabel);
yOffset+=20; yOffset+=20;
} }

@ -72,7 +72,7 @@ protected:
SetValue(game->GetPlayer()->GetStat(stat)); SetValue(game->GetPlayer()->GetStat(stat));
} }
inline void UpdateLabel(){ inline void UpdateLabel(){
std::string attrStr=std::string(stat.Name())+":\n "; std::string attrStr=std::string(stat.Name())+"\n ";
attrStr+=std::to_string(value); attrStr+=std::to_string(value);
if(stat.DisplayAsPercent()){ if(stat.DisplayAsPercent()){
attrStr+="%"; attrStr+="%";

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define VERSION_BUILD 7167 #define VERSION_BUILD 7170
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save