Completed image caching technique for rendering text using the normal engine draw functions.

This commit is contained in:
2023-12-21 14:09:19 -06:00
parent 8581633cab
commit 5d1e0b5a7a
10 changed files with 150 additions and 428 deletions
+3 -2
View File
@@ -144,7 +144,7 @@ void Menu::CheckClickAndPerformMenuSelect(Crawler*game){
}
void Menu::HoverMenuSelect(Crawler*game){
if(selection==vi2d{-1,-1}||buttons[selection.y][selection.x]->disabled)return;
if(!game->IsFocused()||selection==vi2d{-1,-1}||buttons[selection.y][selection.x]->disabled)return;
if(buttons[selection.y][selection.x]->draggable){
if(buttonHoldTime<"ThemeGlobal.MenuHoldTime"_F){
CheckClickAndPerformMenuSelect(game);
@@ -158,7 +158,7 @@ void Menu::HoverMenuSelect(Crawler*game){
}
void Menu::MenuSelect(Crawler*game){
if(selection==vi2d{-1,-1}||(buttons[selection.y][selection.x]->disabled||buttons[selection.y][selection.x]->grayedOut))return;
if(!game->IsFocused()||selection==vi2d{-1,-1}||(buttons[selection.y][selection.x]->disabled||buttons[selection.y][selection.x]->grayedOut))return;
bool buttonStillValid=buttons[selection.y][selection.x]->onClick(MenuFuncData{*this,game,buttons[selection.y][selection.x],(ScrollableWindowComponent*)buttons[selection.y][selection.x]->parentComponent});
if(buttonStillValid){
if(buttons[selection.y][selection.x]->menuDest!=MenuType::ENUM_END){
@@ -253,6 +253,7 @@ void Menu::Update(Crawler*game){
}
KeyboardButtonNavigation(game,pos);
for(auto&[key,value]:buttons){
for(auto&button:value){
if(button->renderInMain){