This repository has been archived by the owner on Jan 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented the run preview button, added dettings window and enhance…
…d recent items list
- Loading branch information
Showing
25 changed files
with
455 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Newtonsoft.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace App.AdventureMaker.Core | ||
{ | ||
public class AppSettings | ||
{ | ||
public const string SETTINGS_FILE_NAME = "settings.json"; | ||
|
||
#region Static | ||
[Newtonsoft.Json.JsonIgnore] | ||
public static AppSettings Instance { get; set; } | ||
|
||
static AppSettings() | ||
{ | ||
Instance = Json.GetOrCreate(SETTINGS_FILE_NAME, new AppSettings()); | ||
|
||
} | ||
|
||
public static void Save() | ||
{ | ||
Json.Save(SETTINGS_FILE_NAME, Instance); | ||
} | ||
#endregion | ||
|
||
#region Instance | ||
[JsonProperty("preview_mode")] | ||
public int PreviewMode { get; set; } = 0; | ||
|
||
[JsonProperty("game_executable")] | ||
public string GameExe { get; set; } = string.Empty; | ||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,41 @@ | ||
using Eto.Forms; | ||
using App.AdventureMaker.Core.Interfaces; | ||
using Distance.AdventureMaker.Common.Models; | ||
using Eto.Forms; | ||
using System; | ||
|
||
namespace App.AdventureMaker.Core.Commands | ||
{ | ||
public class RunGameCommand : Command | ||
{ | ||
public RunGameCommand() | ||
private readonly IEditor<CampaignFile> editor; | ||
public RunGameCommand(IEditor<CampaignFile> editor_) | ||
{ | ||
editor = editor_; | ||
|
||
MenuText = "&Run Preview"; | ||
ToolBarText = "Run Preview"; | ||
Image = Resources.GetIcon("Run.ico"); | ||
Shortcut = Application.Instance.CommonModifier | Keys.F5; | ||
|
||
Enabled = false; | ||
|
||
editor.OnLoaded += (_) => | ||
{ | ||
Enabled = editor.CurrentFile != null; | ||
}; | ||
} | ||
|
||
protected override void OnExecuted(EventArgs e) | ||
{ | ||
base.OnExecuted(e); | ||
|
||
if (editor.Modified && Messages.SaveBeforeContinue() == DialogResult.No) | ||
{ | ||
return; | ||
} | ||
|
||
editor.SaveFile(); | ||
RunGame.Run(editor); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.