├── Directory.Build.props
├── RMMVCookTool.CLI
├── Brick-02-WF.ico
├── Program.cs
├── RMMVCookTool.CLI.csproj
├── SetupMenu.cs
├── Properties
│ ├── Resources.resx
│ └── Resources.el.resx
└── CompilerEngine.cs
├── RMMVCookTool.GUI
├── Brick-02-WF.ico
├── Docs
│ ├── Manual.pdf
│ └── Manual.el.pdf
├── Views
│ ├── MainView.xaml.cs
│ ├── AboutView.xaml.cs
│ ├── MetadataEditorView.xaml.cs
│ ├── ProjectSettingsView.xaml.cs
│ ├── AboutView.xaml
│ ├── ProjectSettingsView.xaml
│ ├── MainView.xaml
│ └── MetadataEditorView.xaml
├── App.xaml
├── AssemblyInfo.cs
├── MainWindow.xaml.cs
├── App.xaml.cs
├── ViewModels
│ ├── AboutViewModel.cs
│ ├── ProjectSettingsViewModel.cs
│ └── MetadataEditorViewModel.cs
├── RMMVCookTool.GUI.csproj
├── MessageDialog.cs
├── MainWindow.xaml
├── app.manifest
└── Properties
│ ├── Resources.resx
│ └── Resources.el.resx
├── .github
├── dependabot.yml
├── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
└── FUNDING.yml
├── RMMVCookTool.Core
├── Compiler
│ ├── CompilerErrorReport.cs
│ ├── CompilerProjectBase.cs
│ └── CompilerProject.cs
├── CompilerSettings
│ ├── SettingsMetadata.cs
│ ├── SettingsMetadataSerializer.cs
│ └── CompilerSettingsManager.cs
├── ProjectTemplate
│ ├── ProjectMetadataSerializer.cs
│ └── ProjectMetadata.cs
├── ProjectSettings.cs
├── RMMVCookTool.Core.csproj
└── Utilities
│ └── CompilerUtilities.cs
├── .config
└── dotnet-tools.json
├── crowdin.yml
├── azure-pipelines.yml
├── LICENSE
├── README.md
├── RMMVCookTool.sln
├── .gitignore
└── .editorconfig
/Directory.Build.props:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FirehawkV21/RMMVCookTool/HEAD/Directory.Build.props
--------------------------------------------------------------------------------
/RMMVCookTool.CLI/Brick-02-WF.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FirehawkV21/RMMVCookTool/HEAD/RMMVCookTool.CLI/Brick-02-WF.ico
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Brick-02-WF.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FirehawkV21/RMMVCookTool/HEAD/RMMVCookTool.GUI/Brick-02-WF.ico
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Docs/Manual.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FirehawkV21/RMMVCookTool/HEAD/RMMVCookTool.GUI/Docs/Manual.pdf
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Docs/Manual.el.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FirehawkV21/RMMVCookTool/HEAD/RMMVCookTool.GUI/Docs/Manual.el.pdf
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: nuget
4 | directory: "/"
5 | schedule:
6 | interval: daily
7 | time: "03:00"
8 | open-pull-requests-limit: 10
9 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/Compiler/CompilerErrorReport.cs:
--------------------------------------------------------------------------------
1 | namespace RMMVCookTool.Core.Compiler;
2 | public record CompilerErrorReport
3 | {
4 | public int ErrorCode { get; set; }
5 | public string ErrorMessage { get; set; }
6 | }
7 |
--------------------------------------------------------------------------------
/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "cake.tool": {
6 | "version": "5.0.0",
7 | "commands": [
8 | "dotnet-cake"
9 | ]
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/RMMVCookTool.Core/CompilerSettings/SettingsMetadata.cs:
--------------------------------------------------------------------------------
1 | namespace RMMVCookTool.Core.CompilerSettings;
2 |
3 | public sealed record SettingsMetadata
4 | {
5 | public string NwjsLocation { get; set; } = "";
6 | public ProjectSettings DefaultProjectSettings { get; set; } = new();
7 | }
8 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Views/MainView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace RMMVCookTool.GUI.Views;
4 | ///
5 | /// Interaction logic for MainView.xaml
6 | ///
7 | public sealed partial class MainView : UserControl
8 | {
9 | public MainView() => InitializeComponent();
10 | }
11 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Views/AboutView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace RMMVCookTool.GUI.Views;
4 | ///
5 | /// Interaction logic for AboutView.xaml
6 | ///
7 | public sealed partial class AboutView : UserControl
8 | {
9 | public AboutView() => InitializeComponent();
10 | }
11 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Views/MetadataEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace RMMVCookTool.GUI.Views;
4 | ///
5 | /// Interaction logic for MetadataEditorView.xaml
6 | ///
7 | public sealed partial class MetadataEditorView : UserControl
8 | {
9 | public MetadataEditorView() => InitializeComponent();
10 | }
11 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Views/ProjectSettingsView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace RMMVCookTool.GUI.Views;
4 | ///
5 | /// Interaction logic for ProjectSettingsView.xaml
6 | ///
7 | public sealed partial class ProjectSettingsView : UserControl
8 | {
9 | public ProjectSettingsView() => InitializeComponent();
10 | }
11 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/CompilerSettings/SettingsMetadataSerializer.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 |
3 | namespace RMMVCookTool.Core.CompilerSettings;
4 |
5 | [JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Default)]
6 | [JsonSerializable(typeof(SettingsMetadata))]
7 | public sealed partial class SettingsMetadataSerializer : JsonSerializerContext
8 | {
9 | }
10 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/ProjectTemplate/ProjectMetadataSerializer.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 |
3 | namespace RMMVCookTool.Core.ProjectTemplate;
4 |
5 | [JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Default)]
6 | [JsonSerializable(typeof(ProjectMetadata))]
7 | public sealed partial class ProjectMetadataSerializer : JsonSerializerContext
8 | {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/ProjectSettings.cs:
--------------------------------------------------------------------------------
1 | namespace RMMVCookTool.Core;
2 | public sealed record ProjectSettings
3 | {
4 | public string FileExtension { get; set; } = "bin";
5 | public int CompressionLevel { get; set; } = 0;
6 | public bool RemoveSourceFiles { get; set; } = false;
7 | public bool CompressProjectFiles { get; set; } = false;
8 | public bool RemoveFilesAfterCompression { get; set; } = false;
9 | }
10 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/crowdin.yml:
--------------------------------------------------------------------------------
1 | files:
2 | - source: /RMMVCookTool.CLI/Properties/
3 | ignore:
4 | - /RMMVCookTool.CLI/Properties/Resources.*.resx
5 | - /RMMVCookTool.CLI/Properties/Resources.*.cs
6 | translation: /RMMVCookTool.CLI/Properties/Resources.%locale%.resx
7 | - source: /RMMVCookTool.GUI/Properties/
8 | ignore:
9 | - /RMMVCookTool.GUI/Properties/Resources.*.resx
10 | - /RMMVCookTool.GUI/Properties/Resources.*.cs
11 | translation: /RMMVCookTool.GUI/Properties/Resources.%locale%.resx
12 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/Compiler/CompilerProjectBase.cs:
--------------------------------------------------------------------------------
1 | global using System;
2 | global using System.Diagnostics;
3 | global using System.Runtime.InteropServices;
4 | global using System.Collections.Generic;
5 | global using System.Linq;
6 | global using System.IO;
7 |
8 | namespace RMMVCookTool.Core.Compiler;
9 |
10 | public class CompilerProjectBase
11 | {
12 | public Lazy CompilerInfo { get; } = new Lazy(() => new ProcessStartInfo(), true);
13 | protected static readonly string ArchiveName = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "app.nw" : "package.nw";
14 | }
15 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 |
2 | [assembly: ThemeInfo(
3 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
4 | //(used if a resource is not found in the page,
5 | // or application resource dictionaries)
6 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
7 | //(used if a resource is not found in the page,
8 | // app, or any theme specific resource dictionaries)
9 | )]
10 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 |
5 | ---
6 |
7 | **Is your feature request related to a problem? Please describe.**
8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when \[...]
9 |
10 | **Describe the solution you'd like**
11 | A clear and concise description of what you want to happen.
12 |
13 | **Describe alternatives you've considered**
14 | A clear and concise description of any alternative solutions or features you've considered.
15 |
16 | **Additional context**
17 | Add any other context or screenshots about the feature request here.
18 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/RMMVCookTool.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2.0.11.23283
5 | 2.0.11.23283
6 | 2.0.11-20230706
7 | RPG Maker MV Cook Tool Core
8 | The core library of the RPG Maker MV Cook Tool.
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: aceofaces # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: AceOfAces
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 |
5 | ---
6 |
7 | **Describe the bug**
8 | A clear and concise description of what the bug is.
9 |
10 | **To Reproduce**
11 | Steps to reproduce the behavior:
12 | 1. Go to '...'
13 | 2. Click on '....'
14 | 3. Scroll down to '....'
15 | 4. See error
16 |
17 | **Expected behavior**
18 | A clear and concise description of what you expected to happen.
19 |
20 | **Screenshots**
21 | If applicable, add screenshots to help explain your problem.
22 |
23 | **Desktop (please complete the following information):**
24 | - OS: \[e.g. Windows]
25 | - Release/Distro \[e.g. Windows 10, Ubuntu]
26 | - Version \[e.g. 1709, 18.04]
27 | - System Architecture \[e.g. 64-bit, arm32]
28 | - .NET Runtime \[e.g. .NET Framework 4.7.2]
29 |
30 | **Additional context**
31 | Add any other context about the problem here.
32 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | # .NET Desktop
2 |
3 | # Build and run tests for .NET Desktop or Windows classic desktop solutions.
4 | # Add steps that publish symbols, save build artifacts, and more:
5 | # https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
6 |
7 | trigger:
8 | - master
9 |
10 | pool:
11 | vmImage: 'windows-2022'
12 |
13 | variables:
14 | solution: '**/*.sln'
15 | buildPlatform: 'Any CPU'
16 | buildConfiguration: 'Release'
17 |
18 | steps:
19 | - task: UseDotNet@2
20 | inputs:
21 | packageType: 'sdk'
22 | version: '7.0.202'
23 |
24 | - task: DotNetCoreCLI@2
25 | inputs:
26 | command: 'build'
27 | projects: 'RMMVCookTool.CLI\RMMVCookTool.CLI.csproj'
28 |
29 |
30 |
31 | - task: DotNetCoreCLI@2
32 | inputs:
33 | command: 'build'
34 | projects: 'RMMVCookTool.GUI\RMMVCookTool.GUI.csproj'
35 |
36 | - task: VSTest@2
37 | inputs:
38 | platform: '$(buildPlatform)'
39 | configuration: '$(buildConfiguration)'
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Reflection;
3 | using Prism;
4 | using Prism.Navigation.Regions;
5 | using RMMVCookTool.Core.Utilities;
6 |
7 | namespace RMMVCookTool.GUI;
8 |
9 | ///
10 | /// Interaction logic for MainWindow.xaml
11 | ///
12 | public sealed partial class MainWindow : Window
13 | {
14 | public MainWindow(IRegionManager regionManager)
15 | {
16 | InitializeComponent();
17 | regionManager.RegisterViewWithRegion("MainShell", typeof(Views.MainView));
18 | regionManager.RegisterViewWithRegion("SecondaryShell", typeof(Views.AboutView));
19 | }
20 |
21 | private void Window_Loaded(object sender, RoutedEventArgs e)
22 | {
23 | CompilerUtilities.StartEngineLogger("CompilerGUI", true);
24 | CompilerUtilities.RecordToLog($"Cook Tool GUI, version {Assembly.GetExecutingAssembly().GetName().Version} started.", 0);
25 | }
26 |
27 | private void Window_Closing(object sender, CancelEventArgs e) => CompilerUtilities.CloseLog();
28 | }
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Studio ACE
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/RMMVCookTool.CLI/Program.cs:
--------------------------------------------------------------------------------
1 | using RMMVCookTool.CLI.Properties;
2 | using RMMVCookTool.Core.Utilities;
3 | using System;
4 | using System.Reflection;
5 |
6 | namespace RMMVCookTool.CLI;
7 |
8 | internal sealed class Program
9 | {
10 | private static readonly CompilerEngine engine = new();
11 |
12 | private static void Main(string[] args)
13 | {
14 | #region Print App Info
15 | CompilerUtilities.StartEngineLogger("CompilerCLI", false);
16 | Console.WriteLine(Resources.SpilterText);
17 | Console.WriteLine(Resources.ProgramNameText);
18 | Console.WriteLine(Resources.ProgramVersionString, Assembly.GetExecutingAssembly().GetCustomAttribute()?.InformationalVersion);
19 | Console.WriteLine(Resources.ProgramAuthorText);
20 | Console.WriteLine(Resources.ProgramLicenseText);
21 | Console.WriteLine(Resources.SpilterText);
22 | CompilerUtilities.RecordToLog($"Cook Tool CLI, version {Assembly.GetExecutingAssembly().GetName().Version} started.", 0);
23 | #endregion
24 | if (args.Length >= 1) engine.ProcessCommandLineArguments(args);
25 | else engine.StartSetup();
26 | engine.StartWorker();
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | global using System;
2 | global using System.Windows;
3 | global using RMMVCookTool.GUI.Properties;
4 | global using Ookii.Dialogs.Wpf;
5 | global using System.IO;
6 | using Prism.DryIoc;
7 | using Prism.Ioc;
8 | using System.Runtime;
9 |
10 | namespace RMMVCookTool.GUI;
11 |
12 | ///
13 | /// Interaction logic for App.xaml
14 | ///
15 | public sealed partial class App : PrismApplication
16 | {
17 | public App()
18 | {
19 | string ProfilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "RMMVCookTool", "JITProfile");
20 | if (!Directory.Exists(ProfilePath)) Directory.CreateDirectory(ProfilePath);
21 | ProfileOptimization.SetProfileRoot(ProfilePath);
22 | ProfileOptimization.StartProfile("MVCookToolUI.Profile");
23 | }
24 | protected override void RegisterTypes(IContainerRegistry containerRegistry)
25 | {
26 | containerRegistry.RegisterDialog("ProjectSettings");
27 | containerRegistry.RegisterDialog("MetadataEditor");
28 | // register other needed services here
29 | }
30 |
31 | protected override Window CreateShell()
32 | {
33 | MainWindow w = Container.Resolve();
34 | return w;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Views/AboutView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/CompilerSettings/CompilerSettingsManager.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json;
2 |
3 | namespace RMMVCookTool.Core.CompilerSettings;
4 |
5 | public sealed class CompilerSettingsManager
6 | {
7 | public SettingsMetadata Settings { get; set; }
8 | private static string SettingsFolderLocation { get {
9 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
10 | {
11 | return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "RMMVCookTool", "Settings");
12 | }
13 | else
14 | {
15 | return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "RMMVCookTool", "Settings");
16 | }
17 | } }
18 |
19 | private static string SettingsFileLocation => Path.Combine(SettingsFolderLocation, "CompilerSettings.json");
20 | public CompilerSettingsManager()
21 | {
22 | Settings = new();
23 | InitializeSettings();
24 | }
25 | public void LoadSettings()
26 | {
27 | if (File.Exists(SettingsFileLocation))
28 | {
29 | string inputFile = File.ReadAllText(SettingsFileLocation);
30 | Settings = JsonSerializer.Deserialize(inputFile, SettingsMetadataSerializer.Default.SettingsMetadata);
31 | }
32 | }
33 | public void SaveSettings()
34 | {
35 | string output = JsonSerializer.Serialize(Settings, SettingsMetadataSerializer.Default.SettingsMetadata);
36 | File.WriteAllText(SettingsFileLocation, output);
37 | }
38 |
39 | public void InitializeSettings()
40 | {
41 | if (File.Exists(SettingsFileLocation)) LoadSettings();
42 | else
43 | {
44 | if (!Directory.Exists(SettingsFolderLocation)) Directory.CreateDirectory(SettingsFolderLocation);
45 | SaveSettings();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/ViewModels/AboutViewModel.cs:
--------------------------------------------------------------------------------
1 | using Prism.Commands;
2 | using Prism.Mvvm;
3 | using System.Diagnostics;
4 | using System.Reflection;
5 |
6 | namespace RMMVCookTool.GUI.ViewModels;
7 | public sealed class AboutViewModel : BindableBase
8 | {
9 | private string programVersion = "";
10 | private bool docsAvailable = true;
11 | public string ProgramVersionText {
12 | get => programVersion;
13 | set => SetProperty(ref programVersion, value);
14 | }
15 | public bool AreDocsAvailable { get => docsAvailable; set => SetProperty(ref docsAvailable, value); }
16 | public DelegateCommand OpenDocsCommand { get; private set; }
17 | private static readonly string ReadmeFile =
18 | Path.Combine(AppContext.BaseDirectory, "Docs", "Manual.pdf");
19 |
20 | private static readonly string GreekReadme =
21 | Path.Combine(AppContext.BaseDirectory, "Docs", "Manual.el.pdf");
22 |
23 | public AboutViewModel()
24 | {
25 | OpenDocsCommand = new DelegateCommand(OpenReadme, CheckFile).ObservesProperty(() => AreDocsAvailable);
26 | string version = Assembly.GetExecutingAssembly().GetCustomAttribute()?.InformationalVersion;
27 | ProgramVersionText = Resources.ProgramVersionLabelUiText + @" (" + version + @")";
28 | string docsFile = (System.Threading.Thread.CurrentThread.CurrentCulture.Name == "el-GR") ? GreekReadme : ReadmeFile;
29 | if (!File.Exists(docsFile)) AreDocsAvailable = false;
30 | }
31 |
32 | private bool CheckFile() => AreDocsAvailable;
33 |
34 | private void OpenReadme() {
35 | using Process fileopener = new();
36 | fileopener.StartInfo.FileName = (System.Threading.Thread.CurrentThread.CurrentCulture.Name == "el-GR") ? GreekReadme : ReadmeFile;
37 | fileopener.StartInfo.UseShellExecute = true;
38 | fileopener.Start();
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/RMMVCookTool.CLI/RMMVCookTool.CLI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | 2.3.3.23283
6 | 2.3.3.23283
7 | Brick-02-WF.ico
8 | RMMVCookTool.CLI.Program
9 | RPG Maker MV Cook Tool (CLI Version)
10 | StudioACE.RMMVCookTool.CLI
11 | 2.3.3-20230706
12 | Command-line version of the RPG Maker MV Cook Tool.
13 | win-x64;win-arm64;linux-x64;linux-arm64
14 | true
15 | true
16 | true
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | True
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | True
37 | True
38 | Resources.resx
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | ResXFileCodeGenerator
48 | Resources.Designer.cs
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/RMMVCookTool.GUI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net8.0-windows
6 | true
7 | 4.1.0.23283
8 | 4.1.4.23283
9 | app.manifest
10 | Brick-02-WF.ico
11 | RPG Maker MV/MZ Cook Tool (GUI Version)
12 | 4.1.0-20231010
13 | false
14 | win-x86;win-x64
15 | GUI version of the RPG Maker MV Cook Tool.
16 | true
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | Always
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | True
48 | True
49 | Resources.resx
50 |
51 |
52 |
53 |
54 |
55 | $(IntermediateOutputPath)\Resource.Designer.cs
56 | CSharp
57 | PublicResXFileCodeGenerator
58 | Resources.Designer.cs
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RPG Maker MV/MZ Cook Tool
2 | [](https://crowdin.com/project/rpg-maker-mv-cook-tool)
3 |
4 | ## Intro
5 | This tool is a GUI wrapper (and a standalone console app) for NW.js' Compiler tool (included in the SDK of the program). It allows RPG Maker MV and MZ game developers to protect the game's source code and plugins from being stolen by compiling the files to their binary form. The tool automates the generation of the binaries. This does sacrifice the cross-platform capabilities, however, and the binaries work only on the version of the SDK you used.
6 |
7 | ## The Components
8 |
9 | ### RMMVCookTool.Core
10 | This houses the common code between the GUI and the Console App.
11 |
12 | ### RMMVCookTool.UI
13 | The GUI part of the compiler tool.
14 |
15 | ### RMMVCookTool.CLI
16 | The standalone, cross-platform console app. Used for compiling a project quickly.
17 |
18 | ## System Requirements
19 | - Windows 10 (Version 1803) and newer.
20 | - Microsoft .NET 7.
21 | - NW.js SDK. Any version you want.
22 |
23 | ## Compiling
24 |
25 | You will need Visual Studio 2022, along with the Microsoft .NET 7 SDK. Once you do have both, open the solution file. Alternatively, run the following in a terminal (assuming that you have the .NET 7 SDK installed):
26 |
27 | ### Cleaning
28 | ```powershell
29 | dotnet cake --rebuild #Include -rebuild to clean the solution before compiling.
30 | ```
31 | ### Building:
32 | ```powershell
33 | dotnet cake --buildUi # Builds the UI
34 | dotnet cake --buildCli # Builds the CLI
35 | ```
36 |
37 | ### Publishing
38 | ```powershell
39 | dotnet cake --publishUi # Publishes a standalone version of the UI.
40 | dotnet cake --publishCli # Publishes a native version of the CLI.
41 | dotnet cake --publishUiOnArm # Publishes the Windows On Arm version of the UI.
42 | dotnet cake --publishCliOnArm # Publishes the native Arm version of the CLI (requires the Arm64 C++ compiler).
43 | ```
44 | Note: This will use Cake build to compile the project. Run `dotnet tool restore` in the terminal before running the above commands.
45 |
46 | See this documentation to set up the C++ compiler needed for NativeAOT (CLI for now): https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/
47 |
48 | ## Libraries Used
49 | - [Dirkster.NumericUpDownLib](https://github.com/Dirkster99/NumericUpDownLib)
50 | - [Ookii.Dialogs](https://github.com/ookii-dialogs/ookii-dialogs-wpf)
51 | - [Spectre.Console](https://spectreconsole.net/)
52 | - [Serilog](https://serilog.net/)
53 | - [Prism](https://prismlibrary.com)
54 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/ProjectTemplate/ProjectMetadata.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 |
3 | namespace RMMVCookTool.Core.ProjectTemplate;
4 |
5 | public sealed class ProjectMetadata
6 | {
7 | [JsonPropertyName("name")]
8 | public string GameName { get; set; }
9 | [JsonPropertyName("app_name")]
10 | public string GameTitle { get; set; }
11 | [JsonPropertyName("version")]
12 | public string GameVersion { get; set; }
13 | [JsonPropertyName("main")]
14 | public string MainFile { get; set; }
15 | [JsonPropertyName("chromium-args")]
16 | public string ChromiumFlags { get; set; }
17 | [JsonPropertyName("js-flags")]
18 | public string JsFlags { get; set; }
19 | [JsonPropertyName("nodejs")]
20 | public bool UseNodeJs { get; set; }
21 | [JsonPropertyName("window")]
22 | public Window WindowProperties { get; set; } = new();
23 |
24 | public class Window
25 | {
26 | [JsonPropertyName("width")]
27 | public uint WindowWidth { get; set; }
28 | [JsonPropertyName("height")]
29 | public uint WindowHeight { get; set; }
30 | [JsonPropertyName("icon")]
31 | public string WindowIcon { get; set; }
32 | [JsonPropertyName("id")]
33 | public string WindowId { get; set; }
34 | [JsonPropertyName("min_width")]
35 | public uint MinimumWidth { get; set; }
36 | [JsonPropertyName("min_height")]
37 | public uint MinimumHeight { get; set; }
38 | [JsonPropertyName("title")]
39 | public string WindowTitle { get; set; }
40 | [JsonPropertyName("resizable")]
41 | public bool IsResizable { get; set; }
42 | [JsonPropertyName("fullscreen")]
43 | public bool StartAtFullScreen { get; set; }
44 | [JsonPropertyName("kiosk")]
45 | public bool RunInKioskMode { get; set; }
46 | [JsonPropertyName("position")]
47 | public string ScreenPosition { get; set; }
48 | }
49 | public ProjectMetadata()
50 | {
51 | GameName = "NewGame";
52 | GameTitle = "My New Game";
53 | JsFlags = "--expose-gc";
54 | ChromiumFlags = "--enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --enable-native-gpu-memory-buffers --enable-zero-copy --enable-gpu-async-worker-context";
55 | UseNodeJs = true;
56 | WindowProperties.IsResizable = true;
57 | WindowProperties.WindowHeight = WindowProperties.MinimumHeight = 816;
58 | WindowProperties.WindowWidth = WindowProperties.MinimumWidth = 624;
59 | WindowProperties.ScreenPosition = "none";
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/ViewModels/ProjectSettingsViewModel.cs:
--------------------------------------------------------------------------------
1 | using Prism.Commands;
2 | using Prism.Mvvm;
3 | using Prism.Dialogs;
4 |
5 | namespace RMMVCookTool.GUI.ViewModels;
6 | internal sealed class ProjectSettingsViewModel : BindableBase, IDialogAware
7 | {
8 | private string fileExtension;
9 | private bool removeSource;
10 | private bool compressFiles;
11 | private bool removeAfterCompression;
12 | private int compressionLevel;
13 |
14 | public string Title { get; private set; }
15 | public string FileExtension { get => fileExtension; set => SetProperty(ref fileExtension, value); }
16 | public bool RemoveSource { get => removeSource; set => SetProperty(ref removeSource, value); }
17 | public bool CompressFiles { get => compressFiles; set => SetProperty(ref compressFiles, value); }
18 | public bool RemoveAfterCompression { get => removeAfterCompression; set => SetProperty(ref removeAfterCompression, value); }
19 | public int CompressionLevel { get => compressionLevel; set => SetProperty(ref compressionLevel, value); }
20 |
21 | public DelegateCommand SaveCommand { get; private set; }
22 | public DelegateCommand CancelCommand { get; private set; }
23 |
24 | public DialogCloseListener RequestClose { get; }
25 |
26 | public bool CanCloseDialog() => true;
27 |
28 | public ProjectSettingsViewModel() {
29 | SaveCommand = new(SaveSettings);
30 | CancelCommand = new(CancelSettings);
31 | }
32 | public void OnDialogClosed()
33 | {
34 | //Method intentionally left blank;
35 | }
36 | public void OnDialogOpened(IDialogParameters parameters)
37 | {
38 | Title = parameters.GetValue("title");
39 | FileExtension = parameters.GetValue("fileExtension");
40 | RemoveSource = parameters.GetValue("removeSource");
41 | CompressFiles = parameters.GetValue("compressFiles");
42 | RemoveAfterCompression = parameters.GetValue("removeAfterCompression");
43 | CompressionLevel = parameters.GetValue("compressionLevel");
44 | }
45 |
46 | private void SaveSettings()
47 | {
48 | ButtonResult button = ButtonResult.OK;
49 | DialogResult result = new DialogResult(button);
50 | result.Parameters.Add("fileExtension", FileExtension);
51 | result.Parameters.Add("removeSource", RemoveSource);
52 | result.Parameters.Add("compressFiles", CompressFiles);
53 | result.Parameters.Add("removeAfterCompression", RemoveAfterCompression);
54 | result.Parameters.Add("compressionLevel", CompressionLevel);
55 | RequestClose.Invoke(result);
56 | }
57 |
58 | private void CancelSettings()
59 | {
60 | ButtonResult button = ButtonResult.Cancel;
61 | DialogResult result = new DialogResult(button);
62 | RequestClose.Invoke(result);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/MessageDialog.cs:
--------------------------------------------------------------------------------
1 | namespace RMMVCookTool.GUI;
2 |
3 | public static class MessageDialog
4 | {
5 | public static void ThrowErrorMessage(Exception e)
6 | {
7 | using (TaskDialog errorDialog = new())
8 | {
9 | errorDialog.WindowTitle = Resources.ErrorText;
10 | errorDialog.MainIcon = TaskDialogIcon.Error;
11 | errorDialog.MainInstruction = Resources.ErrorOccuredTitle;
12 | errorDialog.Content = e.Message;
13 | errorDialog.ExpandedInformation = Resources.StackTraceLine + e.StackTrace;
14 | errorDialog.Footer = Resources.ErrorDetailsMessage;
15 | errorDialog.FooterIcon = TaskDialogIcon.Information;
16 | TaskDialogButton okButton = new(ButtonType.Ok);
17 | errorDialog.Buttons.Add(okButton);
18 | errorDialog.ShowDialog();
19 |
20 | }
21 | }
22 |
23 | public static void ThrowErrorMessage(string title, string message)
24 | {
25 | using (TaskDialog errorDialog = new())
26 | {
27 | errorDialog.WindowTitle = title;
28 | errorDialog.MainIcon = TaskDialogIcon.Error;
29 | errorDialog.MainInstruction = Resources.ErrorOccuredTitle;
30 | errorDialog.Content = message;
31 | errorDialog.Footer = Resources.ErrorDetailsMessage;
32 | errorDialog.FooterIcon = TaskDialogIcon.Information;
33 | TaskDialogButton okButton = new(ButtonType.Ok);
34 | errorDialog.Buttons.Add(okButton);
35 | errorDialog.ShowDialog();
36 |
37 | }
38 | }
39 |
40 | public static void ThrowWarningMessage(string title, string message, string extramessage)
41 | {
42 | using TaskDialog warningDialog = new();
43 | warningDialog.WindowTitle = title;
44 | warningDialog.MainInstruction = message;
45 | warningDialog.Content = extramessage;
46 | warningDialog.MainIcon = TaskDialogIcon.Warning;
47 | TaskDialogButton confirmMessage = new(ButtonType.Ok);
48 | warningDialog.Buttons.Add(confirmMessage);
49 | warningDialog.ShowDialog();
50 | }
51 |
52 | public static void ThrowCompleteMessage(string message)
53 | {
54 | using (TaskDialog completeDialog = new())
55 | {
56 | completeDialog.WindowTitle = Resources.CompleteText;
57 | completeDialog.MainIcon = TaskDialogIcon.Information;
58 | completeDialog.MainInstruction = message;
59 | TaskDialogButton okButton = new(ButtonType.Ok);
60 | completeDialog.Buttons.Add(okButton);
61 | completeDialog.ShowDialog();
62 | }
63 | }
64 |
65 | public static void ThrowCompleteMessage(string message, string extramessage)
66 | {
67 | using (TaskDialog completeDialog = new())
68 | {
69 | completeDialog.WindowTitle = Resources.CompleteText;
70 | completeDialog.MainIcon = TaskDialogIcon.Information;
71 | completeDialog.MainInstruction = message;
72 | completeDialog.Content = extramessage;
73 | TaskDialogButton okButton = new(ButtonType.Ok);
74 | completeDialog.Buttons.Add(okButton);
75 | completeDialog.ShowDialog();
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
52 |
53 |
54 |
57 | PerMonitorV2, PerMonitor
58 | true/PM
59 | true
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | SegmentHeap
68 |
69 |
70 |
71 |
72 |
73 |
74 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Views/ProjectSettingsView.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/RMMVCookTool.CLI/SetupMenu.cs:
--------------------------------------------------------------------------------
1 | using RMMVCookTool.CLI.Properties;
2 | using RMMVCookTool.Core.Compiler;
3 | using RMMVCookTool.Core.Utilities;
4 | using Spectre.Console;
5 | using System;
6 | using System.IO;
7 |
8 | namespace RMMVCookTool.CLI;
9 | public sealed class SetupMenu
10 | {
11 | public bool TestProject { get; set; }
12 | public int CheckDeletion { get; set; } = 1;
13 | public int CompressProject { get; set; } = 3;
14 | public string SdkLocation { get; set; }
15 | public bool SettingsSet { get; set; }
16 | public void CheckSettings(in CompilerProject newProject)
17 | {
18 | //Check if both the _projectLocation and _sdkLocation variables are not null.
19 | if (newProject.ProjectLocation != null && SdkLocation != null)
20 | {
21 | CompilerUtilities.RecordToLog("Settings set. Starting the job...", 0);
22 | SettingsSet = true;
23 | }
24 | else if (newProject.ProjectLocation == null && SdkLocation != null)
25 | {
26 | CompilerUtilities.RecordToLog("Project location not set. Aborting job.", 2);
27 | Console.ForegroundColor = ConsoleColor.DarkRed;
28 | Console.WriteLine(Resources.ProjectNotSetErrorText);
29 | Console.ResetColor();
30 | Console.WriteLine(Resources.PushEnterToExitText);
31 | Console.ReadLine();
32 | Environment.Exit(1);
33 | }
34 | else if (SdkLocation == null && newProject.ProjectLocation != null)
35 | {
36 | CompilerUtilities.RecordToLog("NW.js compiler location not set. Aborting job.", 2);
37 | Console.ForegroundColor = ConsoleColor.DarkRed;
38 | Console.WriteLine(Resources.SDKLocationNotSetErrorText);
39 | Console.ResetColor();
40 | Console.WriteLine(Resources.PushEnterToExitText);
41 | Console.ReadLine();
42 | Environment.Exit(1);
43 | }
44 | Console.WriteLine("");
45 | }
46 |
47 | public void SetupWorkload(in CompilerProject newProject)
48 | {
49 | Rule setupTab = new()
50 | {
51 | Title = Resources.SetupTitle
52 | };
53 | setupTab.LeftJustified();
54 | AnsiConsole.Write(setupTab);
55 | do
56 | {
57 | //Ask the user where is the SDK. Check if the folder's there.
58 | SdkLocation = AnsiConsole.Prompt(new TextPrompt(Resources.SDKLocationQuestion));
59 | if (SdkLocation == null) Console.WriteLine(Resources.SDKLocationIsNullText);
60 | else if (!Directory.Exists(SdkLocation)) Console.Write(Resources.SDKDirectoryMissing);
61 | } while (SdkLocation == null || !Directory.Exists(SdkLocation));
62 | do
63 | {
64 | //Ask the user what project to compile. Check if the folder is there and there's a js folder.
65 | newProject.ProjectLocation = AnsiConsole.Prompt(new TextPrompt(Resources.ProjectLocationQuestion));
66 | if (newProject.ProjectLocation == null) Console.WriteLine(Resources.ProjectLocationIsNullText);
67 | else if (!Directory.Exists(newProject.ProjectLocation))
68 | Console.WriteLine(Resources.ProjetDirectoryMissingErrorText);
69 | else if (!Directory.Exists(Path.Combine(newProject.ProjectLocation, "www", "js")))
70 | Console.WriteLine(Resources.ProjectJsFolderMissing);
71 | else if (!File.Exists(Path.Combine(newProject.ProjectLocation, "package.json")))
72 | Console.WriteLine(Resources.JsonFileMissingErrorText);
73 | } while (newProject.ProjectLocation == null || !Directory.Exists(newProject.ProjectLocation) ||
74 | !Directory.Exists(Path.Combine(newProject.ProjectLocation, "www", "js")));
75 |
76 | //Ask the user for the file extension.
77 | newProject.Setup.FileExtension = AnsiConsole.Prompt(new TextPrompt(Resources.FileExtensionQuestion).DefaultValue("bin").AllowEmpty());
78 | //This is the check if the tool should delete the JS files.
79 | CheckDeletion = AnsiConsole.Prompt(new TextPrompt(Resources.WorkloadQuestion)
80 | .DefaultValue(1)
81 | .Validate(choice => choice switch
82 | {
83 | > 2 => ValidationResult.Error(),
84 | < 1 => ValidationResult.Error(),
85 | _ => ValidationResult.Success()
86 | }));
87 | newProject.Setup.RemoveSourceFiles = CheckDeletion == 2;
88 |
89 | if (CheckDeletion == 2)
90 | {
91 | CompressProject = AnsiConsole.Prompt(new TextPrompt(Resources.CompressionQuestion)
92 | .DefaultValue(3)
93 | .Validate(choice => choice switch
94 | {
95 | > 3 => ValidationResult.Error(),
96 | < 1 => ValidationResult.Error(),
97 | _ => ValidationResult.Success()
98 | }));
99 | }
100 | else
101 | {
102 | //Ask if the user would like to test with nwjs.
103 | if (AnsiConsole.Confirm(Resources.TestProjectQuestion)) TestProject = true;
104 | }
105 | CompilerUtilities.RecordToLog($"Current setup of the job:\nCompiler Location:{SdkLocation}\nProject Location:{newProject.ProjectLocation}\nFile Extension:{newProject.Setup.FileExtension}\nRemove Source Files? {newProject.Setup.RemoveSourceFiles}\nPackage game?:{newProject.Setup.CompressProjectFiles}\nRemove game files after packaging?:{newProject.Setup.RemoveFilesAfterCompression}\nCompression Mode:{newProject.Setup.CompressionLevel}", 0);
106 | }
107 |
108 | }
109 |
110 |
111 |
--------------------------------------------------------------------------------
/RMMVCookTool.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.1.32407.343
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RMMVCookTool.Core", "RMMVCookTool.Core\RMMVCookTool.Core.csproj", "{73D4B27D-9A73-48B0-A45E-A80BC69E5972}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RMMVCookTool.CLI", "RMMVCookTool.CLI\RMMVCookTool.CLI.csproj", "{3BE66A0C-0426-4746-9D18-28364B25292A}"
9 | EndProject
10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RMMVCookTool.GUI", "RMMVCookTool.GUI\RMMVCookTool.GUI.csproj", "{304B3427-AA8C-457C-8EA0-B68CC94AD278}"
11 | EndProject
12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{18F437D8-9D1B-4D44-92A1-FE74625D2E52}"
13 | ProjectSection(SolutionItems) = preProject
14 | .editorconfig = .editorconfig
15 | EndProjectSection
16 | EndProject
17 | Global
18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
19 | Debug|Any CPU = Debug|Any CPU
20 | Debug|ARM32 = Debug|ARM32
21 | Debug|ARM64 = Debug|ARM64
22 | Debug|x64 = Debug|x64
23 | Debug|x86 = Debug|x86
24 | Release|Any CPU = Release|Any CPU
25 | Release|ARM32 = Release|ARM32
26 | Release|ARM64 = Release|ARM64
27 | Release|x64 = Release|x64
28 | Release|x86 = Release|x86
29 | EndGlobalSection
30 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
31 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|Any CPU.Build.0 = Debug|Any CPU
33 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|ARM32.ActiveCfg = Debug|ARM32
34 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|ARM32.Build.0 = Debug|ARM32
35 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|ARM64.ActiveCfg = Debug|ARM64
36 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|ARM64.Build.0 = Debug|ARM64
37 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|x64.ActiveCfg = Debug|x64
38 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|x64.Build.0 = Debug|x64
39 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|x86.ActiveCfg = Debug|x86
40 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Debug|x86.Build.0 = Debug|x86
41 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|Any CPU.ActiveCfg = Release|Any CPU
42 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|Any CPU.Build.0 = Release|Any CPU
43 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|ARM32.ActiveCfg = Release|Any CPU
44 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|ARM32.Build.0 = Release|Any CPU
45 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|ARM64.ActiveCfg = Release|ARM64
46 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|ARM64.Build.0 = Release|ARM64
47 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|x64.ActiveCfg = Release|x64
48 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|x64.Build.0 = Release|x64
49 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|x86.ActiveCfg = Release|x86
50 | {73D4B27D-9A73-48B0-A45E-A80BC69E5972}.Release|x86.Build.0 = Release|x86
51 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|Any CPU.Build.0 = Debug|Any CPU
53 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|ARM32.ActiveCfg = Debug|ARM32
54 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|ARM32.Build.0 = Debug|ARM32
55 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|ARM64.ActiveCfg = Debug|ARM64
56 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|ARM64.Build.0 = Debug|ARM64
57 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|x64.ActiveCfg = Debug|x64
58 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|x64.Build.0 = Debug|x64
59 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|x86.ActiveCfg = Debug|Any CPU
60 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Debug|x86.Build.0 = Debug|Any CPU
61 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|Any CPU.ActiveCfg = Release|Any CPU
62 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|Any CPU.Build.0 = Release|Any CPU
63 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|ARM32.ActiveCfg = Release|Any CPU
64 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|ARM32.Build.0 = Release|Any CPU
65 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|ARM64.ActiveCfg = Release|ARM64
66 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|ARM64.Build.0 = Release|ARM64
67 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|x64.ActiveCfg = Release|x64
68 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|x64.Build.0 = Release|x64
69 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|x86.ActiveCfg = Release|x86
70 | {3BE66A0C-0426-4746-9D18-28364B25292A}.Release|x86.Build.0 = Release|x86
71 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|Any CPU.Build.0 = Debug|Any CPU
73 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|ARM32.ActiveCfg = Debug|ARM32
74 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|ARM32.Build.0 = Debug|ARM32
75 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|ARM64.ActiveCfg = Debug|arm64
76 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|ARM64.Build.0 = Debug|arm64
77 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|x64.ActiveCfg = Debug|x64
78 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|x64.Build.0 = Debug|x64
79 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|x86.ActiveCfg = Debug|Any CPU
80 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Debug|x86.Build.0 = Debug|Any CPU
81 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|Any CPU.ActiveCfg = Release|Any CPU
82 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|ARM32.ActiveCfg = Release|Any CPU
83 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|ARM32.Build.0 = Release|Any CPU
84 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|ARM64.ActiveCfg = Release|arm64
85 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|ARM64.Build.0 = Release|arm64
86 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|x64.ActiveCfg = Release|x64
87 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|x64.Build.0 = Release|x64
88 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|x86.ActiveCfg = Release|x86
89 | {304B3427-AA8C-457C-8EA0-B68CC94AD278}.Release|x86.Build.0 = Release|x86
90 | EndGlobalSection
91 | GlobalSection(SolutionProperties) = preSolution
92 | HideSolutionNode = FALSE
93 | EndGlobalSection
94 | GlobalSection(ExtensibilityGlobals) = postSolution
95 | SolutionGuid = {B4BFC5B6-56D7-4C6C-A693-C8EAD58099DB}
96 | EndGlobalSection
97 | EndGlobal
98 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Views/MainView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/Utilities/CompilerUtilities.cs:
--------------------------------------------------------------------------------
1 | using Serilog;
2 | using System.Text.Json;
3 | using System.Threading.Tasks;
4 |
5 | namespace RMMVCookTool.Core.Utilities;
6 |
7 | public static class CompilerUtilities
8 | {
9 | //This bit of code handles copying a directory to a different location.
10 | ///
11 | /// Copy a folder (with it's contents) to a specified location.
12 | ///
13 | /// The path of the folder to copy from.
14 | /// The path where the folder will be copied to.
15 | /// Copy the subdirectories as well.
16 | public static void DirectoryCopy(in string sourceDirName, string destDirName, bool copySubDirs)
17 | {
18 | // Get the subdirectories for the specified directory.
19 | var dir = new DirectoryInfo(sourceDirName);
20 |
21 | if (!dir.Exists)
22 | throw new DirectoryNotFoundException(
23 | "Source directory does not exist or could not be found: "
24 | + sourceDirName);
25 |
26 | var dirs = dir.GetDirectories();
27 | // If the destination directory doesn't exist, create it.
28 | if (!Directory.Exists(destDirName)) Directory.CreateDirectory(destDirName);
29 |
30 | // Get the files in the directory and copy them to the new location.
31 | var files = dir.GetFiles();
32 | Parallel.ForEach(files, file =>
33 | {
34 | var temppath = Path.Combine(destDirName, file.Name);
35 | file.CopyTo(temppath, false);
36 | });
37 |
38 | // If copying subdirectories, copy them and their contents to new location.
39 | if (copySubDirs)
40 | Parallel.ForEach(dirs, subDir =>
41 | {
42 | var tempPath = Path.Combine(destDirName, subDir.Name);
43 | DirectoryCopy(subDir.FullName, tempPath, true);
44 | });
45 | }
46 |
47 | //This the code to search for files. Pretty simple, actually.
48 |
49 | ///
50 | /// Runs a search for files and adds them to the array.
51 | ///
52 | /// Path for Search.
53 | /// File Extension.
54 | public static List FileFinder(in string path, in string extension) => Directory.EnumerateFiles(path, extension, SearchOption.AllDirectories).ToList();
55 |
56 | public static void CleanupBin(in List fileMap)
57 | {
58 | CompilerUtilities.RecordToLog("Searching for existing binary files...", 3);
59 | //Do a normal loop for each entry on the FileMap array.
60 | foreach (string file in fileMap)
61 | {
62 | RecordToLog($"Checking for binary files that are related to {file}.", 3);
63 | //This does a small search in the path specified in the FileMap.
64 | //Adding the .* will allow us to search all the files that have an extension.
65 | var deletionMap = Directory.GetFiles(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file) + ".*");
66 | RecordToLog($"Found {deletionMap.Length} files related to {Path.GetFileName(file)}.", 3);
67 | //Doing a parallel loop here to speed up the cleanup process.
68 | Parallel.ForEach(deletionMap, fileToDelete =>
69 | {
70 | //Run a check if the file in the array is actually a JavaScript file.
71 | //If not, delete it.
72 | if (fileToDelete != file){
73 | RecordToLog($"Thread #{Environment.CurrentManagedThreadId} is deleting {Path.GetFileName(fileToDelete)}...", 3);
74 | File.Delete(fileToDelete);
75 | }
76 | });
77 | //Cleaning up the deletionMap array before refilling it.
78 | Array.Clear(deletionMap, 0, deletionMap.Length);
79 | }
80 | RecordToLog("Completed the removal of the previous binary files.", 3);
81 | }
82 |
83 | public static void RemoveDebugFiles(in string projectLocation)
84 | {
85 | RecordToLog("Checking for the jsconfig.json file...", 3);
86 | if (File.Exists(Path.Combine(projectLocation, "js", "jsconfig.json")))
87 | {
88 | RecordToLog("Found it. Removing...", 3);
89 | File.Delete(Path.Combine(projectLocation, "js", "jsconfig.json"));
90 | }
91 | else RecordToLog("Not found.", 3);
92 | RecordToLog("Searching for Typescript definition files...", 3);
93 | var TSDeletionMap = Directory.GetFiles(projectLocation, ".d.ts", SearchOption.AllDirectories);
94 | RecordToLog($"Found {TSDeletionMap.Length}.", 3);
95 | foreach (string file in TSDeletionMap)
96 | {
97 | RecordToLog($"Removing{file}...",3);
98 | File.Delete(file);
99 | }
100 | RecordToLog("Searching for JS Map files...", 3);
101 | var JsFileMaps = Directory.GetFiles(projectLocation, ".js.map", SearchOption.AllDirectories);
102 | RecordToLog($"Found {JsFileMaps.Length} JS Map files.",3);
103 | foreach (string file in JsFileMaps) {
104 | RecordToLog($"Removing{file}...", 3);
105 | File.Delete(file);
106 | }
107 | RecordToLog("Completed the removal of debug files.", 3);
108 | }
109 |
110 | public static string GetProjectFilesLocation(string projectLocation)
111 | {
112 | if (File.Exists(projectLocation))
113 | {
114 | string input = File.ReadAllText(projectLocation);
115 | using (JsonDocument inputJson = JsonDocument.Parse(input))
116 | {
117 | var tempstring = inputJson.RootElement.GetProperty("main");
118 | if (tempstring.GetString() != null)
119 | {
120 | string[] dataPart = tempstring.GetString().Split('/');
121 | string tempString2 = dataPart[0];
122 | if (dataPart.Length >= 2)
123 | {
124 | for (int i = 1; i < dataPart.Length - 2; i++)
125 | {
126 | tempString2 += dataPart[i] + ((RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) ? "\\" : "/");
127 | }
128 | }
129 | else
130 | {
131 | if (tempString2.Contains(".html")) tempString2 = "";
132 | }
133 | return Path.Combine(projectLocation.Replace(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "\\package.json" : "/package.json", "", StringComparison.Ordinal), tempString2);
134 | }
135 | else return "Null";
136 | }
137 | }
138 | else return "Unknown";
139 | }
140 |
141 | public static void StartEngineLogger(string CompilerName, bool needsConsoleForLog) =>
142 | #if DEBUG
143 | Log.Logger = (needsConsoleForLog) ? new LoggerConfiguration().MinimumLevel.Debug().WriteTo.Console().WriteTo.File(Path.Combine(Path.GetTempPath(), $"CompilerSession-{CompilerName}-{DateTime.Now:yyyyMMdd-hhmm}.log")).CreateLogger() : new LoggerConfiguration().MinimumLevel.Debug().WriteTo.File(Path.Combine(Path.GetTempPath(), $"CompilerSession-{CompilerName}-{DateTime.Now:yyyyMMdd-hhmm}.log")).CreateLogger();
144 | #else
145 | Log.Logger = (needsConsoleForLog) ? new LoggerConfiguration().MinimumLevel.Information().WriteTo.Console().WriteTo.File(Path.Combine(Path.GetTempPath(), $"CompilerSession-{CompilerName}-{DateTime.Now:yyyyMMdd-hhmm}.log")).CreateLogger() : new LoggerConfiguration().MinimumLevel.Information().WriteTo.File(Path.Combine(Path.GetTempPath(), $"CompilerSession-{CompilerName}-{DateTime.Now:yyyyMMdd-hhmm}.log")).CreateLogger();
146 | #endif
147 |
148 |
149 | public static void RecordToLog(Exception ex) => Log.Fatal(ex, $" Crash! ");
150 |
151 | public static void RecordToLog(string message, int type)
152 | {
153 | switch (type)
154 | {
155 | case 3:
156 | Log.Debug($"[Internal mechanism]{message}");
157 | break;
158 | case 2:
159 | Log.Error($"{message}");
160 | break;
161 | case 1:
162 | Log.Warning($"{message}");
163 | break;
164 | case 0:
165 | Log.Information($"{message}");
166 | break;
167 | }
168 | }
169 |
170 | public static void CloseLog() => Log.CloseAndFlush();
171 | }
172 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # Tye
66 | .tye/
67 |
68 | # ASP.NET Scaffolding
69 | ScaffoldingReadMe.txt
70 |
71 | # StyleCop
72 | StyleCopReport.xml
73 |
74 | # Files built by Visual Studio
75 | *_i.c
76 | *_p.c
77 | *_h.h
78 | *.ilk
79 | *.meta
80 | *.obj
81 | *.iobj
82 | *.pch
83 | *.pdb
84 | *.ipdb
85 | *.pgc
86 | *.pgd
87 | *.rsp
88 | *.sbr
89 | *.tlb
90 | *.tli
91 | *.tlh
92 | *.tmp
93 | *.tmp_proj
94 | *_wpftmp.csproj
95 | *.log
96 | *.vspscc
97 | *.vssscc
98 | .builds
99 | *.pidb
100 | *.svclog
101 | *.scc
102 |
103 | # Chutzpah Test files
104 | _Chutzpah*
105 |
106 | # Visual C++ cache files
107 | ipch/
108 | *.aps
109 | *.ncb
110 | *.opendb
111 | *.opensdf
112 | *.sdf
113 | *.cachefile
114 | *.VC.db
115 | *.VC.VC.opendb
116 |
117 | # Visual Studio profiler
118 | *.psess
119 | *.vsp
120 | *.vspx
121 | *.sap
122 |
123 | # Visual Studio Trace Files
124 | *.e2e
125 |
126 | # TFS 2012 Local Workspace
127 | $tf/
128 |
129 | # Guidance Automation Toolkit
130 | *.gpState
131 |
132 | # ReSharper is a .NET coding add-in
133 | _ReSharper*/
134 | *.[Rr]e[Ss]harper
135 | *.DotSettings.user
136 |
137 | # TeamCity is a build add-in
138 | _TeamCity*
139 |
140 | # DotCover is a Code Coverage Tool
141 | *.dotCover
142 |
143 | # AxoCover is a Code Coverage Tool
144 | .axoCover/*
145 | !.axoCover/settings.json
146 |
147 | # Coverlet is a free, cross platform Code Coverage Tool
148 | coverage*.json
149 | coverage*.xml
150 | coverage*.info
151 |
152 | # Visual Studio code coverage results
153 | *.coverage
154 | *.coveragexml
155 |
156 | # NCrunch
157 | _NCrunch_*
158 | .*crunch*.local.xml
159 | nCrunchTemp_*
160 |
161 | # MightyMoose
162 | *.mm.*
163 | AutoTest.Net/
164 |
165 | # Web workbench (sass)
166 | .sass-cache/
167 |
168 | # Installshield output folder
169 | [Ee]xpress/
170 |
171 | # DocProject is a documentation generator add-in
172 | DocProject/buildhelp/
173 | DocProject/Help/*.HxT
174 | DocProject/Help/*.HxC
175 | DocProject/Help/*.hhc
176 | DocProject/Help/*.hhk
177 | DocProject/Help/*.hhp
178 | DocProject/Help/Html2
179 | DocProject/Help/html
180 |
181 | # Click-Once directory
182 | publish/
183 |
184 | # Publish Web Output
185 | *.[Pp]ublish.xml
186 | *.azurePubxml
187 | # Note: Comment the next line if you want to checkin your web deploy settings,
188 | # but database connection strings (with potential passwords) will be unencrypted
189 | *.pubxml
190 | *.publishproj
191 |
192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
193 | # checkin your Azure Web App publish settings, but sensitive information contained
194 | # in these scripts will be unencrypted
195 | PublishScripts/
196 |
197 | # NuGet Packages
198 | *.nupkg
199 | # NuGet Symbol Packages
200 | *.snupkg
201 | # The packages folder can be ignored because of Package Restore
202 | **/[Pp]ackages/*
203 | # except build/, which is used as an MSBuild target.
204 | !**/[Pp]ackages/build/
205 | # Uncomment if necessary however generally it will be regenerated when needed
206 | #!**/[Pp]ackages/repositories.config
207 | # NuGet v3's project.json files produces more ignorable files
208 | *.nuget.props
209 | *.nuget.targets
210 |
211 | # Microsoft Azure Build Output
212 | csx/
213 | *.build.csdef
214 |
215 | # Microsoft Azure Emulator
216 | ecf/
217 | rcf/
218 |
219 | # Windows Store app package directories and files
220 | AppPackages/
221 | BundleArtifacts/
222 | Package.StoreAssociation.xml
223 | _pkginfo.txt
224 | *.appx
225 | *.appxbundle
226 | *.appxupload
227 |
228 | # Visual Studio cache files
229 | # files ending in .cache can be ignored
230 | *.[Cc]ache
231 | # but keep track of directories ending in .cache
232 | !?*.[Cc]ache/
233 |
234 | # Others
235 | ClientBin/
236 | ~$*
237 | *~
238 | *.dbmdl
239 | *.dbproj.schemaview
240 | *.jfm
241 | *.pfx
242 | *.publishsettings
243 | orleans.codegen.cs
244 |
245 | # Including strong name files can present a security risk
246 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
247 | #*.snk
248 |
249 | # Since there are multiple workflows, uncomment next line to ignore bower_components
250 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
251 | #bower_components/
252 |
253 | # RIA/Silverlight projects
254 | Generated_Code/
255 |
256 | # Backup & report files from converting an old project file
257 | # to a newer Visual Studio version. Backup files are not needed,
258 | # because we have git ;-)
259 | _UpgradeReport_Files/
260 | Backup*/
261 | UpgradeLog*.XML
262 | UpgradeLog*.htm
263 | ServiceFabricBackup/
264 | *.rptproj.bak
265 |
266 | # SQL Server files
267 | *.mdf
268 | *.ldf
269 | *.ndf
270 |
271 | # Business Intelligence projects
272 | *.rdl.data
273 | *.bim.layout
274 | *.bim_*.settings
275 | *.rptproj.rsuser
276 | *- [Bb]ackup.rdl
277 | *- [Bb]ackup ([0-9]).rdl
278 | *- [Bb]ackup ([0-9][0-9]).rdl
279 |
280 | # Microsoft Fakes
281 | FakesAssemblies/
282 |
283 | # GhostDoc plugin setting file
284 | *.GhostDoc.xml
285 |
286 | # Node.js Tools for Visual Studio
287 | .ntvs_analysis.dat
288 | node_modules/
289 |
290 | # Visual Studio 6 build log
291 | *.plg
292 |
293 | # Visual Studio 6 workspace options file
294 | *.opt
295 |
296 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
297 | *.vbw
298 |
299 | # Visual Studio LightSwitch build output
300 | **/*.HTMLClient/GeneratedArtifacts
301 | **/*.DesktopClient/GeneratedArtifacts
302 | **/*.DesktopClient/ModelManifest.xml
303 | **/*.Server/GeneratedArtifacts
304 | **/*.Server/ModelManifest.xml
305 | _Pvt_Extensions
306 |
307 | # Paket dependency manager
308 | .paket/paket.exe
309 | paket-files/
310 |
311 | # FAKE - F# Make
312 | .fake/
313 |
314 | # CodeRush personal settings
315 | .cr/personal
316 |
317 | # Python Tools for Visual Studio (PTVS)
318 | __pycache__/
319 | *.pyc
320 |
321 | # Cake - Uncomment if you are using it
322 | # tools/**
323 | # !tools/packages.config
324 |
325 | # Tabs Studio
326 | *.tss
327 |
328 | # Telerik's JustMock configuration file
329 | *.jmconfig
330 |
331 | # BizTalk build output
332 | *.btp.cs
333 | *.btm.cs
334 | *.odx.cs
335 | *.xsd.cs
336 |
337 | # OpenCover UI analysis results
338 | OpenCover/
339 |
340 | # Azure Stream Analytics local run output
341 | ASALocalRun/
342 |
343 | # MSBuild Binary and Structured Log
344 | *.binlog
345 |
346 | # NVidia Nsight GPU debugger configuration file
347 | *.nvuser
348 |
349 | # MFractors (Xamarin productivity tool) working folder
350 | .mfractor/
351 |
352 | # Local History for Visual Studio
353 | .localhistory/
354 |
355 | # BeatPulse healthcheck temp database
356 | healthchecksdb
357 |
358 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
359 | MigrationBackup/
360 |
361 | # Ionide (cross platform F# VS Code tools) working folder
362 | .ionide/
363 |
364 | # Fody - auto-generated XML schema
365 | FodyWeavers.xsd
366 |
367 | ##
368 | ## Visual studio for Mac
369 | ##
370 |
371 |
372 | # globs
373 | Makefile.in
374 | *.userprefs
375 | *.usertasks
376 | config.make
377 | config.status
378 | aclocal.m4
379 | install-sh
380 | autom4te.cache/
381 | *.tar.gz
382 | tarballs/
383 | test-results/
384 |
385 | # Mac bundle stuff
386 | *.dmg
387 | *.app
388 |
389 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
390 | # General
391 | .DS_Store
392 | .AppleDouble
393 | .LSOverride
394 |
395 | # Icon must end with two \r
396 | Icon
397 |
398 |
399 | # Thumbnails
400 | ._*
401 |
402 | # Files that might appear in the root of a volume
403 | .DocumentRevisions-V100
404 | .fseventsd
405 | .Spotlight-V100
406 | .TemporaryItems
407 | .Trashes
408 | .VolumeIcon.icns
409 | .com.apple.timemachine.donotpresent
410 |
411 | # Directories potentially created on remote AFP share
412 | .AppleDB
413 | .AppleDesktop
414 | Network Trash Folder
415 | Temporary Items
416 | .apdisk
417 |
418 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
419 | # Windows thumbnail cache files
420 | Thumbs.db
421 | ehthumbs.db
422 | ehthumbs_vista.db
423 |
424 | # Dump file
425 | *.stackdump
426 |
427 | # Folder config file
428 | [Dd]esktop.ini
429 |
430 | # Recycle Bin used on file shares
431 | $RECYCLE.BIN/
432 |
433 | # Windows Installer files
434 | *.cab
435 | *.msi
436 | *.msix
437 | *.msm
438 | *.msp
439 |
440 | # Windows shortcuts
441 | *.lnk
442 |
443 | # JetBrains Rider
444 | .idea/
445 | *.sln.iml
446 |
447 | ##
448 | ## Visual Studio Code
449 | ##
450 | .vscode/*
451 | !.vscode/settings.json
452 | !.vscode/tasks.json
453 | !.vscode/launch.json
454 | !.vscode/extensions.json
455 | /tools/cache
456 | /RMMVCookTool.GUI2
457 |
--------------------------------------------------------------------------------
/RMMVCookTool.Core/Compiler/CompilerProject.cs:
--------------------------------------------------------------------------------
1 | using System.IO.Compression;
2 | using RMMVCookTool.Core.Utilities;
3 |
4 | namespace RMMVCookTool.Core.Compiler;
5 |
6 | public sealed class CompilerProject : CompilerProjectBase
7 | {
8 | public string ProjectLocation { get; set; }
9 | public List FileMap { get; set; }
10 | public string GameFilesLocation { get; set; }
11 | public ProjectSettings Setup { get; set; }
12 |
13 | public CompilerProject() => Setup = new();
14 |
15 | public CompilerProject(string project)
16 | {
17 | ProjectLocation = project;
18 | Setup = new();
19 | FileMap = new List();
20 | }
21 |
22 | public CompilerProject(string project, string fileExtension, bool removeAfterCompile, bool compressToPackage, bool removeAfterCompression, int compressionLevel)
23 | {
24 | ProjectLocation = project;
25 | Setup = new()
26 | {
27 | RemoveSourceFiles = removeAfterCompile,
28 | FileExtension = fileExtension,
29 | CompressProjectFiles = compressToPackage,
30 | RemoveFilesAfterCompression = removeAfterCompression,
31 | CompressionLevel = compressionLevel
32 | };
33 | FileMap = new List();
34 | }
35 |
36 | public CompilerProject(string project, in ProjectSettings settings)
37 | {
38 | ProjectLocation = project;
39 | Setup = settings;
40 | FileMap = new List();
41 | }
42 |
43 | public void PullSourceFiles() => FileMap = CompilerUtilities.FileFinder(ProjectLocation, "*.js");
44 |
45 | //This method starts the nw.exe file.
46 | ///
47 | /// Starts the NW.js compiler.
48 | ///
49 | /// The index in the list.
50 | public CompilerErrorReport CompileFile(int index)
51 | {
52 | CompilerUtilities.RecordToLog("Setting up the compiler...", 3);
53 | //Removing the JavaScript extension. Needed to place our own File Extension.
54 | //Setting up the compiler by throwing in two arguments.
55 | //The first bit (the one with the file variable) is the source.
56 | //The second bit (the one with the fileBuffer variable) makes the final file.
57 | CompilerInfo.Value.Arguments = "\"" + FileMap[index] + "\" \"" +
58 | FileMap[index].Replace(".js", "." + Setup.FileExtension, StringComparison.Ordinal) + "\"";
59 | //Making sure not to show the nwjc window. That program doesn't show anything of usefulness.
60 | CompilerInfo.Value.CreateNoWindow = true;
61 | CompilerInfo.Value.RedirectStandardOutput = true;
62 | CompilerInfo.Value.RedirectStandardError = true;
63 | CompilerInfo.Value.WindowStyle = ProcessWindowStyle.Hidden;
64 | CompilerErrorReport report = new();
65 | //Run the compiler.
66 | CompilerUtilities.RecordToLog($"nwjc processing the file {FileMap[index]}...", 3);
67 | Process compilerProcess = Process.Start(CompilerInfo.Value);
68 | report.ErrorMessage = compilerProcess.StandardError.ReadToEnd();
69 | compilerProcess.WaitForExit();
70 | if(compilerProcess.ExitCode != 0)
71 | {
72 | report.ErrorCode = compilerProcess.ExitCode;
73 | CompilerUtilities.RecordToLog($"nwjc hit an error and exited with code {compilerProcess.ExitCode}. Check file.", 2);
74 | CompilerUtilities.RecordToLog($"Retrieved information from the compiler:{report.ErrorMessage}", 2);
75 | return report;
76 | }
77 | else
78 | {
79 | //If the user asked to remove the JS files, delete them.
80 | if (Setup.RemoveSourceFiles)
81 | {
82 | CompilerUtilities.RecordToLog($"Removing the file {FileMap[index]}...", 3);
83 | File.Delete(FileMap[index]);
84 | }
85 | return report;
86 | }
87 |
88 |
89 |
90 | }
91 |
92 | //This method starts the nw.exe file.
93 | ///
94 | /// Starts the NW.js binary.
95 | ///
96 | /// The location of the NW.js SDK folder.
97 | public void RunTest(in string sdkLocation)
98 | {
99 | if (File.Exists(Path.Combine(sdkLocation,
100 | RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "nwjs.exe" : "nwjs")))
101 | Process.Start(
102 | Path.Combine(sdkLocation,
103 | RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "nwjs.exe" : "nwjs"),
104 | "--nwapp=\"" + ProjectLocation + "\"");
105 | else if (File.Exists(Path.Combine(sdkLocation,
106 | RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "Game.exe" : "Game")))
107 | Process.Start(
108 | Path.Combine(sdkLocation,
109 | RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "Game.exe" : "Game"),
110 | "--nwapp=\"" + ProjectLocation + "\"");
111 | }
112 |
113 | //This method compresses the files found on the temporary location.
114 | ///
115 | /// Compresses the game's files (after copying them in a temporary location) to a zip file named package.nw (app.nw on Mac).
116 | ///
117 | public void CompressFiles()
118 | {
119 | string packageOutput = Path.Combine(ProjectLocation, ArchiveName);
120 | if (File.Exists(packageOutput)) File.Delete(packageOutput);
121 | //Temporary prepare a string for stripping.
122 | string stripPart = ProjectLocation + (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "\\" : "/");
123 | //List all the files in the game's www folder.
124 | CompilerUtilities.RecordToLog("Cataloging files...", 3);
125 | List tempList = CompilerUtilities.FileFinder(GameFilesLocation, "*");
126 | List gameFiles = FilterFiles(tempList);
127 |
128 | CompilerUtilities.RecordToLog($"Found {gameFiles.Count}", 3);
129 | using (ZipArchive packageArchive = ZipFile.Open(packageOutput, ZipArchiveMode.Create))
130 | {
131 | foreach (string file in gameFiles)
132 | {
133 | CompilerUtilities.RecordToLog($"Compressing {file}...", 3);
134 | //Start adding files.
135 | switch (Setup.CompressionLevel)
136 | {
137 | case 2:
138 | packageArchive.CreateEntryFromFile(file, file.Replace(stripPart, "", StringComparison.Ordinal),
139 | CompressionLevel.NoCompression);
140 | break;
141 | case 1:
142 | packageArchive.CreateEntryFromFile(file, file.Replace(stripPart, "", StringComparison.Ordinal),
143 | CompressionLevel.Fastest);
144 | break;
145 | default:
146 | packageArchive.CreateEntryFromFile(file, file.Replace(stripPart, "", StringComparison.Ordinal),
147 | CompressionLevel.Optimal);
148 | break;
149 | }
150 | if (Setup.RemoveFilesAfterCompression) File.Delete(file);
151 |
152 | }
153 |
154 | //Add the project.json files to finish the package.
155 | if (File.Exists(Path.Combine(ProjectLocation, "package.json")) && ProjectLocation != GameFilesLocation)
156 | {
157 | packageArchive.CreateEntryFromFile(Path.Combine(ProjectLocation, "package.json"), "package.json");
158 | if (Setup.RemoveFilesAfterCompression) File.Delete(Path.Combine(ProjectLocation, "package.json"));
159 | }
160 | if (Setup.RemoveFilesAfterCompression) CleanupFolders();
161 | }
162 |
163 | }
164 |
165 | ///
166 | /// Filters the list from the files of nwjs.
167 | ///
168 | /// A list that needs cleaning.
169 | /// A list that has refrences of nwjs files removed.
170 | public static List FilterFiles (in List originalList)
171 | {
172 | List finalList = originalList;
173 | bool notCleanedUp = true;
174 | while (notCleanedUp)
175 | {
176 | notCleanedUp = false;
177 | foreach (string file in finalList)
178 | {
179 | if (file.Contains(".pak") || file.Contains(".pak.info") || file.Contains(".exe") || file.Contains(".nexe") || file.Contains(".dll") || file.Contains("pnacl") || file.Contains("swiftshader") || file.Contains("credits.html") || file.Contains(".dat") || file.Contains("v8_context_snapshot.bin") || file.Contains("save") || file.Contains(".nw") || file.Contains(".log"))
180 | {
181 | notCleanedUp = true;
182 | finalList.Remove(file);
183 | break;
184 | }
185 | }
186 | }
187 |
188 | return finalList;
189 | }
190 |
191 | private void CleanupFolders()
192 | {
193 | List AllFolders = Directory.EnumerateDirectories(ProjectLocation).ToList();
194 | List GameFolders = new();
195 | GameFolders.AddRange(from string directory in AllFolders
196 | where !directory.Contains("swiftshader") && !directory.Contains("locales") && !directory.Contains("pnacl") && !directory.Contains("lib")
197 | select directory);
198 | foreach (string folder in from string folder in GameFolders
199 | where Directory.Exists(folder)
200 | select folder)
201 | {
202 | Directory.Delete(folder, true);
203 | }
204 | }
205 | }
206 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/ViewModels/MetadataEditorViewModel.cs:
--------------------------------------------------------------------------------
1 | using Prism.Commands;
2 | using Prism.Mvvm;
3 | using Prism.Dialogs;
4 | using RMMVCookTool.Core.ProjectTemplate;
5 | using System.Text.Json;
6 |
7 | namespace RMMVCookTool.GUI.ViewModels;
8 | public sealed class MetadataEditorViewModel : BindableBase, IDialogAware
9 | {
10 | #region Variables
11 | public string Title => Resources.GamePackageMetadataEditorTitleText;
12 | private string projectLocation;
13 | private string gameId;
14 | private string indexFileLocation;
15 | private string gameVersion;
16 | private bool enableNodeJs;
17 | private string chromiumFlags;
18 | private string jsFlags;
19 | private string gameName;
20 | private string gameIconLocation;
21 | private string windowTitle;
22 | private string windowId;
23 | private bool isWindowResizable;
24 | private int windowModeIndex;
25 | private int windowStartLocation;
26 | private uint windowHeight;
27 | private uint windowWidth;
28 | private uint minHeight;
29 | private uint minWidth;
30 | #endregion
31 |
32 | #region Properties
33 | internal ProjectMetadata ProjectMetadata { get; set; }
34 | public string GameId {
35 | get => gameId; set {
36 | ProjectMetadata.GameName = value;
37 | SetProperty(ref gameId, value);
38 | }
39 | }
40 | public string IndexFileLocation {
41 | get => indexFileLocation; set {
42 | ProjectMetadata.MainFile = value;
43 | SetProperty(ref indexFileLocation, value);
44 | }
45 | }
46 | public string GameVersion {
47 | get => gameVersion; set {
48 | ProjectMetadata.GameVersion = value;
49 | SetProperty(ref gameVersion, value);
50 | }
51 | }
52 | public bool EnableNodeJs {
53 | get => enableNodeJs; set {
54 | ProjectMetadata.UseNodeJs = value;
55 | SetProperty(ref enableNodeJs, value);
56 | }
57 | }
58 | public string ChromiumFlags {
59 | get => chromiumFlags; set {
60 | ProjectMetadata.ChromiumFlags = value;
61 | SetProperty(ref chromiumFlags, value);
62 | }
63 | }
64 | public string JsFlags {
65 | get => jsFlags; set {
66 | ProjectMetadata.JsFlags = value;
67 | SetProperty(ref jsFlags, value);
68 | }
69 | }
70 | public string GameName {
71 | get => gameName; set {
72 | ProjectMetadata.GameTitle = value;
73 | SetProperty(ref gameName, value);
74 | }
75 | }
76 | public string GameIconLocation {
77 | get => gameIconLocation; set {
78 | ProjectMetadata.WindowProperties.WindowIcon = value;
79 | SetProperty(ref gameIconLocation, value);
80 | }
81 | }
82 | public string WindowTitle {
83 | get => windowTitle; set {
84 | ProjectMetadata.WindowProperties.WindowTitle = value;
85 | SetProperty(ref windowTitle, value);
86 | }
87 | }
88 | public string WindowId {
89 | get => windowId; set {
90 | ProjectMetadata.WindowProperties.WindowId = value;
91 | SetProperty(ref windowId, value);
92 | }
93 | }
94 | public bool IsWindowResizable {
95 | get => isWindowResizable; set {
96 | ProjectMetadata.WindowProperties.IsResizable = value;
97 | SetProperty(ref isWindowResizable, value);
98 | }
99 | }
100 | public int WindowModeIndex {
101 | get => windowModeIndex; set {
102 | switch (value)
103 | {
104 | case 2:
105 | ProjectMetadata.WindowProperties.StartAtFullScreen = false;
106 | ProjectMetadata.WindowProperties.RunInKioskMode = true;
107 | break;
108 | case 1:
109 | ProjectMetadata.WindowProperties.StartAtFullScreen = true;
110 | ProjectMetadata.WindowProperties.RunInKioskMode = false;
111 | break;
112 | default:
113 | ProjectMetadata.WindowProperties.StartAtFullScreen = false;
114 | ProjectMetadata.WindowProperties.RunInKioskMode = false;
115 | break;
116 | }
117 | SetProperty(ref windowModeIndex, value);
118 | }
119 | }
120 | public int WindowStartLocation {
121 | get => windowStartLocation; set {
122 | ProjectMetadata.WindowProperties.ScreenPosition = value switch
123 | {
124 | 2 => "mouse",
125 | 1 => "center",
126 | _ => "none",
127 | };
128 | SetProperty(ref windowStartLocation, value);
129 | }
130 | }
131 | public uint WindowHeight {
132 | get => windowHeight; set {
133 | SetProperty(ref windowHeight, value);
134 | ProjectMetadata.WindowProperties.WindowHeight = value;
135 | }
136 | }
137 | public uint WindowWidth {
138 | get => windowWidth; set {
139 | SetProperty(ref windowWidth, value);
140 | ProjectMetadata.WindowProperties.WindowWidth = value;
141 | }
142 | }
143 | public uint MinHeight {
144 | get => minHeight; set {
145 | SetProperty(ref minHeight, value);
146 | ProjectMetadata.WindowProperties.MinimumHeight = value;
147 | }
148 | }
149 | public uint MinWidth {
150 | get => minWidth; set {
151 | SetProperty(ref minWidth, value);
152 | ProjectMetadata.WindowProperties.MinimumWidth = value;
153 | }
154 | }
155 | #endregion
156 |
157 | #region Commands
158 | public DelegateCommand FindHtmlFileCommand { get; private set; }
159 | public DelegateCommand FindIconFileCommand { get; private set; }
160 | public DelegateCommand SaveCommand { get; private set; }
161 | public DelegateCommand CloseCommand { get; private set; }
162 |
163 | public DialogCloseListener RequestClose { get; }
164 | #endregion
165 |
166 | public MetadataEditorViewModel()
167 | {
168 | SaveCommand = new DelegateCommand(SaveJsonFile);
169 | CloseCommand = new DelegateCommand(CloseDialog);
170 | FindHtmlFileCommand = new DelegateCommand(FindHtmlFile);
171 | FindIconFileCommand = new DelegateCommand(FindIconFile);
172 | }
173 |
174 | public bool CanCloseDialog() => true;
175 | public void OnDialogClosed()
176 | {
177 | //Method intentionally left blank
178 | }
179 | public void OnDialogOpened(IDialogParameters parameters)
180 | {
181 | projectLocation = parameters.GetValue("location");
182 | if (File.Exists(Path.Combine(projectLocation, "package.json")))
183 | {
184 | string importFile = File.ReadAllText(Path.Combine(projectLocation, "package.json"));
185 | ProjectMetadata = JsonSerializer.Deserialize(importFile, ProjectMetadataSerializer.Default.ProjectMetadata);
186 | }
187 | else ProjectMetadata = new();
188 | ConvertValues();
189 |
190 | }
191 |
192 | public void SaveJsonFile()
193 | {
194 | try
195 | {
196 | string output = JsonSerializer.Serialize(ProjectMetadata, ProjectMetadataSerializer.Default.ProjectMetadata);
197 | File.WriteAllText(Path.Combine(projectLocation, "package.json"), output);
198 | MessageDialog.ThrowCompleteMessage(Resources.SaveCompleteText);
199 | }
200 | catch (FileFormatException ex)
201 | {
202 | MessageDialog.ThrowErrorMessage(ex);
203 | }
204 | catch (PathTooLongException ex)
205 | {
206 | MessageDialog.ThrowErrorMessage(ex);
207 | }
208 |
209 | catch (IOException ex)
210 | {
211 | MessageDialog.ThrowErrorMessage(ex);
212 | }
213 | catch (UnauthorizedAccessException ex)
214 | {
215 | MessageDialog.ThrowErrorMessage(ex);
216 | }
217 | }
218 | public void CloseDialog()
219 | {
220 | ButtonResult result = ButtonResult.OK;
221 | RequestClose.Invoke(new DialogResult(result));
222 | }
223 |
224 | private void ConvertValues()
225 | {
226 | GameId = ProjectMetadata.GameName;
227 | IndexFileLocation = ProjectMetadata.MainFile;
228 | GameVersion = ProjectMetadata.GameVersion;
229 | EnableNodeJs = ProjectMetadata.UseNodeJs;
230 | ChromiumFlags = ProjectMetadata.ChromiumFlags;
231 | JsFlags = ProjectMetadata.JsFlags;
232 | GameName = ProjectMetadata.GameTitle;
233 | GameIconLocation = ProjectMetadata.WindowProperties.WindowIcon;
234 | WindowTitle = ProjectMetadata.WindowProperties.WindowTitle;
235 | WindowId = ProjectMetadata.WindowProperties.WindowId;
236 | IsWindowResizable = ProjectMetadata.WindowProperties.IsResizable;
237 | if (ProjectMetadata.WindowProperties.StartAtFullScreen) WindowModeIndex = 1;
238 | else if (ProjectMetadata.WindowProperties.RunInKioskMode) WindowModeIndex = 2;
239 | else WindowModeIndex = 0;
240 | WindowStartLocation = (ProjectMetadata.WindowProperties.ScreenPosition) switch
241 | {
242 | "mouse" => 2,
243 | "center" => 1,
244 | _ => 0,
245 | };
246 | WindowHeight = ProjectMetadata.WindowProperties.WindowHeight;
247 | WindowWidth = ProjectMetadata.WindowProperties.WindowWidth;
248 | MinHeight = ProjectMetadata.WindowProperties.MinimumHeight;
249 | MinWidth = ProjectMetadata.WindowProperties.MinimumWidth;
250 | }
251 |
252 | private void FindHtmlFile()
253 | {
254 | VistaOpenFileDialog htmlFilePicker = new()
255 | {
256 | Title = Resources.ProjectPickerText,
257 | Filter = Resources.HTMLFileText,
258 | InitialDirectory = projectLocation,
259 | Multiselect = false
260 | };
261 | bool? pickerResult = htmlFilePicker.ShowDialog();
262 | if (pickerResult != true) return;
263 | if (htmlFilePicker.FileName.Contains(projectLocation))
264 | {
265 | string stringBuffer = htmlFilePicker.FileName.Replace(projectLocation + "\\", "");
266 | stringBuffer = stringBuffer.Replace("\\", "/");
267 | IndexFileLocation = stringBuffer;
268 |
269 | }
270 | else
271 | {
272 | MessageDialog.ThrowErrorMessage(Resources.ErrorText, Resources.FileOutsideOfProjectError);
273 | }
274 | }
275 |
276 | private void FindIconFile()
277 | {
278 | VistaOpenFileDialog iconFilePicker = new()
279 | {
280 | Title = Resources.ProjectPickerText,
281 | Filter = Resources.PNGFileText,
282 | InitialDirectory = projectLocation,
283 | Multiselect = false
284 | };
285 | bool? pickerResult = iconFilePicker.ShowDialog();
286 | if (pickerResult != true) return;
287 | if (iconFilePicker.FileName.Contains(projectLocation))
288 | {
289 | string stringBuffer = iconFilePicker.FileName.Replace(projectLocation + "\\", "");
290 | stringBuffer = stringBuffer.Replace("\\", "/");
291 | GameIconLocation = ProjectMetadata.WindowProperties.WindowIcon = stringBuffer;
292 | }
293 | else
294 | {
295 | MessageDialog.ThrowErrorMessage(Resources.ErrorText, Resources.FileOutsideOfProjectError);
296 | }
297 | }
298 | }
299 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\acemo\source\repos\RMMVCookTool codebase based on best match to current usage at 13/4/2022
2 | # You can modify the rules from these initially generated values to suit your own policies
3 | # You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
4 | [*.cs]
5 |
6 |
7 | #Core editorconfig formatting - indentation
8 |
9 | #use soft tabs (spaces) for indentation
10 | indent_style = space
11 |
12 | #Formatting - indentation options
13 |
14 | #indent switch case contents.
15 | csharp_indent_case_contents = true
16 | #indent switch labels
17 | csharp_indent_switch_labels = true
18 |
19 | #Formatting - new line options
20 |
21 | #place catch statements on a new line
22 | csharp_new_line_before_catch = true
23 | #place else statements on a new line
24 | csharp_new_line_before_else = true
25 | #require members of object intializers to be on separate lines
26 | csharp_new_line_before_members_in_object_initializers = true
27 | #require braces to be on a new line for object_collection_array_initializers, lambdas, methods, control_blocks, and types (also known as "Allman" style)
28 | csharp_new_line_before_open_brace = object_collection_array_initializers, lambdas, methods, control_blocks, types
29 |
30 | #Formatting - organize using options
31 |
32 | #do not place System.* using directives before other using directives
33 | dotnet_sort_system_directives_first = false
34 |
35 | #Formatting - spacing options
36 |
37 | #require a space before the colon for bases or interfaces in a type declaration
38 | csharp_space_after_colon_in_inheritance_clause = true
39 | #require a space after a keyword in a control flow statement such as a for loop
40 | csharp_space_after_keywords_in_control_flow_statements = true
41 | #require a space before the colon for bases or interfaces in a type declaration
42 | csharp_space_before_colon_in_inheritance_clause = true
43 | #remove space within empty argument list parentheses
44 | csharp_space_between_method_call_empty_parameter_list_parentheses = false
45 | #remove space between method call name and opening parenthesis
46 | csharp_space_between_method_call_name_and_opening_parenthesis = false
47 | #do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
48 | csharp_space_between_method_call_parameter_list_parentheses = false
49 | #remove space within empty parameter list parentheses for a method declaration
50 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
51 | #place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
52 | csharp_space_between_method_declaration_parameter_list_parentheses = false
53 |
54 | #Formatting - wrapping options
55 |
56 | #leave code block on single line
57 | csharp_preserve_single_line_blocks = true
58 | #leave statements and member declarations on the same line
59 | csharp_preserve_single_line_statements = true
60 |
61 | #Style - Code block preferences
62 |
63 | #prefer no curly braces if allowed
64 | csharp_prefer_braces = false:suggestion
65 |
66 | #Style - expression bodied member options
67 |
68 | #prefer block bodies for constructors
69 | csharp_style_expression_bodied_constructors = true:suggestion
70 | #prefer block bodies for methods
71 | csharp_style_expression_bodied_methods = true:suggestion
72 |
73 | #Style - Expression-level preferences
74 |
75 | #prefer objects to be initialized using object initializers when possible
76 | dotnet_style_object_initializer = true:suggestion
77 |
78 | #Style - implicit and explicit types
79 |
80 | #prefer var over explicit type in all cases, unless overridden by another code style rule
81 | csharp_style_var_elsewhere = false:suggestion
82 | #prefer var is used to declare variables with built-in system types such as int
83 | csharp_style_var_for_built_in_types = false:suggestion
84 | #prefer var when the type is already mentioned on the right-hand side of a declaration expression
85 | csharp_style_var_when_type_is_apparent = false:suggestion
86 |
87 | #Style - language keyword and framework type options
88 |
89 | #prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them
90 | dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
91 |
92 | #Style - modifier options
93 |
94 | #prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods.
95 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
96 |
97 | #Style - Modifier preferences
98 |
99 | #when this rule is set to a list of modifiers, prefer the specified ordering.
100 | csharp_preferred_modifier_order = public,private,protected,internal,static,readonly:suggestion
101 |
102 | #Style - qualification options
103 |
104 | #prefer fields not to be prefaced with this. or Me. in Visual Basic
105 | dotnet_style_qualification_for_field = false:suggestion
106 | #prefer methods not to be prefaced with this. or Me. in Visual Basic
107 | dotnet_style_qualification_for_method = false:suggestion
108 | #prefer properties not to be prefaced with this. or Me. in Visual Basic
109 | dotnet_style_qualification_for_property = false:suggestion
110 | csharp_indent_labels = one_less_than_current
111 | csharp_using_directive_placement = outside_namespace:silent
112 | csharp_prefer_simple_using_statement = true:suggestion
113 | csharp_style_namespace_declarations = file_scoped:suggestion
114 | csharp_style_expression_bodied_operators = true:suggestion
115 | csharp_style_expression_bodied_properties = true:suggestion
116 | csharp_style_expression_bodied_indexers = true:suggestion
117 | csharp_style_expression_bodied_accessors = true:suggestion
118 | csharp_style_expression_bodied_lambdas = true:suggestion
119 | csharp_style_expression_bodied_local_functions = true:suggestion
120 | csharp_style_throw_expression = true:suggestion
121 | csharp_style_prefer_null_check_over_type_check = true:suggestion
122 | csharp_style_prefer_local_over_anonymous_function = true:suggestion
123 | csharp_prefer_simple_default_expression = true:suggestion
124 | csharp_style_prefer_range_operator = true:suggestion
125 | csharp_style_prefer_index_operator = true:suggestion
126 | csharp_style_prefer_tuple_swap = true:suggestion
127 | csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
128 | csharp_style_deconstructed_variable_declaration = true:suggestion
129 | csharp_style_inlined_variable_declaration = true:suggestion
130 | csharp_style_unused_value_assignment_preference = discard_variable:suggestion
131 | csharp_style_unused_value_expression_statement_preference = discard_variable:silent
132 | csharp_prefer_static_local_function = true:suggestion
133 | csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
134 | csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
135 | csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
136 | csharp_style_conditional_delegate_call = true:suggestion
137 | csharp_style_prefer_switch_expression = true:suggestion
138 | csharp_style_prefer_pattern_matching = true:suggestion
139 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
140 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
141 | csharp_style_prefer_not_pattern = true:suggestion
142 | csharp_style_prefer_extended_property_pattern = true:suggestion
143 | csharp_style_prefer_method_group_conversion = true:suggestion
144 |
145 | [*.{cs,vb}]
146 | #### Naming styles ####
147 |
148 | # Naming rules
149 |
150 | dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
151 | dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
152 | dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
153 |
154 | dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
155 | dotnet_naming_rule.types_should_be_pascal_case.symbols = types
156 | dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
157 |
158 | dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
159 | dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
160 | dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
161 |
162 | # Symbol specifications
163 |
164 | dotnet_naming_symbols.interface.applicable_kinds = interface
165 | dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
166 | dotnet_naming_symbols.interface.required_modifiers =
167 |
168 | dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
169 | dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
170 | dotnet_naming_symbols.types.required_modifiers =
171 |
172 | dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
173 | dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
174 | dotnet_naming_symbols.non_field_members.required_modifiers =
175 |
176 | # Naming styles
177 |
178 | dotnet_naming_style.begins_with_i.required_prefix = I
179 | dotnet_naming_style.begins_with_i.required_suffix =
180 | dotnet_naming_style.begins_with_i.word_separator =
181 | dotnet_naming_style.begins_with_i.capitalization = pascal_case
182 |
183 | dotnet_naming_style.pascal_case.required_prefix =
184 | dotnet_naming_style.pascal_case.required_suffix =
185 | dotnet_naming_style.pascal_case.word_separator =
186 | dotnet_naming_style.pascal_case.capitalization = pascal_case
187 |
188 | dotnet_naming_style.pascal_case.required_prefix =
189 | dotnet_naming_style.pascal_case.required_suffix =
190 | dotnet_naming_style.pascal_case.word_separator =
191 | dotnet_naming_style.pascal_case.capitalization = pascal_case
192 | dotnet_style_operator_placement_when_wrapping = beginning_of_line
193 | tab_width = 4
194 | indent_size = 4
195 | end_of_line = crlf
196 | dotnet_style_coalesce_expression = true:suggestion
197 | dotnet_style_null_propagation = true:suggestion
198 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
199 | dotnet_style_prefer_auto_properties = true:silent
200 | dotnet_style_object_initializer = true:suggestion
201 | dotnet_style_collection_initializer = true:suggestion
202 | dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
203 | dotnet_style_namespace_match_folder = true:suggestion
204 | dotnet_style_prefer_conditional_expression_over_assignment = true:silent
205 | dotnet_style_explicit_tuple_names = true:suggestion
206 | dotnet_style_prefer_conditional_expression_over_return = true:silent
207 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
208 | dotnet_style_prefer_inferred_tuple_names = true:suggestion
209 | dotnet_style_prefer_compound_assignment = true:suggestion
210 | dotnet_style_prefer_simplified_interpolation = true:suggestion
211 | dotnet_style_readonly_field = true:suggestion
212 | dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
213 | dotnet_style_predefined_type_for_member_access = true:silent
214 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
215 | dotnet_style_allow_multiple_blank_lines_experimental = true:silent
216 | dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
217 | dotnet_code_quality_unused_parameters = all:suggestion
218 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
219 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
220 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
221 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
222 | dotnet_style_qualification_for_field = false:suggestion
223 | dotnet_style_qualification_for_property = false:suggestion
224 | dotnet_style_qualification_for_method = false:suggestion
225 | dotnet_style_qualification_for_event = false:silent
226 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Views/MetadataEditorView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
--------------------------------------------------------------------------------
/RMMVCookTool.CLI/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | ================================================
122 |
123 |
124 | = RPG Maker MV Cook Tool (.NET Core CLI Version)
125 |
126 |
127 | = Version R2.03 ({0})
128 | String ID: ProgramVersionString
129 | This is the command line app's version string.
130 |
131 |
132 | = Developed by AceOfAces.
133 |
134 |
135 | = Licensed under the MIT license.
136 |
137 |
138 | Compiler is now running in parallel mode.
139 |
140 |
141 | SDK Location OK.
142 |
143 |
144 | Push Enter/Return to exit.
145 |
146 |
147 | Project Location OK.
148 |
149 |
150 | The file extension is set to
151 |
152 |
153 | You can't compress and test the project at the moment.
154 |
155 |
156 | The JavaScript files will be deleted after compilation.
157 |
158 |
159 | No compression will be used for the archive.
160 |
161 |
162 | The fastest compression will be used for the archive.
163 |
164 |
165 | The optimal compression will be used for the archive (this is the default).
166 |
167 |
168 | The location of the SDK doesn't exist.
169 |
170 |
171 | The compiler isn't there. Please pick the folder that has the nwjc file.
172 |
173 |
174 | The location of the project doesn't exist.
175 |
176 |
177 | The package.json file doesn't exist.
178 |
179 |
180 | NW.js will start after compiling.
181 |
182 |
183 | The Project location is not set. Please set it with the --ProjectLocation "<project location>".
184 |
185 |
186 | The SDK location is not set. Please set it with the --SDKLocation "<project location>".
187 |
188 |
189 | Where's the SDK location?
190 |
191 |
192 | Please insert the path for the SDK.
193 |
194 |
195 |
196 | The directory isn't there. Please select an existing folder.
197 |
198 |
199 |
200 |
201 | Where's the project you want to compile?
202 |
203 |
204 | Please specify the location of the folder.
205 |
206 |
207 |
208 | The folder you've selected isn't present.
209 |
210 |
211 |
212 | There is no js folder.
213 |
214 |
215 |
216 |
217 | What Extension will your game use (leave empty for .bin)?
218 |
219 |
220 |
221 | Do you want to:
222 | 1. Test that the binary files are loaded properly?
223 | 2. Prepare for publishing?
224 | (Default is 1)
225 |
226 |
227 |
228 | Would you like to compress the game's files to an archive?
229 | 1.Yes (delete the files as well).
230 | 2.Yes (but leave the files intact).
231 | 3. No.
232 | (Default is 3)
233 |
234 |
235 |
236 | Would you like to test the project after compiling? (Y/N, Default is N)
237 |
238 |
239 |
240 | Removing binary files (if present)...
241 |
242 |
243 | ]Thread #
244 |
245 |
246 | is compiling
247 |
248 |
249 | finished compiling
250 |
251 |
252 | Compiling
253 |
254 |
255 | Finished compiling
256 |
257 |
258 | [{0}]
259 |
260 |
261 | Finished compiling files.
262 |
263 |
264 |
265 | NW.js will now start. Give it a few seconds to start.
266 |
267 |
268 | Copying the game files to a temporary location...
269 |
270 |
271 | Compressing files...
272 |
273 |
274 | Deleting source files...
275 |
276 |
277 |
278 | The task was completed.
279 |
280 |
281 | The project's files will be compressed (the files will be deleted after compressing).
282 |
283 |
284 | The Project's files will be compressed
285 |
286 |
287 | Safe mode for compression is now active.
288 |
289 |
290 | Compression is not allowed if the "--PackageApp" command line argument is specified. Skipping this step.
291 |
292 |
293 | No reference was found on the package.json (or the folder mentioned isn't there). Please check that the json file contains the "main" variable and the folder exists.
294 |
295 |
296 | [orange1]Command line arguments[/]
297 |
298 |
299 | [orange1]Setup[/]
300 |
301 |
302 | [orange1]Work[/]
303 |
304 |
305 | SDK Location
306 |
307 |
308 | Project Location
309 |
310 |
311 | File Extension
312 |
313 |
314 | Compression
315 |
316 |
317 | Compression Level
318 |
319 |
320 | No compression
321 |
322 |
323 | Fastest
324 |
325 |
326 | Optimal
327 |
328 |
329 | Compress and remove source files
330 |
331 |
332 | Compress only
333 |
334 |
335 | [darkcyan]Compiling JS files[/]
336 |
337 |
338 | Packaging the game files...
339 |
340 |
341 | Test after compiling
342 |
343 |
344 | Yes
345 |
346 |
347 | No
348 |
349 |
350 | Remove source JS files
351 |
352 |
353 | Setting
354 |
355 |
356 | Value
357 |
358 |
359 | The job is aborted due to an issue with the nwjs compiler. Please check the file and try again.
360 |
361 |
362 |
--------------------------------------------------------------------------------
/RMMVCookTool.CLI/Properties/Resources.el.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | ================================================
122 |
123 |
124 | = RPG Maker MV Cook Tool (Έκδοση .NET Core CLI)
125 |
126 |
127 | = Έκδοση R2.03 ({0})
128 |
129 |
130 | = Δημιουργήθηκε από τον AceOfAces.
131 |
132 |
133 | = Άδεια χρήσης υπό το MIT license.
134 |
135 |
136 | Ο μεταγλωττιστής δουλεύει σε παράλληλη λειτουργεία.
137 |
138 |
139 | Θέση SDK OK.
140 |
141 |
142 | Πιέστε Enter/Return για έξοδο.
143 |
144 |
145 | Θέση project OK.
146 |
147 |
148 | H επέκταση αρχείου ορίστηκε ως
149 |
150 |
151 | Αυτή τη στιγμή, δεν μπορείτε να συμπιέσετε και να δοκιμάσετε το project.
152 |
153 |
154 | Τα αρχεία JavaScript θα διαγραφούν μετά τη μετάφραση.
155 |
156 |
157 | Δεν θα χρησιμοποιηθεί συμπίεση σε αυτό το αρχείο.
158 |
159 |
160 | Θα χρησιμοποιηθεί η γρήγορη συμπίεση σε αυτό το αρχείο.
161 |
162 |
163 | Θα χρησιμοποιηθεί η καλύτερη συμπίεση σε αυτό το αρχείο. (αυτό είναι η προεπιλογή).
164 |
165 |
166 | Η θέση του SDK δεν υπάρχει.
167 |
168 |
169 | Ο μεταφραστής δεν υπάρχει. Παρακαλώ επιλέξτε τον φάκελο που περιέχει το αρχείο nwjc.
170 |
171 |
172 | Η θέση του project δεν υπάρχει.
173 |
174 |
175 | Το αρχείο package.json δεν υπάρχει.
176 |
177 |
178 | Το NW.js θα ξεκινήσει μετά απο την μετάφραση.
179 |
180 |
181 | Η θέση του project δεν έχει οριστεί. Παρακαλώ ορίστε το με το --ProjectLocation "<project location>".
182 |
183 |
184 | Η θέση του SDK δεν έχει οριστεί. Παρακαλώ ορίστε το με το --SDKLocation "<project location>".
185 |
186 |
187 | Πού είναι η θέση του SDK;
188 |
189 |
190 | Παρακαλώ εισάγετε την θέση του SDK.
191 |
192 |
193 |
194 | Ο φάκελος δεν είναι εκεί. Παρακαλώ επιλέξτε έναν φάκελο που υπάρχει.
195 |
196 |
197 |
198 |
199 | Που είναι ο φάκελος του project που θέλετε να μεταγλωττίσετε;
200 |
201 |
202 | Παρακαλώ εισάγετε την θέση του φακέλου.
203 |
204 |
205 |
206 | Ο φάκελος που επιλέξατε δεν υπάρχει.
207 |
208 |
209 |
210 | Δεν υπάρχει ο φάκελος js.
211 |
212 |
213 |
214 |
215 | Ποια επέκταση αρχείου θα χρησιμοποιήσει το παιχνίδι (αφήστε το άδειο για το .bin);
216 |
217 |
218 |
219 | Θέλετε να:
220 | 1. Δοκιμάσετε οτί τα δυαδικά αρχεια δουλεύουν σωστά;
221 | 2. Προετοιμάσετε για έκδοση;
222 | (Η προεπιλογή είναι το 1)
223 |
224 |
225 |
226 | Θέλετε να συμπιέσετε τα αρχεία του παιχνιδιού;
227 | 1.Ναί (διέγραψε και τα αρχεία).
228 | 2.Ναί (αλλά κράτησε τα αρχεία).
229 | 3. Όχι.
230 | (Η προεπιλογή είναι το 3)
231 |
232 |
233 |
234 | Θέλετε να δοκιμάσετε το project μετά την μετάφραση; (Ν/Ο, Η προεπιλογή είναι το Ο)
235 |
236 |
237 |
238 | Διαγραφή δυαδικών αρχείων (αν υπάρχουν)...
239 |
240 |
241 | ]Το νήμα #
242 |
243 |
244 | μεταγλωττίζει το αρχείο
245 |
246 |
247 | τελείωσε την μεταγλώττιση του
248 |
249 |
250 | Μεταγλώττιση του αρχείου
251 |
252 |
253 | Ολοκληρώθηκε η μεταγλώττιση του
254 |
255 |
256 | [{0}]
257 |
258 |
259 | Ολοκληρώθηκε η μεταγλώττιση σε δυαδικά αρχεία.
260 |
261 |
262 |
263 | Το NW.js θα ξεκινήσει τώρα. Δώστε μερικά δευτερόλεπτα για να ξεκινήσει.
264 |
265 |
266 | Αντιγραφή των αρχείων του παιχνιδιού σε προσωρινό φάκελο...
267 |
268 |
269 | Συμπίεση αρχείων...
270 |
271 |
272 | Διαγραφή των αρχικών αρχείων...
273 |
274 |
275 |
276 | Η εργασία ολοκληρώθηκε.
277 |
278 |
279 | Τα αρχεία του παιχνιδιού θα συμπιεστούν μετά τη μετάφραση (τα αρχικά αρχεία θα αφαιρεθούν μετά).
280 |
281 |
282 | Τα αρχεία του παιχνιδιού θα συμπιεστούν μετά τη μετάφραση.
283 |
284 |
285 | H ασφαλής λειτουργεία για την συμπίεση έχει ενεργοποιηθεί.
286 |
287 |
288 | Η συμπίεση δεν επιτρέπεται αν η σημαία "--PackageApp" δεν έχει οριστεί. Αγνοείται αυτό το βήμα.
289 |
290 |
291 | Δεν υπάρχει αναφορά στον φάκελο παιχνιδιού στο αρχείο package.json (ή δεν υπάρχει ο φάκελος που αναφέρεται). Παρακαλώ, βεβαιωθείτε ότι το αρχείο έχει τη μεταβλητή "main" και ο φάκελος υπάρχει.
292 |
293 |
294 | [orange1]Ρυθμίσεις command line[/]
295 |
296 |
297 | [orange1]Ρύθμιση[/]
298 |
299 |
300 | [orange1]Εργασία[/]
301 |
302 |
303 | Θέση SDK
304 |
305 |
306 | Θέση Project
307 |
308 |
309 | Επέκταση αρχείου
310 |
311 |
312 | Λειτουργία συμπίεσης
313 |
314 |
315 | Βέλτιστη
316 |
317 |
318 | Ταχύτατη
319 |
320 |
321 | Χωρίς συμπίεση
322 |
323 |
324 | Συμπίεση
325 |
326 |
327 | Συμπίεση και αφαίρεση αρχικών αρχείων
328 |
329 |
330 | Μόνο συμπίεση
331 |
332 |
333 | [darkcyan]Μετάφραση των αρχείων JS[/]
334 |
335 |
336 | Πακετάρισμα των αρχείων παιχνιδιού...
337 |
338 |
339 | Δοκιμή μετά την μετάφραση
340 |
341 |
342 | Ναί
343 |
344 |
345 | Όχι
346 |
347 |
348 | Αφαίρεση αρχικών αρχείων JS
349 |
350 |
351 | Ρύθμιση
352 |
353 |
354 | Τιμή
355 |
356 |
357 | Η δουλεία μετάφρασης ακυρώνεται λόγω προβλήματος με τον μεταφραστή του nwjs. Ελέγξτε το αρχείο και δοκιμάστε ξανά.
358 |
359 |
360 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | Browse...
122 |
123 |
124 | Chromium Flags
125 |
126 |
127 | Close
128 |
129 |
130 | Done!
131 |
132 |
133 | Enable NodeJS?
134 |
135 |
136 | Clicking on the "More Details" button will show the stack trace. Make sure to include this if you are filling a bug report, since it can help with diagnosing the bug.
137 |
138 |
139 | Error
140 |
141 |
142 | Essentials
143 |
144 |
145 | You picked a file that is outside of the project's file. Please pick a file within the project.
146 |
147 |
148 | Game ID
149 |
150 |
151 | Game Info
152 |
153 |
154 | Game Name
155 |
156 |
157 | Game Package Metadata Editor
158 |
159 |
160 | Version
161 |
162 |
163 | Height
164 |
165 |
166 | HTML file location
167 |
168 |
169 | HTML File|*.html
170 |
171 |
172 | Icon Location
173 |
174 |
175 | In Full Screen
176 |
177 |
178 | In Kiosk Mode
179 |
180 |
181 | JavaScript Flags
182 |
183 |
184 | Minimum Height
185 |
186 |
187 | Minimum Width
188 |
189 |
190 | Mouse Cursor
191 |
192 |
193 | None
194 |
195 |
196 | NW.js features
197 |
198 |
199 | PNG File|*.png
200 |
201 |
202 | The path to the project is too long. Please shorten the path.
203 |
204 |
205 | Please select the location of the project.
206 |
207 |
208 | Resizable Window?
209 |
210 |
211 | Resolution
212 |
213 |
214 | Save
215 |
216 |
217 | The package metadata file was saved successfully.
218 |
219 |
220 | Screen Center
221 |
222 |
223 | Please select the location of the SDK folder.
224 |
225 |
226 | Settings
227 |
228 |
229 | --- The Stack Trace is below this line ---
230 |
231 |
232 |
233 | Start:
234 |
235 |
236 | Width
237 |
238 |
239 | Windowed
240 |
241 |
242 | Window
243 |
244 |
245 | Window Position
246 |
247 |
248 | Window Settings
249 |
250 |
251 | Window Size
252 |
253 |
254 | Window Title
255 |
256 |
257 | Ack! An error has occurred.
258 |
259 |
260 | Complete
261 |
262 |
263 | Warning
264 |
265 |
266 | A project was not selected.
267 |
268 |
269 | Please select a project from the list. You may have to add it to the list (if you haven't done so).
270 |
271 |
272 | Your default settings have been updated.
273 |
274 |
275 | The settings will be used for new projects added from this point on.
276 |
277 |
278 | The project's settings have been updated.
279 |
280 |
281 | Location:
282 |
283 |
284 | File Extension:
285 |
286 |
287 | Remove JS Files after Compiling:
288 |
289 |
290 | Compress Files:
291 |
292 |
293 | Remove Source Files after Compression:
294 |
295 |
296 | Compression Mode:
297 |
298 |
299 | Location of the NW.js SDK
300 |
301 |
302 | RPG Maker MV/MZ Cook Tool
303 |
304 |
305 | Compiler
306 |
307 |
308 | Add
309 |
310 |
311 | Remove
312 |
313 |
314 | Project Settings
315 |
316 |
317 | Edit Metadata
318 |
319 |
320 | Progress
321 |
322 |
323 | Total Progress:
324 |
325 |
326 | Current Project Progress:
327 |
328 |
329 | Compile
330 |
331 |
332 | Cancel
333 |
334 |
335 | About...
336 |
337 |
338 | Version R4.00 Update 4
339 |
340 |
341 | Developed by Studio ACE(AceOfAces). Licensed under the MIT license.
342 |
343 |
344 | User Manual
345 |
346 |
347 | Compression Level:
348 |
349 |
350 | Remove the game files after packaging.
351 |
352 |
353 | Compress the game files into package.nw.
354 |
355 |
356 | Remove the source JS files after compiling.
357 |
358 |
359 | Optimal
360 |
361 |
362 | Fastest
363 |
364 |
365 | No Compression
366 |
367 |
368 | Default Settings...
369 |
370 |
371 | Default Project Settings
372 |
373 |
374 | Aborted
375 |
376 |
377 | Removing binary files from
378 |
379 |
380 | Compilation complete!
381 |
382 |
383 | Compiling scripts in the js folder...
384 |
385 |
386 | The nwjs Compiler is missing.
387 |
388 |
389 | Compiling
390 |
391 |
392 | Compiling scripts in the
393 |
394 |
395 | Compiling
396 |
397 |
398 | Failed!
399 |
400 |
401 | folder...
402 |
403 |
404 | Please add the folders you want the JavaScript files to be compiled.
405 |
406 |
407 | Packaging...
408 |
409 |
410 | The task was cancelled.
411 |
412 |
413 | Could not find the folder specified in the JSON file.
414 | String ID: CannotFindGameFolderTitle
415 | This is the title of the message shown if the JSON file is missing an important detail.
416 |
417 |
418 | Double check that the "main" variable is filled or points to a existing folder. This folder will be skipped.
419 |
420 |
421 | Minify the package.json file
422 |
423 |
424 | Preparing...
425 |
426 |
427 | Compiler error
428 |
429 |
430 | The compiler job is aborted due to an error in the nwjs compiler. Please check the file and try again.
431 |
432 |
433 |
--------------------------------------------------------------------------------
/RMMVCookTool.GUI/Properties/Resources.el.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | Εύρεση...
122 |
123 |
124 | Σημαίες Chromium
125 |
126 |
127 | Κλείσιμο
128 |
129 |
130 | Ολοκληρώθηκε!
131 |
132 |
133 | Ενεργοποίηση του NodeJS;
134 |
135 |
136 | Κάνοντας κλικ στο "Περισσότερες πληροφορίες" θα δείξει το ίχνος στοίβας. Συμπεριλάβετε το ώστε να είναι εύκολη η αντιμετώπιση του προβλήματος.
137 |
138 |
139 | Σφάλμα
140 |
141 |
142 | Απαραίτητα
143 |
144 |
145 | Επιλέξατε ένα αρχείο που είναι εκτός του project.
146 |
147 |
148 | ID Παιχνιδιού
149 |
150 |
151 | Πληροφορίες παιχνιδιού
152 |
153 |
154 | Όνομα παιχνιδιού
155 |
156 |
157 | Επεξεργαστής πληροφοριών πακέτου παιχνιδιού
158 |
159 |
160 | Έκδοση
161 |
162 |
163 | Ύψος
164 |
165 |
166 | Θέση αρχείου HTML
167 |
168 |
169 | Αρχείο HTML|*.html
170 |
171 |
172 | Θέση εικονιδίου
173 |
174 |
175 | Σε πλήρης οθόνη
176 |
177 |
178 | Σε λειτουργεία κιόσκι
179 |
180 |
181 | Σημαίες JavaScript
182 |
183 |
184 | Ελάχιστο ύψος
185 |
186 |
187 | Ελάχιστο πλάτος
188 |
189 |
190 | Κέρσορας ποντικιού
191 |
192 |
193 | Κανένα
194 |
195 |
196 | Λειτουργίες NW.js
197 |
198 |
199 | Αρχείο PNG|*.png
200 |
201 |
202 | Η διαδρομή για το project είναι πάρα πολύ μεγάλο. Παρακαλώ συντομεύστε την διαδρομή.
203 |
204 |
205 | Παρακαλώ επιλέξτε τη θέση του project.
206 |
207 |
208 | Ξεκλείδωτο μέγεθος;
209 |
210 |
211 | Ανάλυση
212 |
213 |
214 | Αποθήκευση
215 |
216 |
217 | Αποθηκεύτηκαν οι πληροφορίες του πακέτου.
218 |
219 |
220 | Κέντρο της οθόνης
221 |
222 |
223 | Παρακαλώ επιλέξτε τον φάκελο του SDK.
224 |
225 |
226 | Ρυθμίσεις
227 |
228 |
229 | --- Το ίχνος στοίβας είναι κάτω από τη γραμμή ---
230 |
231 |
232 |
233 | Εκκίνηση:
234 |
235 |
236 | Πλάτος
237 |
238 |
239 | Σε παράθυρο
240 |
241 |
242 | Παράθυρο
243 |
244 |
245 | Θέση παραθύρου
246 |
247 |
248 | Ρυθμίσεις παραθύρου
249 |
250 |
251 | Μέγεθος παραθύρου
252 |
253 |
254 | Τίτλος παραθύρου
255 |
256 |
257 | Αμάν! Παρουσιάστηκε σφάλμα.
258 |
259 |
260 | Ολοκληρώθηκε
261 |
262 |
263 | Προσοχή
264 |
265 |
266 | Δεν επιλέχθηκε το project.
267 |
268 |
269 | Παρακαλώ επιλέξτε το project απο τη λίστα (αν δεν το έχετε κάνει).
270 |
271 |
272 | Οι προεπιλεγμένες ρυθμίσεις ενημερώθηκαν.
273 |
274 |
275 | Οι ρυθμίσεις θα χρησιμοποιηθούν για νέα projects.
276 |
277 |
278 | Οι ρυθμίσεις του project ενημερώθηκαν.
279 |
280 |
281 | Θέση:
282 |
283 |
284 | Επέκταση αρχείου:
285 |
286 |
287 | Αφαίρεση των αρχείων JS μετά τη μεταγλώττιση:
288 |
289 |
290 | Συμπίεση αρχείων:
291 |
292 |
293 | Αφαίρεση των αρχείων μετά τη συμπίεση:
294 |
295 |
296 | Λειτουργία συμπίεσης:
297 |
298 |
299 | Θέση του NW.js SDK
300 |
301 |
302 | RPG Maker MV/MZ Cook Tool
303 |
304 |
305 | Μεταγλωττιστής
306 |
307 |
308 | Προσθήκη
309 |
310 |
311 | Αφαίρεση
312 |
313 |
314 | Ρυθμίσεις Project
315 |
316 |
317 | Επεξεργασία πληροφοριών
318 |
319 |
320 | Πρόοδος
321 |
322 |
323 | Συνολική πρόοδος:
324 |
325 |
326 | Τρέχουσα πρόοδος του project:
327 |
328 |
329 | Μεταγλώττιση
330 |
331 |
332 | Άκυρο
333 |
334 |
335 | Σχετικά...
336 |
337 |
338 | Έκδοση R4.00 Ενημέρωση 4
339 |
340 |
341 | Αναπτύχθηκε από τον Studio ACE(AceOfAces). Άδεια χρήσης υπό το MIT License.
342 |
343 |
344 | Οδηγός Χρήσης
345 |
346 |
347 | Επίπεδο συμπίεσης:
348 |
349 |
350 | Αφαίρεση των αρχείων του project μετά το πακετάρισμα.
351 |
352 |
353 | Συμπίεση των αρχείων παιχνιδιού στο package.nw.
354 |
355 |
356 | Αφαίρεση των αρχείων JS μετά τη μεταγλώττιση.
357 |
358 |
359 | Βέλτιστη
360 |
361 |
362 | Ταχύτατη
363 |
364 |
365 | Χωρίς συμπίεση
366 |
367 |
368 | Προεπιλεγμένες ρυθμίσεις...
369 |
370 |
371 | Προεπιλεγμένες ρυθμίσεις project
372 |
373 |
374 | Ματαιώθηκε
375 |
376 |
377 | Διαγραφή δυαδικών αρχείων απο τον φάκελο
378 |
379 |
380 | Η μεταγλώττιση ολοκληρώθηκε!
381 |
382 |
383 | Μεταγλώττιση των scripts μέσα στον φάκελο js...
384 |
385 |
386 | Λείπει ο μεταφραστής του nwjs.
387 |
388 |
389 | Μεταγλώττιση του αρχείου
390 |
391 |
392 | Μεταγλώττιση των scripts μέσα στο φάκελο
393 |
394 |
395 | Μεταγλώττιση του
396 |
397 |
398 | Αποτυχία!
399 |
400 |
401 | ...
402 |
403 |
404 | Παρακαλώ προσθέστε τους φακέλους που περιέχουν τα αρχεία JavaScript για μετάφραση σε δυαδικά αρχεία.
405 |
406 |
407 | Πακετάρισμα...
408 |
409 |
410 | Η εργασία ακυρώθηκε.
411 |
412 |
413 | Δεν βρέθηκε ο φάκελος που αναγράφεται στο αρχείο JSON.
414 | String ID: CannotFindGameFolderTitle
415 | This is the title of the message shown if the JSON file is missing an important detail.
416 |
417 |
418 | Βεβαιωθείτε ότι η μεταβλητή "main" είναι γραμμένη και δείχνει σε έναν φάκελο που υπάρχει. Αυτός ο φάκελος θα αγνοηθεί.
419 |
420 |
421 | Σμίκρυνση του αρχείου package.json
422 |
423 |
424 | Προετοιμασία...
425 |
426 |
427 | Σφάλμα μεταφραστή
428 |
429 |
430 | Η δουλεία μετάφρασης ακυρώνεται λόγω προβλήματος με τον μεταφραστή του nwjs. Ελέγξτε το αρχείο και δοκιμάστε ξανά.
431 |
432 |
433 |
--------------------------------------------------------------------------------
/RMMVCookTool.CLI/CompilerEngine.cs:
--------------------------------------------------------------------------------
1 | using RMMVCookTool.CLI.Properties;
2 | using RMMVCookTool.Core.Compiler;
3 | using RMMVCookTool.Core.Utilities;
4 | using Spectre.Console;
5 | using System;
6 | using System.Diagnostics;
7 | using System.IO;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace RMMVCookTool.CLI;
11 | public sealed class CompilerEngine
12 | {
13 | private readonly CompilerProject newProject = new();
14 | private readonly SetupMenu setupTool = new();
15 | private bool errorBreak;
16 | private string message;
17 |
18 | public void ProcessCommandLineArguments(in string[] args)
19 | {
20 | Rule argsTab = new()
21 | {
22 | Title = Resources.CommandLineArgsTitle
23 | };
24 | argsTab.LeftJustified();
25 | AnsiConsole.Write(argsTab);
26 | Table argsTable = new();
27 | argsTable.AddColumn(Resources.SettingTitle);
28 | argsTable.AddColumn(Resources.ValueTitle);
29 | argsTable.Border = TableBorder.Rounded;
30 | CompilerUtilities.RecordToLog("Command Line Arguments loaded. Processing...", 0);
31 | for (int argnum = 0; argnum < args.Length; argnum++)
32 | {
33 | string stringBuffer;
34 | switch (args[argnum])
35 | {
36 | //Set the SDK Location
37 | case "--SDKLocation":
38 | stringBuffer = args[argnum + 1];
39 | setupTool.SdkLocation = stringBuffer.Replace("\"", "");
40 | if (argnum <= args.Length - 1 && Directory.Exists(setupTool.SdkLocation) &&
41 | File.Exists(Path.Combine(setupTool.SdkLocation,
42 | RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "nwjc.exe" : "nwjc")))
43 | {
44 | CompilerUtilities.RecordToLog($"NW.js compiler found at {setupTool.SdkLocation}.", 0);
45 | argsTable.AddRow(Resources.SDKLocationEntry, setupTool.SdkLocation);
46 | Console.ResetColor();
47 | }
48 | else
49 | {
50 | CompilerUtilities.RecordToLog($"NW.js compiler not found at {setupTool.SdkLocation}. Double check that the the nwjc executable is there.", 2);
51 | Console.ForegroundColor = ConsoleColor.DarkRed;
52 | Console.WriteLine(!Directory.Exists(setupTool.SdkLocation) ?
53 | Resources.SDKLocationInexistantText :
54 | Resources.CompilerMissingErrorText);
55 | Console.ResetColor();
56 | Console.WriteLine(Resources.PushEnterToExitText);
57 | Console.ReadLine();
58 | Environment.Exit(1);
59 | }
60 | break;
61 |
62 | //Set the Project Location.
63 | case "--ProjectLocation":
64 | stringBuffer = args[argnum + 1];
65 | newProject.ProjectLocation = stringBuffer.Replace("\"", "");
66 | if (argnum <= args.Length - 1 && (Directory.Exists(newProject.ProjectLocation) && File.Exists(Path.Combine(newProject.ProjectLocation, "package.json"))))
67 | {
68 | CompilerUtilities.RecordToLog($"RPG Maker MV/MZ project found at {newProject.ProjectLocation}.", 0);
69 | argsTable.AddRow(Resources.ProjectLocationEntry, newProject.ProjectLocation);
70 | Console.ResetColor();
71 | }
72 | else
73 | {
74 | CompilerUtilities.RecordToLog($"RPG Maker MV/MZ project was not found at {newProject.ProjectLocation}.", 2);
75 | Console.ForegroundColor = ConsoleColor.DarkRed;
76 | Console.WriteLine(!File.Exists(Path.Combine(newProject.ProjectLocation, "project.json")) ? Resources.JsonFileMissingErrorText : Resources.ProjectLocationInexistantText);
77 | Console.ResetColor();
78 | Console.WriteLine(Resources.PushEnterToExitText);
79 | Console.ReadLine();
80 | Environment.Exit(1);
81 | }
82 | break;
83 |
84 | //Set the File Extension.
85 | case "--FileExtension":
86 | //Check if the next variable in the args array is a command line argument or it's the end of the array.
87 | if (argnum >= args.Length - 1 && args[argnum].Contains("--")) CompilerUtilities.RecordToLog($"File extension not set. Keeping the extension to .bin.", 1);
88 | else
89 | {
90 | newProject.Setup.FileExtension = args[argnum + 1];
91 | CompilerUtilities.RecordToLog($"File extension set to .{newProject.Setup.FileExtension}.", 0);
92 | argsTable.AddRow(Resources.FileExtensionEntry, newProject.Setup.FileExtension);
93 | Console.ResetColor();
94 | }
95 | break;
96 |
97 | //This command line argument is for packaging the app after compressing (if the --ReleaseMode flag is active.
98 | case "--PackageApp":
99 | // Check that test mode is active. Since this ain't working, it will show this message and close.
100 | if (setupTool.TestProject)
101 | {
102 | CompilerUtilities.RecordToLog($"Cannot package the app when test mode is turned on. Aborting job.", 2);
103 | Console.ForegroundColor = ConsoleColor.DarkRed;
104 | Console.WriteLine(Resources.CannotCompressAndTestErrorText);
105 | Console.ResetColor();
106 | Console.WriteLine(Resources.PushEnterToExitText);
107 | Console.ReadLine();
108 | Environment.Exit(1);
109 | }
110 | //Else, either just compress or compress and delete the files.
111 | else
112 | {
113 | if (newProject.Setup.RemoveSourceFiles)
114 | {
115 | CompilerUtilities.RecordToLog($"The project will be compressed after compiling.", 0);
116 | newProject.Setup.CompressProjectFiles = true;
117 | if (argnum + 1 <= args.Length - 1)
118 | {
119 | setupTool.CompressProject = args[argnum + 1] == "Final" ? 1 : 2;
120 | newProject.Setup.RemoveFilesAfterCompression = setupTool.CompressProject == 1;
121 | argsTable.AddRow(Resources.CompressionEntry, ((argnum + 1 <= args.Length - 1) && args[argnum + 1] == "Final") ? Resources.CompressAndRemoveEntry : Resources.CompressOnlyEntry);
122 | Console.ForegroundColor = ConsoleColor.DarkGreen;
123 | Console.WriteLine((argnum + 1 <= args.Length - 1) && args[argnum + 1] == "Final" ?
124 | Resources.ProjectFilesRemovalAfterCompressionText :
125 | Resources.ProjectFilesCompressionConfirmText);
126 | CompilerUtilities.RecordToLog(((argnum + 1 <= args.Length - 1) && args[argnum + 1] == "Final") ? $"The source files will be removed." : $"Only compression will occur.", 0);
127 | Console.ResetColor();
128 | }
129 | else
130 | {
131 | CompilerUtilities.RecordToLog($"Only compression will occur.", 0);
132 | argsTable.AddRow(Resources.CompressionEntry, Resources.CompressOnlyEntry);
133 | setupTool.CompressProject = 2;
134 | Console.ForegroundColor = ConsoleColor.DarkGreen;
135 | Console.WriteLine(Resources.ProjectFilesCompressionConfirmText);
136 | Console.ResetColor();
137 | }
138 | }
139 | else
140 | {
141 | CompilerUtilities.RecordToLog($"Compression cannot occur if --ReleaseApp isn't specified. Skipping.", 0);
142 | Console.ForegroundColor = ConsoleColor.DarkYellow;
143 | Console.WriteLine(Resources.CompressionNotPermittedText);
144 | Console.ResetColor();
145 | }
146 | }
147 | break;
148 |
149 | //This command line argument deletes the JavaScript files after compiling.
150 | case "--ReleaseMode":
151 | CompilerUtilities.RecordToLog($"JS files will be removed.", 0);
152 | newProject.Setup.RemoveSourceFiles = true;
153 | Console.ResetColor();
154 | break;
155 |
156 | //This command line argument starts the nwjs app to test the project.
157 | case "--TestMode":
158 | if (setupTool.CompressProject <= 2)
159 | {
160 | CompilerUtilities.RecordToLog("Cannot test the app when the packaging option is turned on. Aborting job.", 2);
161 | Console.ForegroundColor = ConsoleColor.DarkRed;
162 | Console.WriteLine(Resources.CannotCompressAndTestErrorText);
163 | Console.ResetColor();
164 | Console.WriteLine(Resources.PushEnterToExitText);
165 | Console.ReadLine();
166 | Environment.Exit(1);
167 | }
168 | else
169 | {
170 | CompilerUtilities.RecordToLog("Test mode is turned on.", 0);
171 | argsTable.AddRow(Resources.TestAfterCompilingEntry, Resources.CommonWordYes);
172 | setupTool.TestProject = true;
173 | Console.ForegroundColor = ConsoleColor.DarkGreen;
174 | Console.WriteLine(Resources.nwjsTestStartingText);
175 | Console.ResetColor();
176 | }
177 | break;
178 | case "--SetCompressionLevel":
179 | if (argnum + 1 <= args.Length - 1 && !args[argnum].Contains("--"))
180 | {
181 | switch (argnum + 1)
182 | {
183 | case 2:
184 | CompilerUtilities.RecordToLog($"Compression is set to No Compression.", 0);
185 | newProject.Setup.CompressionLevel = 2;
186 | Console.ForegroundColor = ConsoleColor.DarkGreen;
187 | Console.WriteLine(Resources.NoCompressionConfirmationText);
188 | Console.ResetColor();
189 | break;
190 | case 1:
191 | CompilerUtilities.RecordToLog($"Compression is set to Fastest.", 0);
192 | newProject.Setup.CompressionLevel = 1;
193 | Console.ForegroundColor = ConsoleColor.DarkGreen;
194 | Console.WriteLine(Resources.FastestCompressionConfirmationText);
195 | Console.ResetColor();
196 | break;
197 | default:
198 | CompilerUtilities.RecordToLog($"Compression is set to Optimal.", 0);
199 | newProject.Setup.CompressionLevel = 0;
200 | Console.ForegroundColor = ConsoleColor.DarkGreen;
201 | Console.WriteLine(Resources.OptimalCompressionCOnfirmationText);
202 | Console.ResetColor();
203 | break;
204 | }
205 | }
206 | break;
207 | }
208 | }
209 | if (setupTool.CompressProject < 3) switch (newProject.Setup.CompressionLevel)
210 | {
211 | case 2:
212 | argsTable.AddRow(Resources.CompressionLevelEntry, Resources.NoCompression);
213 | break;
214 | case 1:
215 | argsTable.AddRow(Resources.CompressionLevelEntry, Resources.FastestCompression);
216 | break;
217 | case 0:
218 | argsTable.AddRow(Resources.CompressionLevelEntry, Resources.OptimalCompression);
219 | break;
220 | }
221 | if (newProject.Setup.RemoveSourceFiles) argsTable.AddRow(Resources.RemoveSourceFilesEntry, Resources.CommonWordYes);
222 | else argsTable.AddRow(Resources.RemoveSourceFilesEntry, Resources.CommonWordNo);
223 | setupTool.CheckSettings(newProject);
224 | if (setupTool.SettingsSet) AnsiConsole.Write(argsTable);
225 | else setupTool.SetupWorkload(newProject);
226 | }
227 |
228 | public void StartWorker()
229 | {
230 | Rule workTab = new()
231 | {
232 | Title = Resources.WorkTitle,
233 | };
234 | workTab.LeftJustified();
235 | AnsiConsole.Write(workTab);
236 | //Find the game folder.
237 | Stopwatch timer = new();
238 | Stopwatch totalTime = new();
239 | timer.Start();
240 | totalTime.Start();
241 | CompilerUtilities.RecordToLog("Attempting to read the package.json file.", 0);
242 | newProject.GameFilesLocation = CompilerUtilities.GetProjectFilesLocation(Path.Combine(newProject.ProjectLocation, "package.json"));
243 | if (newProject.GameFilesLocation is "Null" or "Unknown")
244 | {
245 | timer.Stop();
246 | totalTime.Stop();
247 | //If the Json read returns nothing, throw an error to tell the user to double check their json file.
248 | Console.ForegroundColor = ConsoleColor.DarkRed;
249 | Console.WriteLine(Resources.JsonReferenceError);
250 | Console.ResetColor();
251 | }
252 | else //If the read returned a valid folder, start the compiler process.
253 | {
254 | //Finding all the JS files.
255 | CompilerUtilities.RecordToLog("Preparing project...", 0);
256 | newProject.PullSourceFiles();
257 |
258 | CompilerUtilities.RecordToLog($"Found {newProject.FileMap.Count} JS files.", 0);
259 | AnsiConsole.Status()
260 | .Start("[darkcyan]" + Resources.BinaryRemovalText + "[/]", spinny =>
261 | {
262 | CompilerUtilities.RemoveDebugFiles(newProject.ProjectLocation);
263 | CompilerUtilities.CleanupBin(newProject.FileMap);
264 | });
265 | //Preparing the compiler task.
266 | newProject.CompilerInfo.Value.FileName = Path.Combine(setupTool.SdkLocation, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "nwjc.exe" : "nwjc");
267 | timer.Stop();
268 | CompilerUtilities.RecordToLog($"Completed preparations. (Time to prepare:{timer.Elapsed}/Total Time (so far):{totalTime.Elapsed})", 0);
269 | timer.Reset();
270 | try
271 | {
272 | timer.Start();
273 | AnsiConsole.Progress()
274 | .Start(progress =>
275 | {
276 | ProgressTask compilerTask = progress.AddTask(Resources.DarkcyanCompilingJSFilesText);
277 | compilerTask.MaxValue = newProject.FileMap.Count;
278 | while (!progress.IsFinished)
279 | {
280 | for (int i = 0; i < newProject.FileMap.Count; i++)
281 | {
282 | CompilerUtilities.RecordToLog($"Compiling {newProject.FileMap[i]}...", 0);
283 | CompilerErrorReport errorCheck = newProject.CompileFile(i);
284 | if (errorCheck.ErrorCode > 0)
285 | {
286 | errorBreak = true;
287 | message = errorCheck.ErrorMessage;
288 | break;
289 | }
290 | else
291 | {
292 | CompilerUtilities.RecordToLog($"Compiled {newProject.FileMap[i]}.", 0);
293 | compilerTask.Increment(1);
294 | }
295 | }
296 | compilerTask.StopTask();
297 | }
298 | });
299 |
300 | timer.Stop();
301 | if (errorBreak)
302 | {
303 | Console.WriteLine(Resources.CompilerErrorText + message);
304 | //Ask the user to press Enter (or Return).
305 | if (!setupTool.SettingsSet)
306 | {
307 | Console.WriteLine(Resources.PushEnterToExitText);
308 | Console.ReadLine();
309 | }
310 | CompilerUtilities.CloseLog();
311 | Environment.Exit(2);
312 | }
313 | CompilerUtilities.RecordToLog($"Completed the compilation. (Time elapsed:{timer.Elapsed}/Total Time (so far):{totalTime.Elapsed}", 0);
314 | timer.Reset();
315 | if (setupTool.TestProject)
316 | {
317 | Console.WriteLine(Resources.NwjsStartingTestNotificationText);
318 | newProject.RunTest(setupTool.SdkLocation);
319 | }
320 | else if (setupTool.CompressProject is < 3)
321 | {
322 | CompilerUtilities.RecordToLog(Resources.PackagingGameText, 0);
323 | timer.Start();
324 | AnsiConsole.Status()
325 | .Start(Resources.FileCompressionText, spin => newProject.CompressFiles());
326 | timer.Stop();
327 | CompilerUtilities.RecordToLog($"Packaged the game. (Time to package:{timer.Elapsed}/Total Time (so far):{totalTime.Elapsed}", 0);
328 | }
329 | totalTime.Stop();
330 | CompilerUtilities.RecordToLog($"Task completed in {totalTime.Elapsed}", 0);
331 | Console.WriteLine(Resources.TaskCompleteText);
332 |
333 | }
334 | catch (ArgumentNullException e)
335 | {
336 | CompilerUtilities.RecordToLog(e);
337 | AnsiConsole.WriteException(e);
338 | throw;
339 | }
340 | catch (Exception e)
341 | {
342 | CompilerUtilities.RecordToLog(e);
343 | AnsiConsole.WriteException(e);
344 | throw;
345 |
346 | }
347 | }
348 |
349 | //Ask the user to press Enter (or Return).
350 | if (!setupTool.SettingsSet)
351 | {
352 | Console.WriteLine(Resources.PushEnterToExitText);
353 | Console.ReadLine();
354 | }
355 | CompilerUtilities.CloseLog();
356 | }
357 |
358 | public void StartSetup() => setupTool.SetupWorkload(newProject);
359 | }
360 |
--------------------------------------------------------------------------------