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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Restore & build the application
run: dotnet build $env:Solution_Name --configuration $env:Configuration
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Restore & build the application
run: dotnet build $env:Solution_Name --configuration $env:Configuration
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ We have dedicated channel on POL Discord: https://discord.gg/4JbC8hA

## Requirements

Starting from version 4.11.0:
Starting from version 4.20.0:

- Requires .NET Desktop Runtime 10.0.x (or SDK) installed to run the application.
- You can download .NET 10.0 at: <https://dotnet.microsoft.com/en-us/download/dotnet/10.0>
- Minimum supported Windows version is Windows 10.

Versions between version 4.11.0 and 4.19.4:

- Requires .NET Desktop Runtime 8.0.x (or SDK) installed to run the application.
- You can download .NET 8.0 at: <https://dotnet.microsoft.com/en-us/download/dotnet/8.0>
Expand All @@ -24,7 +30,7 @@ Older versions, 4.9.28 and lower use .Net Framework 4.8

## Building

You'll need Visual Studio 2022 v17.10 or newer, .NET 8.0 and .NET desktop development workload.
You'll need Visual Studio 2026 v18.0 or newer, .NET 10.0 SDK and .NET desktop development workload.

## Reporting bugs and issues

Expand Down
2 changes: 1 addition & 1 deletion Ultima/ASCIIFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static unsafe void Initialize()
using (var reader = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
{
var buffer = new byte[(int)reader.Length];
reader.Read(buffer, 0, (int)reader.Length);
reader.ReadExactly(buffer, 0, (int)reader.Length);
fixed (byte* bin = buffer)
{
byte* read = bin;
Expand Down
10 changes: 5 additions & 5 deletions Ultima/Art.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public static bool IsValidStatic(int index)
}

stream.Seek(4, SeekOrigin.Current);
stream.Read(_validBuffer, 0, 4);
stream.ReadExactly(_validBuffer, 0, 4);

short width = (short)(_validBuffer[0] | (_validBuffer[1] << 8));
short height = (short)(_validBuffer[2] | (_validBuffer[3] << 8));
Expand Down Expand Up @@ -346,7 +346,7 @@ public static byte[] GetRawLand(int index)
}

var buffer = new byte[length];
stream.Read(buffer, 0, length);
stream.ReadExactly(buffer, 0, length);
stream.Close();
return buffer;
}
Expand Down Expand Up @@ -418,7 +418,7 @@ public static byte[] GetRawStatic(int index)
}

var buffer = new byte[length];
stream.Read(buffer, 0, length);
stream.ReadExactly(buffer, 0, length);
stream.Close();
return buffer;
}
Expand Down Expand Up @@ -503,7 +503,7 @@ private static unsafe Bitmap LoadStatic(Stream stream, int length)
_streamBuffer = new byte[length];
}

stream.Read(_streamBuffer, 0, length);
stream.ReadExactly(_streamBuffer, 0, length);
stream.Close();

Bitmap bmp;
Expand Down Expand Up @@ -578,7 +578,7 @@ private static unsafe Bitmap LoadLand(Stream stream, int length)
_streamBuffer = new byte[length];
}

