From e1ce00aa84a2288e7371592e52327436af74e09f Mon Sep 17 00:00:00 2001
From: biwa <6475593+biwa@users.noreply.github.com>
Date: Fri, 5 Jul 2024 20:16:48 +0200
Subject: [PATCH 1/3] UDBScript: fixed a crash when trying to access the UDMF
fields of a thing that has its scale set. Fixes #1079
---
Source/Plugins/UDBScript/API/ThingWrapper.cs | 28 +++++++++++++++-----
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/Source/Plugins/UDBScript/API/ThingWrapper.cs b/Source/Plugins/UDBScript/API/ThingWrapper.cs
index 062a73f4..da23ba2c 100644
--- a/Source/Plugins/UDBScript/API/ThingWrapper.cs
+++ b/Source/Plugins/UDBScript/API/ThingWrapper.cs
@@ -530,10 +530,10 @@ namespace CodeImp.DoomBuilder.UDBScript.Wrapper
/// UniFields of the map element
internal override void AddManagedFields(IDictionary fields)
{
- if (thing.ScaleX != 1.0)
+ if (!fields.ContainsKey("scalex") && thing.ScaleX != 1.0)
fields.Add("scalex", thing.ScaleX);
- if (thing.ScaleY != 1.0)
+ if (!fields.ContainsKey("scaley") && thing.ScaleY != 1.0)
fields.Add("scaley", thing.ScaleY);
}
@@ -549,12 +549,28 @@ namespace CodeImp.DoomBuilder.UDBScript.Wrapper
switch(pname)
{
case "scalex":
- if (newvalue == null) thing.SetScale(1.0, thing.ScaleY);
- else thing.SetScale((double)newvalue, thing.ScaleY);
+ if (newvalue == null)
+ {
+ thing.SetScale(1.0, thing.ScaleY);
+ UniFields.RemoveField(fields, "scalex");
+ }
+ else
+ {
+ thing.SetScale((double)newvalue, thing.ScaleY);
+ UniFields.SetFloat(fields, "scalex", (double)newvalue);
+ }
return true;
case "scaley":
- if(newvalue == null) thing.SetScale(thing.ScaleX, 1.0);
- else thing.SetScale(thing.ScaleX, (double)newvalue);
+ if (newvalue == null)
+ {
+ thing.SetScale(thing.ScaleX, 1.0);
+ UniFields.RemoveField(fields, "scaley");
+ }
+ else
+ {
+ thing.SetScale(thing.ScaleX, (double)newvalue);
+ UniFields.SetFloat(fields, "scaley", (double)newvalue);
+ }
return true;
}
From 349a6b095302cbdfeaabe2b35c3d6f271af2e852 Mon Sep 17 00:00:00 2001
From: samwiddowson <36040364+samwiddowson@users.noreply.github.com>
Date: Tue, 9 Jul 2024 18:47:24 +0100
Subject: [PATCH 2/3] Fixed a crash when adding opening the dialog to add a
directory resource on Mono Winforms
---
Source/Core/Controls/FolderSelectDialog.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Source/Core/Controls/FolderSelectDialog.cs b/Source/Core/Controls/FolderSelectDialog.cs
index 9c80ef62..b20c8955 100755
--- a/Source/Core/Controls/FolderSelectDialog.cs
+++ b/Source/Core/Controls/FolderSelectDialog.cs
@@ -283,6 +283,7 @@ namespace CodeImp.DoomBuilder.Controls
{
bool flag = false;
+#if !MONO_WINFORMS
if (Environment.OSVersion.Version.Major >= 6)
{
var r = new Reflector("System.Windows.Forms");
@@ -313,6 +314,7 @@ namespace CodeImp.DoomBuilder.Controls
}
else
{
+#endif
var fbd = new FolderBrowserDialog();
fbd.Description = this.Title;
fbd.SelectedPath = this.InitialDirectory;
@@ -320,7 +322,9 @@ namespace CodeImp.DoomBuilder.Controls
if (fbd.ShowDialog(new WindowWrapper(hWndOwner)) != DialogResult.OK) return false;
ofd.FileName = fbd.SelectedPath;
flag = true;
+#if !MONO_WINFORMS
}
+#endif
return flag;
}
From 8aa5e9b5ea312a38a0e9bc034aef2c4c3924329f Mon Sep 17 00:00:00 2001
From: samwiddowson <36040364+samwiddowson@users.noreply.github.com>
Date: Tue, 9 Jul 2024 18:47:51 +0100
Subject: [PATCH 3/3] Updated README file with additional advice building on
Linux
---
README.md | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index eed6c11f..0d5f1c10 100755
--- a/README.md
+++ b/README.md
@@ -1,22 +1,32 @@
-**System requirements:**
+# Ultimate Doom Builder
+
+## System requirements
- 2.4 GHz CPU or faster (multi-core recommended)
- Windows 7, 8 or 10
- Graphics card with OpenGL 3.2 support
-**Required software on Windows:**
+### Required software on Windows
- [Microsoft .Net Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472)
-**Building on Linux:**
+## Building on Linux
+These instructions are for Debian-based distros and were tested with Ubuntu 24.04 LTS and Arch.
-These instructions are for Debian-based distros and were tested with Ubuntu 24.04 LTS. For others it should be similar.
+__Note:__ this is experimental. None of the main developers are using Linux as a desktop OS, so you're pretty much on your own if you encounter any problems with running the application.
-__Note:__ this is experimental. None of the developers are using Linux as a desktop OS, so you're pretty much on your own if you encounter any problems with running the application.
-
-- Install Mono. The `mono-complete` package from the Debian repo doesn't include `msbuild`, so you have to install `mono-complete` by following the instructions on the Mono project's website: https://www.mono-project.com/download/stable/#download-lin
-- Install additional required packages: `sudo apt install make g++ git libx11-dev libxfixes-dev mesa-common-dev`
+- Install Mono
+ - **Ubuntu:** The `mono-complete` package from the Debian repo doesn't include `msbuild`, so you have to install `mono-complete` by following the instructions on the Mono project's website: https://www.mono-project.com/download/stable/#download-lin
+ - **Arch:** mono (and msbuild which is also required) is in the *extra/* repo, which is enabled by default. `sudo pacman -S mono mono-msbuild`
+- Install additional required packages
+ - **Ubuntu:** `sudo apt install make g++ git libx11-dev libxfixes-dev mesa-common-dev`
+ - **Arch:** `sudo pacman -S base-devel`
+ - If you're using X11 display manager you may need to install these packages: `libx11 libxfixes`
+ - If you are not using the proprietary nvidia driver you may need to install `mesa`
- Go to a directory of your choice and clone the repository (it'll automatically create an `UltimateDoomBuilder` directory in the current directory): `git clone https://github.com/jewalky/UltimateDoomBuilder.git`
- Compile UDB: `cd UltimateDoomBuilder && make`
- Run UDB: `cd Build && ./builder`
+- Alternatively, to compile UDB in debug mode:
+ - Run `make BUILDTYPE=Debug` in the root project directory
+ - This includes a debug output terminal in the bottom panel
**Links:**
- [Official thread link](https://forum.zdoom.org/viewtopic.php?f=232&t=66745)