Skip to content
Open
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
12 changes: 6 additions & 6 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0

- name: Install .NET Core
uses: actions/setup-dotnet@v4.3.1
uses: actions/setup-dotnet@v5.0.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
env:
Configuration: ${{ matrix.configuration }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v5.0.0
with:
name: ${{ env.Asset_Name }}.zip
path: ./UOFiddler/bin/Release/
Expand All @@ -65,7 +65,7 @@ jobs:

steps:
- name: Download artifacts
uses: actions/download-artifact@v4.3.0
uses: actions/download-artifact@v6.0.0
with:
name: ${{ env.Asset_Name }}.zip
path: ./${{ env.Asset_Name }}/
Expand All @@ -74,7 +74,7 @@ jobs:
run: 7z a -tzip ${{ env.Asset_Name }}.zip './${{ env.Asset_Name }}'

- name: Create release
uses: softprops/action-gh-release@v2.2.2
uses: softprops/action-gh-release@v2.4.2
with:
name: UOFiddler ${{ github.ref_name }}
generate_release_notes: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v5.0.0
with:
fetch-depth: 1

- name: Install .NET Core
uses: actions/setup-dotnet@v4.3.1
uses: actions/setup-dotnet@v5.0.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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ We have dedicated channel on POL Discord: https://discord.gg/4JbC8hA

## Requirements

Starting from version 4.18.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.

Starting from version 4.11.0:

- Requires .NET Desktop Runtime 8.0.x (or SDK) installed to run the application.
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 @@ -181,7 +181,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 @@ -272,7 +272,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 @@ -344,7 +344,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 @@ -429,7 +429,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 @@ -504,7 +504,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 @@ -1321,7 +1321,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
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: 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
4 changes: 1 addition & 3 deletions UoFiddler.Controls/UoFiddler.Controls.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Controls</AssemblyName>
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AssemblyTitle>Controls</AssemblyTitle>
Expand Down Expand Up @@ -428,8 +428,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="System.Drawing.Common" Version="9.0.5" />
<PackageReference Include="System.Resources.Extensions" Version="9.0.5" />
<PackageReference Include="AnimatedGif" Version="1.0.5" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions UoFiddler.Controls/UserControls/AnimatedPictureBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public AnimatedFrame CurrentFrame
get => _frames?[_frameIndex];
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int FrameIndex
{
get => _frameIndex;
Expand All @@ -84,6 +85,7 @@ public int FrameIndex
}
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool ShowFrameBounds
{
get => _showFrameBounds;
Expand All @@ -94,6 +96,7 @@ public bool ShowFrameBounds
}
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int FrameDelay
{
get => _timer.Interval;
Expand All @@ -118,6 +121,7 @@ public int FrameDelay
}
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool Animate
{
get => _animate;
Expand Down
1 change: 1 addition & 0 deletions UoFiddler.Controls/UserControls/ItemsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public ItemsControl()

private int _selectedGraphicId = -1;

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectedGraphicId
{
get => _selectedGraphicId;
Expand Down
Loading