|
|
|
@ -116,14 +116,22 @@ bool FiestaOnlineEditor::OnUserUpdate(float fElapsedTime){ |
|
|
|
|
ItemEditor*itemEditor=new ItemEditor(this,"Item Editor: "+config["DefaultPath"].GetString(),{32,32},GetScreenSize()-vi2d{64,64}); |
|
|
|
|
CreateWindow(itemEditor); |
|
|
|
|
itemEditor->Load(config["DefaultPath"].GetString()); |
|
|
|
|
itemEditor=new ItemEditor(this,"Item Editor: "+config["DefaultPath"].GetString(),{0,0},GetScreenSize()-vi2d{64,64}); |
|
|
|
|
CreateWindow(itemEditor); |
|
|
|
|
itemEditor->Load(config["DefaultPath"].GetString()); |
|
|
|
|
manager.Close(); |
|
|
|
|
menuOpened=false; |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(GetKey(ESCAPE).bPressed&&!menuOpened){ |
|
|
|
|
menuOpened=true; |
|
|
|
|
manager.Open(&menu); |
|
|
|
|
}else |
|
|
|
|
if(GetKey(ESCAPE).bPressed&&menuOpened){ |
|
|
|
|
menuOpened=false; |
|
|
|
|
manager.Close(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetDrawTarget(1); |
|
|
|
|
Clear(olc::VERY_DARK_CYAN); |
|
|
|
@ -133,28 +141,39 @@ bool FiestaOnlineEditor::OnUserUpdate(float fElapsedTime){ |
|
|
|
|
//BACKGROUND DRAWING
|
|
|
|
|
|
|
|
|
|
bool internalMouseFocus=false; |
|
|
|
|
|
|
|
|
|
for(Window*w:windows){ |
|
|
|
|
if(!w->IsFocusedWindow()){ |
|
|
|
|
SetDrawTarget(1); |
|
|
|
|
} else { |
|
|
|
|
SetDrawTarget(nullptr); |
|
|
|
|
if(w->IsInBounds(GetMousePos())){ |
|
|
|
|
w->InternalMouseFocus(this); |
|
|
|
|
w->MouseFocus(this); |
|
|
|
|
internalMouseFocus=true; |
|
|
|
|
if(!menuOpened){ |
|
|
|
|
w->InternalUpdate(this,fElapsedTime); |
|
|
|
|
} |
|
|
|
|
w->Draw(this); |
|
|
|
|
} |
|
|
|
|
w->InternalUpdate(this,fElapsedTime); |
|
|
|
|
w->Draw(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(!internalMouseFocus){ |
|
|
|
|
for(Window*w:windows){ //A second iteration through the windows because windows without focus should only have priority after a window with focus.
|
|
|
|
|
if(!w->IsFocusedWindow()){ |
|
|
|
|
for(Window*w:windows){ |
|
|
|
|
if(w->IsFocusedWindow()){ |
|
|
|
|
if(!menuOpened){ |
|
|
|
|
if(w->IsInBounds(GetMousePos())){ |
|
|
|
|
w->InternalMouseFocus(this); |
|
|
|
|
w->MouseFocus(this); |
|
|
|
|
internalMouseFocus=true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(!menuOpened){ |
|
|
|
|
w->InternalUpdate(this,fElapsedTime); |
|
|
|
|
} |
|
|
|
|
w->Draw(this); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(!menuOpened){ |
|
|
|
|
if(!internalMouseFocus){ |
|
|
|
|
for(Window*w:windows){ //A second iteration through the windows because windows without focus should only have priority after a window with focus.
|
|
|
|
|
if(!w->IsFocusedWindow()){ |
|
|
|
|
if(w->IsInBounds(GetMousePos())){ |
|
|
|
|
w->InternalMouseFocus(this); |
|
|
|
|
w->MouseFocus(this); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|