Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 17 additions & 89 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
# built on .NET Core.
# To learn how to migrate your existing application to .NET Core,
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
#
# To configure this workflow:
#
# 1. Configure environment variables
# GitHub sets default environment variables for every workflow run.
# Replace the variables relative to your project in the "env" section below.
#
# 2. Signing
# Generate a signing certificate in the Windows Application
# Packaging Project or add an existing signing certificate to the project.
# Next, use PowerShell to encode the .pfx file using Base64 encoding
# by running the following Powershell script to generate the output string:
#
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
#
# Open the output file, SigningCertificate_Encoded.txt, and copy the
# string inside. Then, add the string to the repo as a GitHub secret
# and name it "Base64_Encoded_Pfx."
# For more information on how to configure your signing certificate for
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
#
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
# See "Build the Windows Application Packaging project" below to see how the secret is used.
#
# For more information on GitHub Actions, refer to https://github.com/features/actions
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
# refer to https://github.com/microsoft/github-actions-for-desktop-apps

name: .NET Core Desktop

on:
Expand All @@ -45,71 +7,37 @@ on:
branches: [ "main" ]

jobs:

build:

strategy:
matrix:
configuration: [Debug, Release]

runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: windows-latest

env:
Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
Solution_Name: "DS Game Maker.sln"
# Configuration is set to Release for the final artifact
Configuration: Release

steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2

# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
dotnet-version: 9.0.x

# Decode the base 64 encoded pfx and save the Signing_Certificate
- name: Decode the pfx
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
$certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
- name: Restore dependencies
run: dotnet restore "${{ env.Solution_Name }}"

# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
env:
Appx_Bundle: Always
Appx_Bundle_Platforms: x86|x64
Appx_Package_Build_Mode: StoreUpload
Configuration: ${{ matrix.configuration }}
- name: Build application
run: dotnet build "${{ env.Solution_Name }}" --configuration ${{ env.Configuration }} --no-restore

# Remove the pfx
- name: Remove the pfx
run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
- name: Publish application
# We use --no-build here because we just built it in the previous step
run: dotnet publish "${{ env.Solution_Name }}" --configuration ${{ env.Configuration }} --no-build --output ./publish_output

# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload build artifacts
- name: Upload a build artifact
uses: actions/upload-artifact@v4
with:
name: MSIX Package
path: ${{ env.Wap_Project_Directory }}\AppPackages
name: DS-Game-Maker-Snapshot
path: ./publish_output
4 changes: 2 additions & 2 deletions AboutDSGM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AboutDSGM()

private void WebAddressLabel_Click(object sender, EventArgs e)
{
DS_Game_Maker.DSGMlib.URL(DS_Game_Maker.DSGMlib.Domain);
DSGMlib.URL(DSGMlib.Domain);
}

private void DOkayButton_Click(object sender, EventArgs e)
Expand All @@ -21,7 +21,7 @@ private void DOkayButton_Click(object sender, EventArgs e)

private void AboutDSGM_Load(object sender, EventArgs e)
{
string VersionString = DS_Game_Maker.DSGMlib.IDVersion.ToString();
string VersionString = DSGMlib.IDVersion.ToString();
VersionLabel.Text = "Version " + VersionString.Substring(0, 1) + "." + (VersionString.Substring(1).EndsWith("0") ? VersionString.Substring(1).Substring(0, 1) : VersionString.Substring(1)) + " (Release " + VersionString + ")";
}
}
Expand Down
43 changes: 22 additions & 21 deletions Action.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using Microsoft.VisualBasic;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using Microsoft.VisualBasic;

