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