|
|
|
@ -20,14 +20,14 @@ bool FiestaOnlineEditor::OnUserCreate(){ |
|
|
|
|
EnableLayer(1,true); |
|
|
|
|
|
|
|
|
|
menu.SetTable(1,6); |
|
|
|
|
menu["Save"].Enable(false); |
|
|
|
|
menu["Items"].SetTable(1,4).Enable(false); |
|
|
|
|
menu["Items"]["Item Editor"]; |
|
|
|
|
menu["Save"]; |
|
|
|
|
menu["Items"].SetTable(1,4); |
|
|
|
|
menu["Items"]["Item Editor"].SetID(LOAD_ITEM_EDITOR); |
|
|
|
|
menu["Items"]["Drop Groups"]; |
|
|
|
|
menu["Items"]["Icons"]; |
|
|
|
|
menu["Mobs"].Enable(false); |
|
|
|
|
menu["Abilities"].Enable(false); |
|
|
|
|
menu["Buffs"].Enable(false); |
|
|
|
|
menu["Mobs"]; |
|
|
|
|
menu["Abilities"]; |
|
|
|
|
menu["Buffs"]; |
|
|
|
|
menu["Reload"].SetID(RELOAD_FILE_DIALOG); |
|
|
|
|
menu.Build(); |
|
|
|
|
sprMenu = new Sprite("assets/RetroMenu.png"); |
|
|
|
@ -36,10 +36,7 @@ bool FiestaOnlineEditor::OnUserCreate(){ |
|
|
|
|
|
|
|
|
|
utils::datafile::Read(config,"assets/program.txt"); |
|
|
|
|
if(config.HasProperty("DefaultPath")){ |
|
|
|
|
ItemEditor*itemEditor=new ItemEditor({32,32},GetScreenSize()-vi2d{64,64}); |
|
|
|
|
//windows.push_back(new ItemEditor({0,0},GetScreenSize()-vi2d{64,64}));
|
|
|
|
|
windows.push_back(itemEditor); |
|
|
|
|
itemEditor->Load(config["DefaultPath"].GetString()); |
|
|
|
|
manager.Open(&menu); |
|
|
|
|
} else { |
|
|
|
|
manager.Open(&dialog.GetMenu()); |
|
|
|
|
} |
|
|
|
@ -94,27 +91,35 @@ bool FiestaOnlineEditor::OnUserUpdate(float fElapsedTime){ |
|
|
|
|
" ID: " + std::to_string(selected->GetID()); |
|
|
|
|
std::cout<<sLastAction<<std::endl; |
|
|
|
|
switch(selected->GetID()){ |
|
|
|
|
case RELOAD_FILE_DIALOG:{ |
|
|
|
|
}break; |
|
|
|
|
case CHANGE_LOAD_PATH:{ |
|
|
|
|
selectedPath.push_back(selectedPath.back()+"/"+selected->GetName()); |
|
|
|
|
dialog.ChangePath(selectedPath.back()); |
|
|
|
|
manager.Open(&dialog.GetMenu()); |
|
|
|
|
}break; |
|
|
|
|
case GO_BACK:{ |
|
|
|
|
selectedPath.pop_back(); |
|
|
|
|
dialog.ChangePath(selectedPath.back()); |
|
|
|
|
manager.Open(&dialog.GetMenu()); |
|
|
|
|
}break; |
|
|
|
|
case SELECTED_FOLDER:{ |
|
|
|
|
std::cout<<selectedPath.back()<<std::endl; |
|
|
|
|
config["DefaultPath"].SetString(selectedPath.back()); |
|
|
|
|
utils::datafile::Write(config,"assets/program.txt"); |
|
|
|
|
ItemEditor*itemEditor=new ItemEditor({32,32},GetScreenSize()-vi2d{64,64}); |
|
|
|
|
windows.push_back(itemEditor); |
|
|
|
|
itemEditor->Load(selectedPath.back()); |
|
|
|
|
manager.Close(); |
|
|
|
|
}break; |
|
|
|
|
case RELOAD_FILE_DIALOG:{ |
|
|
|
|
}break; |
|
|
|
|
case CHANGE_LOAD_PATH:{ |
|
|
|
|
selectedPath.push_back(selectedPath.back()+"/"+selected->GetName()); |
|
|
|
|
dialog.ChangePath(selectedPath.back()); |
|
|
|
|
manager.Open(&dialog.GetMenu()); |
|
|
|
|
}break; |
|
|
|
|
case GO_BACK:{ |
|
|
|
|
selectedPath.pop_back(); |
|
|
|
|
dialog.ChangePath(selectedPath.back()); |
|
|
|
|
manager.Open(&dialog.GetMenu()); |
|
|
|
|
}break; |
|
|
|
|
case SELECTED_FOLDER:{ |
|
|
|
|
std::cout<<selectedPath.back()<<std::endl; |
|
|
|
|
config["DefaultPath"].SetString(selectedPath.back()); |
|
|
|
|
utils::datafile::Write(config,"assets/program.txt"); |
|
|
|
|
ItemEditor*itemEditor=new ItemEditor(this,{32,32},GetScreenSize()-vi2d{64,64}); |
|
|
|
|
CreateWindow(itemEditor); |
|
|
|
|
itemEditor->Load(selectedPath.back()); |
|
|
|
|
manager.Close(); |
|
|
|
|
}break; |
|
|
|
|
case LOAD_ITEM_EDITOR:{ |
|
|
|
|
ItemEditor*itemEditor=new ItemEditor(this,{32,32},GetScreenSize()-vi2d{64,64}); |
|
|
|
|
CreateWindow(itemEditor); |
|
|
|
|
itemEditor->Load(config["DefaultPath"].GetString()); |
|
|
|
|
itemEditor=new ItemEditor(this,{0,0},GetScreenSize()-vi2d{64,64}); |
|
|
|
|
CreateWindow(itemEditor); |
|
|
|
|
itemEditor->Load(config["DefaultPath"].GetString()); |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -133,8 +138,8 @@ bool FiestaOnlineEditor::OnUserUpdate(float fElapsedTime){ |
|
|
|
|
} else { |
|
|
|
|
SetDrawTarget(nullptr); |
|
|
|
|
} |
|
|
|
|
w->InternalUpdate(this,fElapsedTime); |
|
|
|
|
w->Draw(this); |
|
|
|
|
w->Update(fElapsedTime); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SetDrawTarget(nullptr); |
|
|
|
@ -144,6 +149,14 @@ bool FiestaOnlineEditor::OnUserUpdate(float fElapsedTime){ |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FiestaOnlineEditor::CreateWindow(Window*window){ |
|
|
|
|
for(Window*w:windows){ |
|
|
|
|
w->InternalRefresh(this); |
|
|
|
|
} |
|
|
|
|
window->InternalRefresh(this); |
|
|
|
|
windows.push_back(window); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int main() |
|
|
|
|
{ |
|
|
|
|
FiestaOnlineEditor demo; |
|
|
|
|