Forgot std::endl flush for logging on web build. Add deterministic keycode sum comparisons to keep proper ordering of input groups. Release Build 9665.

removeExposedPackKey
sigonasr2 10 months ago
parent 9dcfa55407
commit 5f77321d3d
  1. 2
      Adventures in Lestoria/Error.h
  2. 8
      Adventures in Lestoria/Key.cpp
  3. 5
      Adventures in Lestoria/Key.h
  4. 2
      Adventures in Lestoria/Version.h
  5. BIN
      x64/Release/Adventures in Lestoria.exe

@ -97,7 +97,7 @@ inline std::ofstream debugLogger;
class Error{
public:
inline static void log(std::stringstream&str,std::source_location loc){
std::cout<<loc.file_name()<<"("<<loc.line()<<":"<<loc.column()<<") "<<loc.function_name()<<": "<<str.str();
std::cout<<loc.file_name()<<"("<<loc.line()<<":"<<loc.column()<<") "<<loc.function_name()<<": "<<str.str()<<std::endl;
#ifdef __DEBUG__
throw;
#endif

@ -1143,11 +1143,11 @@ void Input::StopVibration(){
}
const bool operator<(const InputGroup&group1,const InputGroup&group2){
return &group1<&group2;
return group1.GetKeyCodeSum()<group2.GetKeyCodeSum();
}
const bool operator<(const InputEngageGroup&group1,const InputEngageGroup&group2){
return &group1<&group2;
return group1.GetGroup().GetKeyCodeSum()<group2.GetGroup().GetKeyCodeSum();
}
const InputType Input::GetType()const{
@ -1261,4 +1261,8 @@ void Input::SetLightbar(const Pixel col){
SteamInput()->SetLEDColor(steamControllers[i],col.r,col.g,col.b,0);
}
)
}
const int InputGroup::GetKeyCodeSum()const{
return std::accumulate(keys.begin(),keys.end(),0,[](int val,const Input&input){return val+int(input.GetType())*1000+input.GetKeyCode();});
}

@ -179,12 +179,14 @@ public:
const float Analog()const;
const float AnalogDAS(const float threshold=0.2f);
void ClearAllKeybinds();
const int GetKeyCodeSum()const;
std::string GetDisplayName();
//Draws an input display with accompanying text centered at given position.
void DrawPrimaryInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha)const;
void DrawPrimaryInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,const InputType type,vf2d textScale={1.f,1.f})const;
void DrawInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,const InputType type,vf2d textScale={1.f,1.f},const std::string_view preDisplayText="")const;
const std::optional<Input>GetPrimaryKey(InputType type)const;
friend const bool operator<(const InputGroup&group1,const InputGroup&group2);
};
class InputEngageGroup{
@ -208,6 +210,7 @@ public:
InputGroup&GetGroup()const;
const InputEngageGroup operator=(const InputEngageGroup&rhs);
const bool GetLabelVisible()const;
friend const bool operator<(const InputEngageGroup&group1,const InputEngageGroup&group2);
};
class GenericKey{
@ -226,7 +229,5 @@ public:
static void Update();
};
const bool operator<(const InputGroup&group1,const InputGroup&group2);
const bool operator<(const InputEngageGroup&group1,const InputEngageGroup&group2);
using enum InputEngageGroup::EngageType;

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 3
#define VERSION_BUILD 9660
#define VERSION_BUILD 9665
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save