stream.Read(_streamBuffer, 0, length);
stream.ReadExactly(_streamBuffer, 0, length);
stream.Close();
fixed (byte* binData = _streamBuffer)
{
Expand Down
2 changes: 1 addition & 1 deletion Ultima/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static int Read(ProcessStream pc, int bytes)
{
var buffer = new byte[bytes];

pc.Read(buffer, 0, bytes);
pc.ReadExactly(buffer, 0, bytes);

switch (bytes)
{
Expand Down
6 changes: 3 additions & 3 deletions Ultima/Gumps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static byte[] GetRawGump(int index, out int width, out int height)
_streamBuffer = new byte[entry.Length];
}

stream.Read(_streamBuffer, 0, entry.Length);
stream.ReadExactly(_streamBuffer, 0, entry.Length);

var result = UopUtils.Decompress(_streamBuffer);
if (result.success is false)
Expand Down Expand Up @@ -272,7 +272,7 @@ public static unsafe Bitmap GetGump(int index, Hue hue, bool onlyHueGrayPixels,
_colorTable = colorTable = new byte[128];
}

stream.Read(streamBuffer, 0, length);
stream.ReadExactly(streamBuffer, 0, length);

fixed (ushort* psHueColors = hue.Colors)
{
Expand Down Expand Up @@ -445,7 +445,7 @@ public static unsafe Bitmap GetGump(int index, out bool patched)
_streamBuffer = new byte[length];
}

stream.Read(_streamBuffer, 0, length);
stream.ReadExactly(_streamBuffer, 0, length);

uint width = (uint)entry.Extra1;
uint height = (uint)entry.Extra2;
Expand Down
2 changes: 1 addition & 1 deletion Ultima/Hues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void Initialize()
GCHandle gc = GCHandle.Alloc(buffer, GCHandleType.Pinned);
try
{
fs.Read(buffer, 0, buffer.Length);
fs.ReadExactly(buffer, 0, buffer.Length);
long currentPos = 0;

for (int i = 0; i < blockCount; ++i)
Expand Down
2 changes: 1 addition & 1 deletion Ultima/RadarCol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void Initialize()
Colors = new ushort[fs.Length / 2];
GCHandle gc = GCHandle.Alloc(Colors, GCHandleType.Pinned);
var buffer = new byte[(int)fs.Length];
fs.Read(buffer, 0, (int)fs.Length);
fs.ReadExactly(buffer, 0, (int)fs.Length);
Marshal.Copy(buffer, 0, gc.AddrOfPinnedObject(), (int)fs.Length);
gc.Free();
}
Expand Down
10 changes: 5 additions & 5 deletions Ultima/Sound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public static UoSound GetSound(int soundId, out bool translated)
var stringBuffer = new byte[32];
var buffer = new byte[length];

stream.Read(stringBuffer, 0, 32);
stream.Read(buffer, 0, length);
stream.ReadExactly(stringBuffer, 0, 32);
stream.ReadExactly(buffer, 0, length);
stream.Close();

var resultBuffer = new byte[buffer.Length + (waveHeader.Length << 2)];
Expand Down Expand Up @@ -233,7 +233,7 @@ public static bool IsValidSound(int soundId, out string name, out bool translate
}

var stringBuffer = new byte[32];
stream.Read(stringBuffer, 0, 32);
stream.ReadExactly(stringBuffer, 0, 32);
stream.Close();
name = Encoding.ASCII.GetString(stringBuffer); // seems that the null terminator's not being properly recognized :/
if (name.IndexOf('\0') > 0)
Expand Down Expand Up @@ -303,7 +303,7 @@ public static void Add(int id, string name, string file)
{
byte[] resultBuffer = new byte[wav.Length];
wav.Seek(0, SeekOrigin.Begin);
wav.Read(resultBuffer, 0, (int)wav.Length);
wav.ReadExactly(resultBuffer, 0, (int)wav.Length);

resultBuffer = CheckAndFixWave(resultBuffer);

Expand Down Expand Up @@ -376,7 +376,7 @@ public static void Save(string path)
{
m.Seek(headerLength, SeekOrigin.Begin);
var resultBuffer = new byte[m.Length - headerLength];
m.Read(resultBuffer, 0, (int)m.Length - headerLength);
m.ReadExactly(resultBuffer, 0, (int)m.Length - headerLength);
binmul.Write(resultBuffer);
}

Expand Down
2 changes: 1 addition & 1 deletion Ultima/Textures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static unsafe Bitmap GetTexture(int index, out bool patched)

byte[] streamBuffer = new byte[max];

stream.Read(streamBuffer, 0, max);
stream.ReadExactly(streamBuffer, 0, max);

fixed (byte* data = streamBuffer)
{
Expand Down
2 changes: 1 addition & 1 deletion Ultima/TileData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ public static unsafe void Initialize()
long currentPos = 0;
try
{
fs.Read(buffer, 0, buffer.Length);
fs.ReadExactly(buffer, 0, buffer.Length);
for (int i = 0; i < 0x4000; i += 32)
{
var ptrHeader = new IntPtr(gc.AddrOfPinnedObject() + currentPos);
Expand Down
6 changes: 3 additions & 3 deletions Ultima/TileMatrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private void InitStatics()

GCHandle gc = GCHandle.Alloc(_staticIndex, GCHandleType.Pinned);
var buffer = new byte[index.Length];
index.Read(buffer, 0, (int)index.Length);
index.ReadExactly(buffer, 0, (int)index.Length);
Marshal.Copy(buffer, 0, gc.AddrOfPinnedObject(), (int)Math.Min(index.Length, BlockHeight * BlockWidth * 12));
gc.Free();
for (var i = (int)Math.Min(index.Length, BlockHeight * BlockWidth); i < BlockHeight * BlockWidth; ++i)
Expand Down Expand Up @@ -297,7 +297,7 @@ private unsafe HuedTile[][][] ReadStaticBlock(int x, int y)
GCHandle gc = GCHandle.Alloc(_buffer, GCHandleType.Pinned);
try
{
_statics.Read(_buffer, 0, length);
_statics.ReadExactly(_buffer, 0, length);

if (_lists == null)
{
Expand Down Expand Up @@ -496,7 +496,7 @@ private Tile[] ReadLandBlock(int x, int y)
_buffer = new byte[192];
}

_map.Read(_buffer, 0, 192);
_map.ReadExactly(_buffer, 0, 192);

Marshal.Copy(_buffer, 0, gc.AddrOfPinnedObject(), 192);
}
Expand Down
4 changes: 2 additions & 2 deletions Ultima/TileMatrixPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private int PatchLand(TileMatrix matrix, string dataPath, string indexPath)
_buffer = new byte[192];
}

fsData.Read(_buffer, 0, 192);
fsData.ReadExactly(_buffer, 0, 192);

Marshal.Copy(_buffer, 0, gc.AddrOfPinnedObject(), 192);
}
Expand Down Expand Up @@ -277,7 +277,7 @@ private int PatchStatics(TileMatrix matrix, string dataPath, string indexPath, s
_buffer = new byte[length];
}

fsData.Read(_buffer, 0, length);
fsData.ReadExactly(_buffer, 0, length);

Marshal.Copy(_buffer, 0, gc.AddrOfPinnedObject(), length);

Expand Down
2 changes: 1 addition & 1 deletion Ultima/Ultima.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
Expand Down
5 changes: 5 additions & 0 deletions UoFiddler.Controls/Classes/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public static class Options
/// </summary>
public static bool PolSoundIdOffset { get; set; }

/// <summary>
/// Runtime flag set from AppSettings at startup. Not persisted in profiles.
/// </summary>
public static bool DarkMode { get; set; }

/// <summary>
/// Defines the cmd to Send Client to Loc
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions UoFiddler.Controls/Forms/AnimDataImportForm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using UoFiddler.Controls.Classes;
using static Ultima.Animdata;
Expand All @@ -8,7 +9,9 @@ namespace UoFiddler.Controls.Forms
{
public partial class AnimDataImportForm : Form
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Action OnAfterImport { get; set; }

public AnimDataImportForm()
{
InitializeComponent();
Expand Down
2 changes: 1 addition & 1 deletion UoFiddler.Controls/Forms/FontTextForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public FontTextForm(int type, int font)
TopMost = true;
_type = type;
_font = font;
pictureBox1.BackColor = Color.White;
pictureBox1.BackColor = Options.DarkMode ? Color.LightGray : Color.White;
Text = _type == 1
? $"Unicode Font: {font}"
: $"ASCII Font: {font}";
Expand Down
2 changes: 2 additions & 0 deletions UoFiddler.Controls/Forms/ItemDetailForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
***************************************************************************/

using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
Expand Down Expand Up @@ -44,6 +45,7 @@ public ItemDetailForm(int i)
/// <summary>
/// Sets Hue
/// </summary>
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int Hue
{
get => _hue;
Expand Down
39 changes: 25 additions & 14 deletions UoFiddler.Controls/Forms/MultisHelpForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
*
***************************************************************************/

using System.Drawing;
using System.Windows.Forms;
using UoFiddler.Controls.Classes;

namespace UoFiddler.Controls.Forms
{
Expand All @@ -23,26 +25,35 @@ public MultisHelpForm()

private void PopulateShortcuts()
{
_listView.Groups.Add(new ListViewGroup("preview", "Preview"));
_listView.Groups.Add(new ListViewGroup("zoom", "Zoom (100% mode only)"));
_listView.Groups.Add(new ListViewGroup("pan", "Panning (100% mode only)"));
AddHeader("Preview");
Add("Fit preview to window", "Toggle button on toolbar — scales to fit or shows at 100% with scrollbars");

Add("Fit preview to window", "Toggle button on toolbar — scales to fit or shows at 100% with scrollbars", "preview");
AddHeader("Zoom (100% mode only)");
Add("Ctrl + Mouse Wheel", "Zoom In / Out");
Add("Shift + = (Plus key)", "Zoom In");
Add("- (Minus key)", "Zoom Out");
Add("Numpad +", "Zoom In");
Add("Numpad -", "Zoom Out");
Add("Ctrl + 0", "Reset zoom to 100%");

Add("Ctrl + Mouse Wheel", "Zoom In / Out", "zoom");
Add("Shift + = (Plus key)", "Zoom In", "zoom");
Add("- (Minus key)", "Zoom Out", "zoom");
Add("Numpad +", "Zoom In", "zoom");
Add("Numpad -", "Zoom Out", "zoom");
Add("Ctrl + 0", "Reset zoom to 100%", "zoom");
AddHeader("Panning (100% mode only)");
Add("Left-click drag", "Pan the view");
}

Add("Left-click drag", "Pan the view", "pan");
private void AddHeader(string text)
{
var item = new ListViewItem(text)
{
Font = new Font(_listView.Font, FontStyle.Bold),
ForeColor = Options.DarkMode ? Color.OrangeRed : Color.MediumBlue,
};
item.SubItems.Add(string.Empty);
_listView.Items.Add(item);
}

private void Add(string key, string action, string groupKey)
private void Add(string key, string action)
{
var group = _listView.Groups[groupKey];
var item = new ListViewItem(key, group);
var item = new ListViewItem(key);
item.SubItems.Add(action);
_listView.Items.Add(item);
}
Expand Down
Loading