Fix border display drawing for menus. Fix scrollable window components that went outside to use proper scrolling offsets. Fix issue with same-frame clicking and releasing causing a different button to be selected.
fElapsedTime=std::clamp(fElapsedTime,0.f,1/30.f);//HACK fix. We can't have a negative time. Although using a more precise system clock should make this never occur. Also make sure if the game is too slow we advance by only 1/30th of a second.
for(MenuComponent*component:data.parentComponent->GetComponents()){//HACK ALERT! If we are accessing a parent component, it's because we are dealing with a scrolling window component, which has sub-components. So this should be a safe cast to make.
if(component->GetName().starts_with("item")){
MenuItemButton*button2=(MenuItemButton*)component;//HACK ALERT! This is probably an item since we populated item lists using this name for the components. So we assume these are MenuItemButton classes.
MenuItemButton*button2=dynamic_cast<MenuItemButton*>(component);//HACK ALERT! This is probably an item since we populated item lists using this name for the components. So we assume these are MenuItemButton classes.
MenuComponent::DrawDecal(window,parentPos,focused);//INTENTIONAL! The way we draw animations is different from static images, we skip over MenuIconButton's draw!
MenuComponent::DrawDecal(window,focused);//Skipping to MenuComponent's DrawDecal is INTENTIONAL! The way we draw animations is different from static images, we skip over MenuIconButton's draw!
intitemQuantity=Inventory::GetItemCount(invRef.at(inventoryIndex).Name());//Normally we'd retrieve how many of this item we have from our inventory...However Monster Loot and Stage Loot inventories are special and hold their own inventory counts...
floatfElapsedTime=std::clamp(elapsedTime.count(),0.f,1/30.f);//HACK fix. We can't have a negative time. Although using a more precise system clock should make this never occur. Also make sure if the game is too slow we advance by only 1/30th of a second.