namespace DS_Game_Maker
{
Expand All @@ -21,7 +22,7 @@ public Action()

public void InstancesBugger()
{
DS_Game_Maker.DSGMlib.MsgWarn("The instance numbers must be separated by single spaces. You may also the IRandom function." + Constants.vbCrLf + Constants.vbCrLf + "For more information, see the manual.");
DSGMlib.MsgWarn("The instance numbers must be separated by single spaces. You may also the IRandom function." + Constants.vbCrLf + Constants.vbCrLf + "For more information, see the manual.");
InstancesTextBox.Focus();
}

Expand Down Expand Up @@ -49,7 +50,7 @@ private void DOkayButton_Click(object sender, EventArgs e)
}
if (IsOneEmpty)
{
DS_Game_Maker.DSGMlib.MsgWarn("You must put something in every Argument box or selector.");
DSGMlib.MsgWarn("You must put something in every Argument box or selector.");
ControlsPanel.Controls[DOn - 1].Focus();
return;
}
Expand Down Expand Up @@ -116,7 +117,7 @@ private void DOkayButton_Click(object sender, EventArgs e)
}
else if (X.Name.StartsWith("Comparative"))
{
TheText = DS_Game_Maker.ScriptsLib.StringToComparative(TheText);
TheText = ScriptsLib.StringToComparative(TheText);
}
ArgumentString += TheText + ";";
}
Expand All @@ -139,7 +140,7 @@ private void Action_Load(object sender, EventArgs e)
byte DOn = 0;
LabelsPanel.Controls.Clear();
ControlsPanel.Controls.Clear();
foreach (string X_ in File.ReadAllLines(Constants.AppDirectory + @"Actions\" + ActionName + ".action"))
foreach (string X_ in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName + ".action"))
{
string X = X_;
if (X.StartsWith("ARG "))
Expand All @@ -152,7 +153,7 @@ private void Action_Load(object sender, EventArgs e)
NewLabel.Location = new Point(1, 8 + DOn * 24);
LabelsPanel.Controls.Add(NewLabel);
Control InputControl;
string TheContent = DS_Game_Maker.DSGMlib.iGet(ArgumentString, DOn, ";").ToString().Replace("<com>", ",");
string TheContent = DSGMlib.iGet(ArgumentString, DOn, ";").ToString().Replace("<com>", ",");
if (ArgumentType == 0 | ArgumentType == 12)
{
InputControl = new TextBox();
Expand Down Expand Up @@ -191,7 +192,7 @@ private void Action_Load(object sender, EventArgs e)
}
else if (ArgumentType == 3)
{
foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("GLOBAL "))
foreach (string Y_ in DSGMlib.GetXDSFilter("GLOBAL "))
{
string Y = Y_;
Y = Y.Substring(7);
Expand All @@ -202,7 +203,7 @@ private void Action_Load(object sender, EventArgs e)
}
else if (ArgumentType == 4)
{
foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT "))
foreach (string Y_ in DSGMlib.GetXDSFilter("OBJECT "))
{
string Y = Y_;
Y = Y.Substring(7);
Expand All @@ -213,13 +214,13 @@ private void Action_Load(object sender, EventArgs e)
}
else if (ArgumentType == 5)
{
foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("BACKGROUND "))
foreach (string Y in DSGMlib.GetXDSFilter("BACKGROUND "))
((ComboBox)InputControl).Items.Add(Y.Substring(11));
InputControl.Name = "Background" + DOn.ToString();
}
else if (ArgumentType == 6)
{
foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("SOUND "))
foreach (string Y_ in DSGMlib.GetXDSFilter("SOUND "))
{
string Y = Y_;
Y = Y.Substring(6);
Expand All @@ -229,7 +230,7 @@ private void Action_Load(object sender, EventArgs e)
}
else if (ArgumentType == 7)
{
foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("ROOM "))
foreach (string Y_ in DSGMlib.GetXDSFilter("ROOM "))
{
string Y = Y_;
Y = Y.Substring(5);
Expand All @@ -240,13 +241,13 @@ private void Action_Load(object sender, EventArgs e)
}
else if (ArgumentType == 8)
{
foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("PATH "))
foreach (string Y in DSGMlib.GetXDSFilter("PATH "))
((ComboBox)InputControl).Items.Add(Y.Substring(5));
InputControl.Name = "Path" + DOn.ToString();
}
else if (ArgumentType == 9)
{
foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("SCRIPT "))
foreach (string Y in DSGMlib.GetXDSFilter("SCRIPT "))
{
string ScriptName = Y.Substring(7);
ScriptName = ScriptName.Substring(0, ScriptName.LastIndexOf(","));
Expand All @@ -262,18 +263,18 @@ private void Action_Load(object sender, EventArgs e)
((ComboBox)InputControl).Items.Add("Less than or Equal to");
((ComboBox)InputControl).Items.Add("Greater than or Equal to");
((ComboBox)InputControl).Items.Add("Not Equal to");
TheContent = DS_Game_Maker.ScriptsLib.ComparativeToString(TheContent);
TheContent = ScriptsLib.ComparativeToString(TheContent);
InputControl.Name = "Comparative" + DOn.ToString();
}
else if (ArgumentType == 11)
{
foreach (string F in DS_Game_Maker.DSGMlib.Fonts)
foreach (string F in DSGMlib.Fonts)
((ComboBox)InputControl).Items.Add(F);
}
// 12 Unrestrictive = no difference
else if (ArgumentType == 13)
{
foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("SPRITE "))
foreach (string Y in DSGMlib.GetXDSFilter("SPRITE "))
{
string SpriteName = Y;
SpriteName = SpriteName.Substring(7);
Expand All @@ -289,7 +290,7 @@ private void Action_Load(object sender, EventArgs e)
}
else if (ArgumentType == 15)
{
foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("ARRAY "))
foreach (string Y in DSGMlib.GetXDSFilter("ARRAY "))
{
string ArrayName = Y;
ArrayName = ArrayName.Substring(6);
Expand All @@ -300,7 +301,7 @@ private void Action_Load(object sender, EventArgs e)
}
else if (ArgumentType == 16)
{
foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("STRUCTURE "))
foreach (string Y_ in DSGMlib.GetXDSFilter("STRUCTURE "))
{
string Y = Y_;
Y = Y.Substring(10);
Expand Down Expand Up @@ -334,7 +335,7 @@ private void Action_Load(object sender, EventArgs e)
ControlsPanel.Visible = true;
}
InstancesOfDropper.Items.Clear();
foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT "))
foreach (string X_ in DSGMlib.GetXDSFilter("OBJECT "))
{
string X = X_;
X = X.Substring(7);
Expand All @@ -346,7 +347,7 @@ private void Action_Load(object sender, EventArgs e)
ThisRadioButton.Checked = true;
CheckedSomething = true;
}
else if (DS_Game_Maker.DSGMlib.IsObject(AppliesTo))
else if (DSGMlib.IsObject(AppliesTo))
{
InstancesOfRadioButton.Checked = true;
InstancesOfDropper.Text = AppliesTo;
Expand Down
12 changes: 6 additions & 6 deletions ActionsLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ public static string ActionEquateDisplay(string ActionName, string ActionArgumen
return ActionName;
foreach (string Y in File.ReadAllLines(Constants.AppDirectory + @"Actions\" + ActionName + ".action"))
{
for (int Z = 0, loopTo = (int)DS_Game_Maker.DSGMlib.HowManyChar(ActionArguments, ";"); Z <= loopTo; Z++)
for (int Z = 0, loopTo = (int)DSGMlib.HowManyChar(ActionArguments, ";"); Z <= loopTo; Z++)
{
string Argument = DS_Game_Maker.DSGMlib.iGet(ActionArguments, (byte)Z, ";");
string Argument = DSGMlib.iGet(ActionArguments, (byte)Z, ";");
string StringThing = Argument;
if (StringThing == "1")
StringThing = "true";
if (StringThing == "0")
StringThing = "false";
if (StringThing == "<" | StringThing == ">" | StringThing == ">=" | StringThing == "<=" | StringThing == "==")
{
StringThing = DS_Game_Maker.ScriptsLib.ComparativeToString(StringThing);
StringThing = ScriptsLib.ComparativeToString(StringThing);
}
string ScreenThing = Argument;
if (ScreenThing == "1")
Expand Down Expand Up @@ -80,7 +80,7 @@ public static Bitmap ActionGetIcon(string ActionName)
{
var TBMP = new Bitmap(32, 32);
var TBMPGFX = Graphics.FromImage(TBMP);
Bitmap TIcon = (Bitmap)DS_Game_Maker.DSGMlib.PathToImage(ActionGetIconPath(ActionName, true));
Bitmap TIcon = (Bitmap)DSGMlib.PathToImage(ActionGetIconPath(ActionName, true));
if (TIcon.Width == 32)
{
TBMPGFX.DrawImageUnscaled(Properties.Resources.ActionBacker, 0, 0);
Expand All @@ -90,11 +90,11 @@ public static Bitmap ActionGetIcon(string ActionName)
{
if (ActionIsConditional(ActionName))
{
TBMPGFX.DrawImageUnscaled(DS_Game_Maker.DSGMlib.ActionConditionalBG, 0, 0);
TBMPGFX.DrawImageUnscaled(DSGMlib.ActionConditionalBG, 0, 0);
}
else
{
TBMPGFX.DrawImageUnscaled(DS_Game_Maker.DSGMlib.ActionBG, 0, 0);
TBMPGFX.DrawImageUnscaled(DSGMlib.ActionBG, 0, 0);
}
TBMPGFX.DrawImageUnscaled(TIcon, new Point(8, 8));
}
Expand Down
10 changes: 5 additions & 5 deletions Argument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ private void Argument_Load(object sender, EventArgs e)
if (IsAction)
{
for (byte X = 1; X <= 16; X++)
TypeDropper.Items.Add(DS_Game_Maker.ScriptsLib.ArgumentTypeToString(X));
TypeDropper.Text = DS_Game_Maker.ScriptsLib.ArgumentTypeToString(Conversions.ToByte(ArgumentType));
TypeDropper.Items.Add(ScriptsLib.ArgumentTypeToString(X));
TypeDropper.Text = ScriptsLib.ArgumentTypeToString(Conversions.ToByte(ArgumentType));
}
else
{
for (byte X = 0, loopTo = (byte)(DS_Game_Maker.ScriptsLib.VariableTypes.Count - 1); X <= loopTo; X++)
TypeDropper.Items.Add(DS_Game_Maker.ScriptsLib.VariableTypes[(int)X]);
for (byte X = 0, loopTo = (byte)(ScriptsLib.VariableTypes.Count - 1); X <= loopTo; X++)
TypeDropper.Items.Add(ScriptsLib.VariableTypes[(int)X]);
TypeDropper.Text = ArgumentType;
}
NameTextBox.Text = ArgumentName;
Expand All @@ -40,7 +40,7 @@ private void DOkayButton_Click(object sender, EventArgs e)
ArgumentName = NameTextBox.Text;
if (IsAction)
{
ArgumentType = DS_Game_Maker.ScriptsLib.ArgumentStringToType(TypeDropper.Text).ToString();
ArgumentType = ScriptsLib.ArgumentStringToType(TypeDropper.Text).ToString();
}
else
{
Expand Down
Loading
Loading