Easy refresh
This commit is contained in:
parent
eb408a62bb
commit
05061b6ba6
4 changed files with 23 additions and 11 deletions
|
|
@ -4,8 +4,7 @@ using Godot;
|
|||
public partial class FileButton : MenuButton
|
||||
{
|
||||
const int NEWFILE = 0;
|
||||
const int SAVEFILE = 1;
|
||||
const int OPENFILE = 2;
|
||||
const int OPENFILE = 1;
|
||||
private AdventureEditor editor;
|
||||
private FileDialog dialog;
|
||||
private int chosenOption = -1;
|
||||
|
|
@ -27,10 +26,6 @@ public partial class FileButton : MenuButton
|
|||
dialog.PopupCentered();
|
||||
dialog.FileMode = FileDialog.FileModeEnum.SaveFile;
|
||||
}
|
||||
else if (index == SAVEFILE)
|
||||
{
|
||||
editor.Save();
|
||||
}
|
||||
else if (index == OPENFILE)
|
||||
{
|
||||
dialog.PopupCentered();
|
||||
|
|
@ -43,10 +38,11 @@ public partial class FileButton : MenuButton
|
|||
if (chosenOption == NEWFILE)
|
||||
{
|
||||
editor.Save();
|
||||
editor.HardReload();
|
||||
}
|
||||
else if (chosenOption == OPENFILE)
|
||||
{
|
||||
editor.Reload();
|
||||
editor.HardReload();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue