Setup framework for scrollbar and buttons in ScrollableWindowComponent. Fixed a bug where disabled buttons would not increment selection check loop. CreateMenu function instead of creating pointer and returning, so windows can add stuff to menus easily.

This commit is contained in:
2023-10-15 12:58:39 -05:00
parent b08002e61b
commit ff3f4ba1c0
13 changed files with 86 additions and 48 deletions
+11 -3
View File
@@ -1066,7 +1066,7 @@ void Crawler::RenderHud(){
if("debug_player_info"_I){
DrawShadowStringDecal({0,128},player->GetPos().str());
DrawShadowStringDecal({0,136},"Spd: "+std::to_string(player->GetMoveSpdMult()));
DrawShadowStringDecal({0,4},"Selection: "+Menu::menus[INVENTORY]->selection.str());
DrawShadowStringDecal({0,1},"Selection: "+Menu::menus[INVENTORY]->selection.str());
DrawShadowStringDecal({0,12},"Button Hold Time: "+std::to_string(Menu::menus[INVENTORY]->buttonHoldTime));
}
}
@@ -1752,9 +1752,17 @@ void Crawler::InitializeGraphics(){
for(auto&val:DATA["Images"].GetKeys()){
std::string key=val.first;
std::string imgFile=DATA["Images"][key].GetString();
std::string imgFile=DATA["Images"][key].GetString(0);
std::cout<<"Loading image "+imgFile+"..."<<std::endl;
if(!GFX.count(imgFile)&&GFX[imgFile].Load("GFX_Prefix"_S+imgFile,nullptr,false,false)!=rcode::OK){
bool filtering=false;
bool clamping=false;
if(DATA["Images"][key].GetValueCount()>1){
filtering=bool(DATA["Images"][key].GetInt(1));
}
if(DATA["Images"][key].GetValueCount()>2){
clamping=bool(DATA["Images"][key].GetInt(2));
}
if(!GFX.count(imgFile)&&GFX[imgFile].Load("GFX_Prefix"_S+imgFile,nullptr,filtering,clamping)!=rcode::OK){
std::cout<<" WARNING! Failed to load "+imgFile+"!";
throw;
}