├── .editorconfig ├── .github └── workflows │ ├── build-and-release.yml │ └── build-pr.yml ├── .gitignore ├── README.md ├── Ultima ├── ASCIIFont.cs ├── AnimationEdit.cs ├── Animations.cs ├── Animdata.cs ├── Art.cs ├── BinaryExtensions.cs ├── BodyConverter.cs ├── BodyTable.cs ├── CalibrationInfo.cs ├── Client.cs ├── FileIndex.cs ├── Files.cs ├── Gumps.cs ├── Helpers │ ├── Extensions.cs │ ├── HueHelpers.cs │ ├── MapHelper.cs │ ├── MoveToFront.cs │ ├── MultiHelpers.cs │ ├── MythicDecompress.cs │ ├── TileDataHelpers.cs │ └── UopUtils.cs ├── Hues.cs ├── Light.cs ├── LocationPointer.cs ├── Map.cs ├── MultiComponentList.cs ├── MultiMap.cs ├── Multis.cs ├── NativeMethods.cs ├── ProcessStream.cs ├── RadarCol.cs ├── SkillGroups.cs ├── Skills.cs ├── Sound.cs ├── SpeechList.cs ├── StringEntry.cs ├── StringList.cs ├── Textures.cs ├── TileData.cs ├── TileList.cs ├── TileMatrix.cs ├── TileMatrixPatch.cs ├── Ultima.csproj ├── UnicodeFont.cs ├── Verdata.cs ├── WaveFormat.cs ├── WaveFormatException.cs └── WindowProcessStream.cs ├── UoFiddler.Controls ├── Classes │ ├── AnimatedFrame.cs │ ├── AnimatedFrameListExtensions.cs │ ├── ControlEvents.cs │ ├── ExportedAnimData.cs │ ├── MyEventArgs.cs │ ├── Options.cs │ ├── SearchHelper.cs │ ├── SearchResult.cs │ └── Utils.cs ├── Forms │ ├── AnimDataExportForm.Designer.cs │ ├── AnimDataExportForm.cs │ ├── AnimDataExportForm.resx │ ├── AnimDataImportForm.Designer.cs │ ├── AnimDataImportForm.cs │ ├── AnimDataImportForm.resx │ ├── AnimationEditForm.Designer.cs │ ├── AnimationEditForm.cs │ ├── AnimationEditForm.resx │ ├── AnimationListNewEntriesForm.Designer.cs │ ├── AnimationListNewEntriesForm.cs │ ├── AnimationListNewEntriesForm.resx │ ├── ClilocAddForm.Designer.cs │ ├── ClilocAddForm.cs │ ├── ClilocAddForm.resx │ ├── ClilocDetailForm.Designer.cs │ ├── ClilocDetailForm.cs │ ├── ClilocDetailForm.resx │ ├── FontOffsetForm.Designer.cs │ ├── FontOffsetForm.cs │ ├── FontOffsetForm.resx │ ├── FontTextForm.Designer.cs │ ├── FontTextForm.cs │ ├── FontTextForm.resx │ ├── HueEditForm.Designer.cs │ ├── HueEditForm.cs │ ├── HueEditForm.resx │ ├── HuePopUpDress.Designer.cs │ ├── HuePopUpDress.cs │ ├── HuePopUpDress.resx │ ├── HuePopUpForm.Designer.cs │ ├── HuePopUpForm.cs │ ├── HuePopUpForm.resx │ ├── HuePopUpItemForm.Designer.cs │ ├── HuePopUpItemForm.cs │ ├── HuePopUpItemForm.resx │ ├── ItemDetailForm.Designer.cs │ ├── ItemDetailForm.cs │ ├── ItemDetailForm.resx │ ├── MapClearStaticsForm.Designer.cs │ ├── MapClearStaticsForm.cs │ ├── MapClearStaticsForm.resx │ ├── MapDetailsForm.Designer.cs │ ├── MapDetailsForm.cs │ ├── MapDetailsForm.resx │ ├── MapDiffInsertForm.Designer.cs │ ├── MapDiffInsertForm.cs │ ├── MapDiffInsertForm.resx │ ├── MapMarkerForm.Designer.cs │ ├── MapMarkerForm.cs │ ├── MapMarkerForm.resx │ ├── MapMeltStaticsForm.Designer.cs │ ├── MapMeltStaticsForm.cs │ ├── MapMeltStaticsForm.resx │ ├── MapReplaceForm.Designer.cs │ ├── MapReplaceForm.cs │ ├── MapReplaceForm.resx │ ├── MapReplaceTilesForm.Designer.cs │ ├── MapReplaceTilesForm.cs │ ├── MapReplaceTilesForm.resx │ ├── MultiImportForm.Designer.cs │ ├── MultiImportForm.cs │ ├── MultiImportForm.resx │ ├── ProgressBarDialog.Designer.cs │ ├── ProgressBarDialog.cs │ ├── ProgressBarDialog.resx │ ├── TileDataFilterForm.Designer.cs │ ├── TileDataFilterForm.cs │ └── TileDataFilterForm.resx ├── Helpers │ ├── FormsDesignerHelper.cs │ ├── RichTextBoxExtensions.cs │ ├── StringExtensions.cs │ ├── ThrowIf.cs │ └── TreeViewExtensions.cs ├── Plugin │ ├── AvailablePlugin.cs │ ├── AvailablePlugins.cs │ ├── GlobalPlugins.cs │ ├── Interfaces │ │ └── IPluginHost.cs │ ├── PluginBase.cs │ ├── PluginEvents.cs │ └── PluginServices.cs ├── Properties │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ ├── emptySquare.jpg │ ├── fullSquare.jpg │ ├── mouse.bmp │ ├── padlock.jpg │ └── staticPlayButton.png ├── UoFiddler.Controls.csproj └── UserControls │ ├── AnimDataControl.Designer.cs │ ├── AnimDataControl.cs │ ├── AnimDataControl.resx │ ├── AnimatedPictureBox.cs │ ├── AnimationListControl.Designer.cs │ ├── AnimationListControl.cs │ ├── AnimationListControl.resx │ ├── ClilocControl.Designer.cs │ ├── ClilocControl.cs │ ├── ClilocControl.resx │ ├── CollapsibleSplitter.Designer.cs │ ├── CollapsibleSplitter.cs │ ├── CollapsibleSplitter.resx │ ├── DressControl.Designer.cs │ ├── DressControl.cs │ ├── DressControl.resx │ ├── FontsControl.Designer.cs │ ├── FontsControl.cs │ ├── FontsControl.resx │ ├── GumpControl.Designer.cs │ ├── GumpControl.cs │ ├── GumpControl.resx │ ├── HuesControl.Designer.cs │ ├── HuesControl.cs │ ├── HuesControl.resx │ ├── ItemsControl.Designer.cs │ ├── ItemsControl.cs │ ├── ItemsControl.resx │ ├── LandTilesControl.Designer.cs │ ├── LandTilesControl.cs │ ├── LandTilesControl.resx │ ├── LightControl.Designer.cs │ ├── LightControl.cs │ ├── LightControl.resx │ ├── ListViewWithScrollbar.Designer.cs │ ├── ListViewWithScrollbar.cs │ ├── ListViewWithScrollbar.resx │ ├── MapControl.Designer.cs │ ├── MapControl.cs │ ├── MapControl.resx │ ├── MultiMapControl.Designer.cs │ ├── MultiMapControl.cs │ ├── MultiMapControl.resx │ ├── MultisControl.Designer.cs │ ├── MultisControl.cs │ ├── MultisControl.resx │ ├── RadarColorControl.Designer.cs │ ├── RadarColorControl.cs │ ├── RadarColorControl.resx │ ├── SkillGroupControl.Designer.cs │ ├── SkillGroupControl.cs │ ├── SkillGroupControl.resx │ ├── SkillsControl.Designer.cs │ ├── SkillsControl.cs │ ├── SkillsControl.resx │ ├── SoundsControl.Designer.cs │ ├── SoundsControl.cs │ ├── SoundsControl.resx │ ├── SpeechControl.Designer.cs │ ├── SpeechControl.cs │ ├── SpeechControl.resx │ ├── TexturesControl.Designer.cs │ ├── TexturesControl.cs │ ├── TexturesControl.resx │ ├── TileDataControl.Designer.cs │ ├── TileDataControl.cs │ ├── TileDataControl.resx │ └── TileView │ ├── CacheItemsEventHandler.cs │ ├── IndicesCollection.cs │ └── TileViewControl.cs ├── UoFiddler.Plugin.Compare ├── Classes │ ├── SecondArt.cs │ ├── SecondFileIndex.cs │ ├── SecondGump.cs │ ├── SecondHue.cs │ └── SecondTexture.cs ├── ComparePluginBase.cs ├── Properties │ ├── Resources.Designer.cs │ └── Resources.resx ├── UoFiddler.Plugin.Compare.csproj └── UserControls │ ├── CompareCliLocControl.Designer.cs │ ├── CompareCliLocControl.cs │ ├── CompareCliLocControl.resx │ ├── CompareGumpControl.Designer.cs │ ├── CompareGumpControl.cs │ ├── CompareGumpControl.resx │ ├── CompareHuesControl.Designer.cs │ ├── CompareHuesControl.cs │ ├── CompareHuesControl.resx │ ├── CompareItemControl.Designer.cs │ ├── CompareItemControl.cs │ ├── CompareItemControl.resx │ ├── CompareLandControl.Designer.cs │ ├── CompareLandControl.cs │ ├── CompareLandControl.resx │ ├── CompareMapControl.Designer.cs │ ├── CompareMapControl.cs │ ├── CompareMapControl.resx │ ├── CompareTextureControl.Designer.cs │ ├── CompareTextureControl.cs │ └── CompareTextureControl.resx ├── UoFiddler.Plugin.ExamplePlugin ├── ExamplePluginBase.cs ├── Forms │ ├── ExampleForm.Designer.cs │ ├── ExampleForm.cs │ └── ExampleForm.resx ├── UoFiddler.Plugin.ExamplePlugin.csproj └── UserControls │ ├── ExampleControl.Designer.cs │ ├── ExampleControl.cs │ └── ExampleControl.resx ├── UoFiddler.Plugin.MassImport ├── Forms │ ├── MassImportForm.Designer.cs │ ├── MassImportForm.cs │ └── MassImportForm.resx ├── Imports │ ├── ImportEntry.cs │ ├── ImportEntryGump.cs │ ├── ImportEntryHue.cs │ ├── ImportEntryInvalid.cs │ ├── ImportEntryItem.cs │ ├── ImportEntryLandTile.cs │ ├── ImportEntryMulti.cs │ ├── ImportEntryTexture.cs │ ├── ImportEntryTileDataItem.cs │ └── ImportEntryTileDataLand.cs ├── MassImportPluginBase.cs └── UoFiddler.Plugin.MassImport.csproj ├── UoFiddler.Plugin.MultiEditor ├── Classes │ └── MultiEditorComponentList.cs ├── MultiEditorPluginBase.cs ├── Properties │ ├── Resources.Designer.cs │ └── Resources.resx ├── UoFiddler.Plugin.MultiEditor.csproj ├── UserControls │ ├── MultiEditorControl.Designer.cs │ ├── MultiEditorControl.cs │ └── MultiEditorControl.resx ├── images │ ├── AltitudeButton.bmp │ ├── AltitudeButton_Selected.bmp │ ├── AltitudeButton_Selected.psd │ ├── DrawButton.bmp │ ├── DrawButton_Selected.bmp │ ├── PipetteButton.bmp │ ├── PipetteButton_Selected.bmp │ ├── RemoveButton.bmp │ ├── RemoveButton_Selected.bmp │ ├── SelectButton.bmp │ ├── SelectButton_Selected.bmp │ ├── TransButton.bmp │ ├── TransButton_Selected.bmp │ ├── TransButton_Selected.psd │ ├── VirtualFloorButton.bmp │ ├── VirtualFloorButton_Selected.bmp │ ├── VirtualFloorButton_Selected.psd │ └── treeViewImage.bmp └── multieditor.xml ├── UoFiddler.Plugin.SendItem ├── Forms │ ├── SendItemOptionsForm.Designer.cs │ ├── SendItemOptionsForm.cs │ └── SendItemOptionsForm.resx ├── SendItem.cs └── UoFiddler.Plugin.SendItem.csproj ├── UoFiddler.Plugin.UopPacker ├── Classes │ ├── FileType.cs │ └── LegacyMulFileConverter.cs ├── UoFiddler.Plugin.UopPacker.csproj ├── UopPacker.cs └── UserControls │ ├── UopPackerControl.Designer.cs │ ├── UopPackerControl.cs │ └── UopPackerControl.resx ├── UoFiddler.sln └── UoFiddler ├── Animationlist.xml ├── Classes ├── ExternTool.cs ├── FiddlerOptions.cs ├── UpdateChecker.cs ├── UpdateResponse.cs └── UpdateRunner.cs ├── FiddlerAppContext.cs ├── Forms ├── AboutBoxForm.Designer.cs ├── AboutBoxForm.cs ├── AboutBoxForm.resx ├── ExceptionForm.Designer.cs ├── ExceptionForm.cs ├── ExceptionForm.resx ├── LoadProfileForm.Designer.cs ├── LoadProfileForm.cs ├── LoadProfileForm.resx ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── ManagePluginsForm.Designer.cs ├── ManagePluginsForm.cs ├── ManagePluginsForm.resx ├── ManageToolsForm.Designer.cs ├── ManageToolsForm.cs ├── ManageToolsForm.resx ├── OptionsForm.Designer.cs ├── OptionsForm.cs ├── OptionsForm.resx ├── PathSettingsForm.Designer.cs ├── PathSettingsForm.cs ├── PathSettingsForm.resx ├── UnDockedForm.Designer.cs ├── UnDockedForm.cs └── UnDockedForm.resx ├── Multilist.xml ├── Options_default.xml ├── Program.cs ├── Properties ├── Resources.Designer.cs └── Resources.resx ├── Resources ├── UOFiddler.jpg └── UOFiddlerIcon.ico ├── UoFiddler.csproj ├── app.config └── old-changelog.txt /.github/workflows/build-and-release.yml: -------------------------------------------------------------------------------- 1 | name: Build & Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - "master" 7 | tags: 8 | - "[0-9]+.[0-9]+.[0-9]+" 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | build: 15 | name: Build 16 | runs-on: windows-latest 17 | 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | configuration: 22 | - Release 23 | 24 | env: 25 | DOTNET_CLI_TELEMETRY_OPTOUT: 1 26 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 27 | DOTNET_NOLOGO: 1 28 | Solution_Name: UoFiddler.sln 29 | Asset_Name: UOFiddler-${{ github.ref_name }} 30 | 31 | steps: 32 | - name: Checkout 33 | uses: actions/checkout@v4.2.2 34 | with: 35 | fetch-depth: 0 36 | 37 | - name: Install .NET Core 38 | uses: actions/setup-dotnet@v4.3.1 39 | with: 40 | dotnet-version: 8.0.x 41 | 42 | - name: Restore & build the application 43 | run: dotnet build $env:Solution_Name --configuration $env:Configuration 44 | env: 45 | Configuration: ${{ matrix.configuration }} 46 | 47 | - name: Upload build artifacts 48 | uses: actions/upload-artifact@v4.6.2 49 | with: 50 | name: ${{ env.Asset_Name }}.zip 51 | path: ./UOFiddler/bin/Release/ 52 | 53 | release: 54 | name: Release 55 | needs: build 56 | if: startsWith(github.ref, 'refs/tags/') 57 | runs-on: windows-latest 58 | 59 | permissions: 60 | contents: write 61 | 62 | env: 63 | Asset_Name: UOFiddler-${{ github.ref_name }} 64 | Body_Path: release_body.md 65 | 66 | steps: 67 | - name: Download artifacts 68 | uses: actions/download-artifact@v4.3.0 69 | with: 70 | name: ${{ env.Asset_Name }}.zip 71 | path: ./${{ env.Asset_Name }}/ 72 | 73 | - name: Archive release 74 | run: 7z a -tzip ${{ env.Asset_Name }}.zip './${{ env.Asset_Name }}' 75 | 76 | - name: Create release 77 | uses: softprops/action-gh-release@v2.2.2 78 | with: 79 | name: UOFiddler ${{ github.ref_name }} 80 | generate_release_notes: true 81 | draft: false 82 | prerelease: false 83 | fail_on_unmatched_files: true 84 | files: ${{ env.Asset_Name }}.zip 85 | -------------------------------------------------------------------------------- /.github/workflows/build-pr.yml: -------------------------------------------------------------------------------- 1 | name: Build (PR) 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - "**" 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | build: 13 | name: Build 14 | 15 | runs-on: windows-latest 16 | 17 | strategy: 18 | matrix: 19 | configuration: 20 | - Release 21 | 22 | env: 23 | DOTNET_CLI_TELEMETRY_OPTOUT: 1 24 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 25 | DOTNET_NOLOGO: 1 26 | Solution_Name: UoFiddler.sln 27 | 28 | steps: 29 | - name: Checkout 30 | uses: actions/checkout@v4.2.2 31 | with: 32 | fetch-depth: 1 33 | 34 | - name: Install .NET Core 35 | uses: actions/setup-dotnet@v4.3.1 36 | with: 37 | dotnet-version: 8.0.x 38 | 39 | - name: Restore & build the application 40 | run: dotnet build $env:Solution_Name --configuration $env:Configuration 41 | env: 42 | Configuration: ${{ matrix.configuration }} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UOFiddler 2 | 3 | ## About 4 | 5 | UOFiddler based on Ultima SDK it's a tool to view and alter almost every UO 2D client file. Source code is released under the Beerware license. 6 | 7 | We have dedicated channel on POL Discord: https://discord.gg/4JbC8hA 8 | 9 | ## Requirements 10 | 11 | Starting from version 4.11.0: 12 | 13 | - Requires .NET Desktop Runtime 8.0.x (or SDK) installed to run the application. 14 | - You can download .NET 8.0 at: 15 | - Minimum supported Windows version is Windows 10. 16 | 17 | Versions between 4.10.0 and 4.10.9 18 | 19 | - Requires .NET Desktop Runtime 7.0.x (or SDK) installed to run the application. 20 | - You can download .NET 7.0 at: 21 | - Minimum supported Windows version is Windows 10. 22 | 23 | Older versions, 4.9.28 and lower use .Net Framework 4.8 24 | 25 | ## Building 26 | 27 | You'll need Visual Studio 2022 v17.10 or newer, .NET 8.0 and .NET desktop development workload. 28 | 29 | ## Reporting bugs and issues 30 | 31 | Please report any bugs or issues here: [issues](https://github.com/polserver/UOFiddler/issues). 32 | -------------------------------------------------------------------------------- /Ultima/BinaryExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | 5 | namespace Ultima 6 | { 7 | public static class BinaryExtensions 8 | { 9 | public static string ReadString(this BinaryReader reader, int length) 10 | { 11 | if (reader == null) 12 | { 13 | throw new ArgumentNullException(nameof(reader)); 14 | } 15 | 16 | if (length < 0 || length > reader.BaseStream.Length + reader.BaseStream.Position) 17 | { 18 | throw new ArgumentException("Out of range."); 19 | } 20 | 21 | char[] buffer = new char[length]; 22 | reader.Read(buffer, 0, length); 23 | return new string(buffer); 24 | } 25 | 26 | public static void WriteString(this BinaryWriter writer, string data) 27 | { 28 | if (writer == null) 29 | { 30 | throw new ArgumentNullException(nameof(writer)); 31 | } 32 | 33 | if (data == null) 34 | { 35 | throw new ArgumentNullException(nameof(data)); 36 | } 37 | 38 | byte[] bytes = Encoding.ASCII.GetBytes(data); 39 | writer.Write(bytes); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Ultima/BodyTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace Ultima 6 | { 7 | public sealed class BodyTable 8 | { 9 | public static Dictionary Entries { get; private set; } 10 | 11 | static BodyTable() 12 | { 13 | Initialize(); 14 | } 15 | 16 | public static void Initialize() 17 | { 18 | Entries = new Dictionary(); 19 | 20 | string filePath = Files.GetFilePath("body.def"); 21 | 22 | if (filePath == null) 23 | { 24 | return; 25 | } 26 | 27 | using (var def = new StreamReader(filePath)) 28 | { 29 | while (def.ReadLine() is { } line) 30 | { 31 | line = line.Trim(); 32 | 33 | if (line.Length == 0 || line.StartsWith("#")) 34 | { 35 | continue; 36 | } 37 | 38 | try 39 | { 40 | int index1 = line.IndexOf("{", StringComparison.Ordinal); 41 | int index2 = line.IndexOf("}", StringComparison.Ordinal); 42 | 43 | string param1 = line.Substring(0, index1); 44 | string param2 = line.Substring(index1 + 1, index2 - index1 - 1); 45 | string param3 = line.Substring(index2 + 1); 46 | 47 | int indexOf = param2.IndexOf(','); 48 | 49 | if (indexOf > -1) 50 | { 51 | param2 = param2.Substring(0, indexOf).Trim(); 52 | } 53 | 54 | int iParam1 = Convert.ToInt32(param1.Trim()); 55 | int iParam2 = Convert.ToInt32(param2.Trim()); 56 | int iParam3 = Convert.ToInt32(param3.Trim()); 57 | 58 | Entries[iParam1] = new BodyTableEntry(iParam2, iParam1, iParam3); 59 | } 60 | catch 61 | { 62 | // TODO: ignored? 63 | // ignored 64 | } 65 | } 66 | } 67 | } 68 | } 69 | 70 | public sealed class BodyTableEntry 71 | { 72 | public int OldId { get; set; } 73 | public int NewId { get; set; } 74 | public int NewHue { get; set; } 75 | 76 | public BodyTableEntry(int oldId, int newId, int newHue) 77 | { 78 | OldId = oldId; 79 | NewId = newId; 80 | NewHue = newHue; 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /Ultima/Helpers/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Imaging; 4 | using System.Runtime.InteropServices; 5 | using System.Security.Cryptography; 6 | 7 | namespace Ultima.Helpers 8 | { 9 | public static class Extensions 10 | { 11 | public static byte[] ToArray(this Bitmap bmp, PixelFormat? format = null) 12 | { 13 | if (bmp == null) 14 | { 15 | throw new ArgumentNullException(nameof(bmp)); 16 | } 17 | 18 | Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height); 19 | BitmapData data = bmp.LockBits(rect, ImageLockMode.ReadOnly, format ?? bmp.PixelFormat); 20 | try 21 | { 22 | int size = data.Stride * bmp.Height; 23 | byte[] buffer = new byte[size]; 24 | Marshal.Copy(data.Scan0, buffer, 0, size); 25 | return buffer; 26 | } 27 | finally 28 | { 29 | bmp.UnlockBits(data); 30 | } 31 | } 32 | 33 | static readonly SHA256 _sha256 = SHA256.Create(); 34 | 35 | public static byte[] ToSha256(this byte[] buffer) 36 | { 37 | return _sha256.ComputeHash(buffer); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Ultima/Helpers/HueHelpers.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Drawing; 13 | 14 | namespace Ultima.Helpers 15 | { 16 | public static class HueHelpers 17 | { 18 | /// 19 | /// Converts RGB value to Hue color 20 | /// 21 | /// 22 | /// 23 | public static ushort ColorToHue(Color color) 24 | { 25 | const double scale = 31.0 / 255; 26 | 27 | ushort origRed = color.R; 28 | var newRed = (ushort)(origRed * scale); 29 | if (newRed == 0 && origRed != 0) 30 | { 31 | newRed = 1; 32 | } 33 | 34 | ushort origGreen = color.G; 35 | var newGreen = (ushort)(origGreen * scale); 36 | if (newGreen == 0 && origGreen != 0) 37 | { 38 | newGreen = 1; 39 | } 40 | 41 | ushort origBlue = color.B; 42 | var newBlue = (ushort)(origBlue * scale); 43 | if (newBlue == 0 && origBlue != 0) 44 | { 45 | newBlue = 1; 46 | } 47 | 48 | return (ushort)((newRed << 10) | (newGreen << 5) | newBlue); 49 | } 50 | 51 | /// 52 | /// Converts Hue color to RGB color 53 | /// 54 | /// 55 | /// 56 | public static Color HueToColor(ushort hue) 57 | { 58 | const int scale = 255 / 31; 59 | return Color.FromArgb(((hue & 0x7c00) >> 10) * scale, ((hue & 0x3e0) >> 5) * scale, (hue & 0x1f) * scale); 60 | } 61 | 62 | public static int HueToColorR(ushort hue) 63 | { 64 | return ((hue & 0x7c00) >> 10) * (255 / 31); 65 | } 66 | 67 | public static int HueToColorG(ushort hue) 68 | { 69 | return ((hue & 0x3e0) >> 5) * (255 / 31); 70 | } 71 | 72 | public static int HueToColorB(ushort hue) 73 | { 74 | return (hue & 0x1f) * (255 / 31); 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /Ultima/Helpers/MapHelper.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | namespace Ultima.Helpers 13 | { 14 | public sealed class MapHelper 15 | { 16 | /// 17 | /// Checks if map1.mul exists and sets 18 | /// 19 | public static void CheckForNewMapSize() 20 | { 21 | if (Files.GetFilePath("map1.mul") != null || Files.GetFilePath("map1legacymul.uop") != null) 22 | { 23 | Map.Trammel = Map.Trammel.Width == 7168 24 | ? new Map(1, 1, 7168, 4096) 25 | : new Map(1, 1, 6144, 4096); 26 | } 27 | else 28 | { 29 | Map.Trammel = Map.Trammel.Width == 7168 30 | ? new Map(0, 1, 7168, 4096) 31 | : new Map(0, 1, 6144, 4096); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Ultima/Helpers/MoveToFront.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Ultima.Helpers 4 | { 5 | public static class MoveToFrontCoding 6 | { 7 | // complexity : O(256*N) -> O(N) 8 | public static byte[] Encode(byte[] input) 9 | { 10 | Span symbols = stackalloc byte[256]; 11 | byte[] output = new byte[input.Length]; 12 | 13 | for (int i = 0; i < 256; i++) 14 | { 15 | symbols[i] = (byte)i; 16 | } 17 | 18 | for (int i = 0; i < input.Length; i++) 19 | { 20 | int ind = MoveToFront(symbols, input[i]); 21 | output[i] = (byte)ind; 22 | } 23 | 24 | return output; 25 | } 26 | 27 | // complexity : O(256*N) -> O(N) 28 | public static byte[] Decode(byte[] input) 29 | { 30 | Span symbols = stackalloc byte[256]; 31 | byte[] output = new byte[input.Length]; 32 | 33 | for (int i = 0; i < 256; i++) 34 | { 35 | symbols[i] = (byte)i; 36 | } 37 | 38 | for (int i = 0; i < input.Length; i++) 39 | { 40 | int ind = input[i]; 41 | output[i] = symbols[ind]; 42 | 43 | MoveToFront(symbols, ind); 44 | } 45 | 46 | return output; 47 | } 48 | 49 | // params : array, element to move 50 | // get the index of the element and move it to the front 51 | // best case : O(1), average and worst Case : O(N) 52 | private static int MoveToFront(Span array, byte element) 53 | { 54 | if (array[0] == element) 55 | { 56 | return 0; 57 | } 58 | 59 | int elementInd = -1; 60 | 61 | for (int i = array.Length - 1; i > 0; i--) 62 | { 63 | if (array[i] == element) 64 | { 65 | elementInd = i; 66 | } 67 | 68 | if (elementInd != -1) 69 | { 70 | array[i] = array[i - 1]; 71 | } 72 | } 73 | 74 | array[0] = element; 75 | 76 | return elementInd; 77 | } 78 | 79 | // params : array, index of the element 80 | // move element to the front 81 | // complexity : O(elementInd) 82 | // best case : O(1), worst case : O(N) 83 | private static void MoveToFront(Span array, int elementInd) 84 | { 85 | byte element = array[elementInd]; 86 | 87 | for (int i = elementInd; i > 0; i--) 88 | { 89 | array[i] = array[i - 1]; 90 | } 91 | 92 | array[0] = element; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Ultima/Helpers/MultiHelpers.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.IO; 13 | 14 | namespace Ultima.Helpers 15 | { 16 | public static class MultiHelpers 17 | { 18 | public static string ReadUOAString(BinaryReader bin) 19 | { 20 | byte flag = bin.ReadByte(); 21 | 22 | return flag == 0 ? null : bin.ReadString(); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Ultima/Helpers/TileDataHelpers.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Globalization; 13 | using System.Text; 14 | 15 | namespace Ultima.Helpers 16 | { 17 | public static class TileDataHelpers 18 | { 19 | private static readonly byte[] _stringBuffer = new byte[20]; 20 | 21 | public static unsafe string ReadNameString(byte* buffer) 22 | { 23 | int count; 24 | for (count = 0; count < 20 && *buffer != 0; ++count) 25 | { 26 | _stringBuffer[count] = *buffer++; 27 | } 28 | 29 | return Encoding.ASCII.GetString(_stringBuffer, 0, count); 30 | } 31 | 32 | public static string ReadNameString(byte[] buffer, int len) 33 | { 34 | int count; 35 | for (count = 0; count < 20 && buffer[count] != 0; ++count) 36 | { 37 | // TODO: this loop is weird 38 | //; 39 | } 40 | 41 | return Encoding.ASCII.GetString(buffer, 0, count); 42 | } 43 | 44 | public static int ConvertStringToInt(string text) 45 | { 46 | int result; 47 | if (text.Contains("0x")) 48 | { 49 | string convert = text.Replace("0x", ""); 50 | int.TryParse(convert, NumberStyles.HexNumber, null, out result); 51 | } 52 | else 53 | { 54 | int.TryParse(text, NumberStyles.Integer, null, out result); 55 | } 56 | 57 | return result; 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Ultima/LocationPointer.cs: -------------------------------------------------------------------------------- 1 | namespace Ultima 2 | { 3 | public sealed class LocationPointer 4 | { 5 | public int PointerX { get; } 6 | public int PointerY { get; } 7 | public int PointerZ { get; } 8 | public int PointerF { get; } 9 | 10 | public int SizeX { get; } 11 | public int SizeY { get; } 12 | public int SizeZ { get; } 13 | public int SizeF { get; } 14 | 15 | public LocationPointer(int ptrX, int ptrY, int ptrZ, int ptrF, int sizeX, int sizeY, int sizeZ, int sizeF) 16 | { 17 | PointerX = ptrX; 18 | PointerY = ptrY; 19 | PointerZ = ptrZ; 20 | PointerF = ptrF; 21 | 22 | SizeX = sizeX; 23 | SizeY = sizeY; 24 | SizeZ = sizeZ; 25 | SizeF = sizeF; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Ultima/StringEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace Ultima 5 | { 6 | public sealed class StringEntry 7 | { 8 | [Flags] 9 | public enum CliLocFlag 10 | { 11 | Original = 0x0, 12 | Custom = 0x1, 13 | Modified = 0x2 14 | } 15 | 16 | private string _text; 17 | 18 | public int Number { get; } 19 | 20 | public string Text 21 | { 22 | get { return _text; } 23 | set 24 | { 25 | _text = value ?? string.Empty; 26 | } 27 | } 28 | 29 | public CliLocFlag Flag { get; set; } 30 | 31 | public StringEntry(int number, string text, byte flag) 32 | { 33 | Number = number; 34 | _text = text; 35 | Flag = (CliLocFlag)flag; 36 | } 37 | 38 | public StringEntry(int number, string text, CliLocFlag flag) 39 | { 40 | Number = number; 41 | _text = text; 42 | Flag = flag; 43 | } 44 | 45 | // Razor 46 | private static readonly Regex _regEx = new Regex( 47 | @"~(\d+)[_\w]+~", 48 | RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.CultureInvariant); 49 | private string _fmtTxt; 50 | private static readonly object[] _args = { "", "", "", "", "", "", "", "", "", "", "" }; 51 | 52 | public string Format(params object[] args) 53 | { 54 | if (_fmtTxt == null) 55 | { 56 | _fmtTxt = _regEx.Replace(_text, "{$1}"); 57 | } 58 | 59 | for (int i = 0; i < args.Length && i < 10; i++) 60 | { 61 | _args[i + 1] = args[i]; 62 | } 63 | 64 | return string.Format(_fmtTxt, _args); 65 | } 66 | 67 | public string SplitFormat(string argString) 68 | { 69 | if (_fmtTxt == null) 70 | { 71 | _fmtTxt = _regEx.Replace(_text, "{$1}"); 72 | } 73 | 74 | string[] args = argString.Split('\t'); // adds an extra on to the args array 75 | 76 | for (int i = 0; i < args.Length && i < 10; i++) 77 | { 78 | _args[i + 1] = args[i]; 79 | } 80 | 81 | return string.Format(_fmtTxt, _args); 82 | } 83 | } 84 | } -------------------------------------------------------------------------------- /Ultima/Ultima.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net8.0-windows 4 | true 5 | true 6 | false 7 | Ultima SDK 8 | 4.3.2 9 | 4.3.2 10 | true 11 | 12 | 13 | true 14 | 15 | 16 | bin\$(Configuration)\ 17 | 4096 18 | portable 19 | 20 | 21 | bin\$(Configuration)\ 22 | 4096 23 | none 24 | Off 25 | 26 | -------------------------------------------------------------------------------- /Ultima/Verdata.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | /* 5 | FileIDs 6 | -------------- 7 | 0 - map0.mul 8 | 1 - staidx0.mul 9 | 2 - statics0.mul 10 | 3 - artidx.mul 11 | 4 - art.mul 12 | 5 - anim.idx 13 | 6 - anim.mul 14 | 7 - soundidx.mul 15 | 8 - sound.mul 16 | 9 - texidx.mul 17 | 10 - texmaps.mul 18 | 11 - gumpidx.mul 19 | 12 - gumpart.mul 20 | 13 - multi.idx 21 | 14 - multi.mul 22 | 15 - skills.idx 23 | 16 - skills.mul 24 | 30 - tiledata.mul 25 | 31 - animdata.mul 26 | */ 27 | 28 | namespace Ultima 29 | { 30 | public sealed class Verdata 31 | { 32 | public static Stream Stream { get; private set; } 33 | public static Entry5D[] Patches { get; private set; } 34 | 35 | private static string _path; 36 | 37 | static Verdata() 38 | { 39 | Initialize(); 40 | } 41 | 42 | public static void Initialize() 43 | { 44 | _path = Files.GetFilePath("verdata.mul"); 45 | if (_path == null) 46 | { 47 | Patches = Array.Empty(); 48 | Stream = Stream.Null; 49 | } 50 | else 51 | { 52 | using (Stream = new FileStream(_path, FileMode.Open, FileAccess.Read, FileShare.Read)) 53 | using (var bin = new BinaryReader(Stream)) 54 | { 55 | Patches = new Entry5D[bin.ReadInt32()]; 56 | 57 | for (int i = 0; i < Patches.Length; ++i) 58 | { 59 | Patches[i].File = bin.ReadInt32(); 60 | Patches[i].Index = bin.ReadInt32(); 61 | Patches[i].Lookup = bin.ReadInt32(); 62 | Patches[i].Length = bin.ReadInt32(); 63 | Patches[i].Extra = bin.ReadInt32(); 64 | } 65 | } 66 | 67 | Stream.Close(); 68 | } 69 | } 70 | 71 | public static void Seek(int lookup) 72 | { 73 | if ((Stream?.CanRead != true || !Stream.CanSeek) && _path != null) 74 | { 75 | Stream = new FileStream(_path, FileMode.Open, FileAccess.Read, FileShare.Read); 76 | } 77 | 78 | _ = Stream.Seek(lookup, SeekOrigin.Begin); 79 | } 80 | } 81 | 82 | public struct Entry5D 83 | { 84 | public int File; 85 | public int Index; 86 | public int Lookup; 87 | public int Length; 88 | public int Extra; 89 | } 90 | } -------------------------------------------------------------------------------- /Ultima/WaveFormat.cs: -------------------------------------------------------------------------------- 1 | namespace Ultima 2 | { 3 | public enum WaveFormat 4 | { 5 | PCM = 0x0001, 6 | MS_ADPCM = 0x0002, 7 | IEEE_FLOAT = 0x0003, 8 | IBM_CVSD = 0x0005, 9 | ALAW = 0x0006, 10 | MULAW = 0x0007, 11 | OKI_ADPCM = 0x0010, 12 | DVI_IMA_ADPCM = 0x0011, 13 | MEDIASPACE_ADPCM = 0x0012, 14 | SIERRA_ADPCM = 0x0013, 15 | G723_ADPCM = 0x0014, 16 | DIGISTD = 0x0015, 17 | DIGIFIX = 0x0016, 18 | DIALOGIC_OKI_ADPCM = 0x0017, 19 | YAMAHA_ADPCM = 0x0020, 20 | SONARC = 0x0021, 21 | DSPGROUP_TRUESPEECH = 0x0022, 22 | ECHOSC1 = 0x0023, 23 | AUDIOFILE_AF36 = 0x0024, 24 | APTX = 0x0025, 25 | AUDIOFILE_AF10 = 0x0026, 26 | DOLBY_AC2 = 0x0030, 27 | GSM610 = 0x0031, 28 | ANTEX_ADPCME = 0x0033, 29 | CONTROL_RES_VQLPC = 0x0034, 30 | CONTROL_RES_VQLPC2 = 0x0035, 31 | DIGIADPCM = 0x0036, 32 | CONTROL_RES_CR10 = 0x0037, 33 | NMS_VBXADPCM = 0x0038, 34 | CsImaadpcmRolandRdac = 0x0039, 35 | G721_ADPCM = 0x0040, 36 | Mpeg1LayerIIi = 0x0050, 37 | Mpeg1LayerIii = 0x0055, 38 | XboxAdpcm = 0x0069, 39 | CREATIVE_ADPCM = 0x0200, 40 | CREATIVE_FASTSPEECH8 = 0x0202, 41 | CREATIVE_FASTSPEECH10 = 0x0203, 42 | FM_TOWNS_SND = 0x0300, 43 | OLIGSM = 0x1000, 44 | OLIADPCM = 0x1001, 45 | OLICELP = 0x1002, 46 | OLISBC = 0x1003, 47 | OLIOPR = 0x1004, 48 | } 49 | } -------------------------------------------------------------------------------- /Ultima/WaveFormatException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Ultima 4 | { 5 | public class WaveFormatException : Exception 6 | { 7 | public WaveFormatException() 8 | { 9 | } 10 | 11 | public WaveFormatException(string message) : base(message) 12 | { 13 | } 14 | 15 | public WaveFormatException(string message, Exception innerException) : base(message, innerException) 16 | { 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Ultima/WindowProcessStream.cs: -------------------------------------------------------------------------------- 1 | namespace Ultima 2 | { 3 | public class WindowProcessStream : ProcessStream 4 | { 5 | private ClientWindowHandle _window; 6 | private ClientProcessHandle _processId; 7 | 8 | public ClientWindowHandle Window { get { return _window; } set { _window = value; } } 9 | 10 | public WindowProcessStream(ClientWindowHandle window) 11 | { 12 | _window = window; 13 | _processId = ClientProcessHandle.Invalid; 14 | } 15 | 16 | public override ClientProcessHandle ProcessID 17 | { 18 | get 19 | { 20 | if (NativeMethods.IsWindow(_window) != 0 && !_processId.IsInvalid) 21 | { 22 | return _processId; 23 | } 24 | 25 | NativeMethods.GetWindowThreadProcessId(_window, ref _processId); 26 | 27 | return _processId; 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Classes/AnimatedFrame.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Drawing; 13 | 14 | namespace UoFiddler.Controls.Classes 15 | { 16 | public sealed class AnimatedFrame(Bitmap bitmap, Point center) 17 | { 18 | public Point Center { get; set; } = center; 19 | public Bitmap Bitmap { get; set; } = bitmap; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Classes/ExportedAnimData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text.Json; 6 | using Ultima; 7 | using static Ultima.Animdata; 8 | 9 | namespace UoFiddler.Controls.Classes 10 | { 11 | using AnimDataDict = Dictionary; 12 | 13 | public enum ExportSelection 14 | { 15 | All = 0, 16 | IncludeMissingTileFlag = 1, 17 | OnlyValid = 2 18 | } 19 | 20 | public class ExportedAnimData 21 | { 22 | public static readonly int CurrentVersion = 1; 23 | public int Version { get; set; } 24 | public AnimDataDict Data { get; set; } 25 | 26 | public static ExportedAnimData FromFile(string fileName) 27 | { 28 | string jsonString = File.ReadAllText(fileName); 29 | 30 | var imported = JsonSerializer.Deserialize(jsonString) ?? 31 | throw new Exception("Imported null value."); 32 | 33 | if (imported.Version != CurrentVersion) 34 | { 35 | throw new InvalidOperationException($"Unexpected version {imported.Version}, expected {CurrentVersion}."); 36 | } 37 | 38 | return imported; 39 | } 40 | 41 | public static ExportedAnimData ToFile(string fileName, AnimDataDict entries, ExportSelection selection) 42 | { 43 | bool ExportSelector(int id) 44 | { 45 | if (Art.IsValidStatic(id)) 46 | { 47 | if (TileData.ItemTable[id].Flags.HasFlag(TileFlag.Animation) || selection == ExportSelection.IncludeMissingTileFlag) 48 | { 49 | return true; 50 | } 51 | } 52 | 53 | return selection == ExportSelection.All; 54 | } 55 | 56 | var data = new ExportedAnimData 57 | { 58 | Version = 1, 59 | Data = (from entry in entries where ExportSelector(entry.Key) select entry).ToDictionary() 60 | }; 61 | 62 | string jsonString = JsonSerializer.Serialize(data); 63 | 64 | File.WriteAllText(fileName, jsonString); 65 | 66 | return data; 67 | } 68 | 69 | public int UpdateAnimdata(AnimDataDict dst, bool overwrite) 70 | { 71 | int count = 0; 72 | foreach (var (id, entry) in Data) 73 | { 74 | if (overwrite) 75 | { 76 | dst[id] = entry; 77 | count++; 78 | } 79 | else if (dst.TryAdd(id, entry)) 80 | { 81 | count++; 82 | } 83 | } 84 | 85 | return count; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Classes/MyEventArgs.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | 14 | namespace UoFiddler.Controls.Classes 15 | { 16 | public sealed class MyEventArgs : EventArgs 17 | { 18 | public enum Types 19 | { 20 | Common = 0, 21 | ForceReload 22 | } 23 | 24 | public Types Type { get; } 25 | 26 | public MyEventArgs(Types type) { Type = type; } 27 | } 28 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Classes/SearchHelper.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System; 13 | using System.Text.RegularExpressions; 14 | using UoFiddler.Controls.Helpers; 15 | 16 | namespace UoFiddler.Controls.Classes 17 | { 18 | public static class SearchHelper 19 | { 20 | public static Func GetSearchMethod(bool useRegex = false) 21 | { 22 | return useRegex 23 | ? (Func)FindEntryWithRegex 24 | : FindEntryUsingStringComparison; 25 | } 26 | 27 | private static SearchResult FindEntryUsingStringComparison(string pattern, string input) 28 | { 29 | var found = !string.IsNullOrEmpty(input) && input.ContainsCaseInsensitive(pattern); 30 | 31 | return new SearchResult(found); 32 | } 33 | 34 | private static SearchResult FindEntryWithRegex(string pattern, string input) 35 | { 36 | if (string.IsNullOrEmpty(pattern)) 37 | { 38 | return new SearchResult(false); 39 | } 40 | try 41 | { 42 | var regex = new Regex(pattern, RegexOptions.IgnoreCase); 43 | return new SearchResult(regex.IsMatch(input)); 44 | } 45 | catch 46 | { 47 | return new SearchResult(false, true); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Classes/SearchResult.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | namespace UoFiddler.Controls.Classes 13 | { 14 | public sealed class SearchResult 15 | { 16 | public bool EntryFound { get; } 17 | public bool HasErrors { get; } 18 | 19 | public SearchResult(bool entryFound, bool hasErrors = false) 20 | { 21 | EntryFound = entryFound; 22 | HasErrors = hasErrors; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/AnimDataExportForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | using UoFiddler.Controls.Classes; 5 | using static Ultima.Animdata; 6 | 7 | namespace UoFiddler.Controls.Forms 8 | { 9 | public partial class AnimDataExportForm : Form 10 | { 11 | public AnimDataExportForm() 12 | { 13 | InitializeComponent(); 14 | cboExportSelection.DataSource = new List { 15 | "All (default-, blue-, and red-colored entries)", 16 | "Include missing animation tile flag (default- and blue-colored entries)", 17 | "Only valid animations (default-colored entries)" 18 | }; 19 | } 20 | 21 | private void OnClickExport(object sender, EventArgs e) 22 | { 23 | var type = "json"; 24 | 25 | using SaveFileDialog dialog = new() 26 | { 27 | CheckPathExists = true, 28 | Title = "Choose the file to export to", 29 | FileName = $"animdata-{DateTime.Now:yyyyMMddHHmm}.json", 30 | InitialDirectory = Options.OutputPath, 31 | Filter = string.Format("{0} file (*.{0})|*.{0}", type) 32 | }; 33 | 34 | if (dialog.ShowDialog() != DialogResult.OK || dialog.FileName == "") 35 | { 36 | return; 37 | } 38 | 39 | try 40 | { 41 | var selection = cboExportSelection.SelectedIndex switch 42 | { 43 | 0 => ExportSelection.All, 44 | 1 => ExportSelection.IncludeMissingTileFlag, 45 | 2 => ExportSelection.OnlyValid, 46 | _ => ExportSelection.All 47 | }; 48 | 49 | var exported = ExportedAnimData.ToFile(dialog.FileName, AnimData, selection); 50 | 51 | MessageBox.Show($"Exported {exported.Data.Count} animdata entries to: {dialog.FileName}"); 52 | } 53 | catch (Exception ex) 54 | { 55 | MessageBox.Show($"Error exporting animdata: {ex.Message}", "AnimData Export", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/AnimDataImportForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | using UoFiddler.Controls.Classes; 5 | using static Ultima.Animdata; 6 | 7 | namespace UoFiddler.Controls.Forms 8 | { 9 | public partial class AnimDataImportForm : Form 10 | { 11 | public Action OnAfterImport { get; set; } 12 | public AnimDataImportForm() 13 | { 14 | InitializeComponent(); 15 | cboConflictAction.SelectedItem = "skip"; 16 | } 17 | 18 | private void OnClickImport(object sender, EventArgs e) 19 | { 20 | try 21 | { 22 | var fileName = txtImportFileName.Text; 23 | var imported = ExportedAnimData.FromFile(fileName); 24 | var overwrite = cboConflictAction.Items[cboConflictAction.SelectedIndex].ToString() == "overwrite"; 25 | 26 | // Create a new "working copy" AnimData to update, in case there's an exception thrown while processing. 27 | // Shallow clone is okay, as UpdateAnimdata does not modify existing entries' members. 28 | var workingAnimData = cbErase.Checked ? [] : new Dictionary(AnimData); 29 | int importCount = imported.UpdateAnimdata(workingAnimData, overwrite); 30 | 31 | // Since everything processed, set AnimData 32 | AnimData = workingAnimData; 33 | Options.ChangedUltimaClass["Animdata"] = true; 34 | 35 | try 36 | { 37 | OnAfterImport?.Invoke(); 38 | } 39 | catch 40 | { 41 | // Swallow any error from the OnAfterImport callback 42 | } 43 | 44 | MessageBox.Show($"Imported {importCount} animdata entries from: {fileName}\n\nDo not forget to save your changes!", "AnimData Import"); 45 | } 46 | catch (Exception ex) 47 | { 48 | MessageBox.Show($"Error importing animdata: {ex.Message}", "AnimData Import", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); 49 | } 50 | } 51 | 52 | private void OnClickBrowse(object sender, EventArgs e) 53 | { 54 | var type = "json"; 55 | 56 | using OpenFileDialog dialog = new() 57 | { 58 | Multiselect = false, 59 | Title = $"Choose {type} file to import", 60 | CheckFileExists = true, 61 | Filter = string.Format("{0} file (*.{0})|*.{0}", type) 62 | }; 63 | 64 | if (dialog.ShowDialog() == DialogResult.OK) 65 | { 66 | txtImportFileName.Text = dialog.FileName; 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/ClilocAddForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Controls.Forms 17 | { 18 | public partial class ClilocAddForm : Form 19 | { 20 | private readonly Func _isNumberFreeAction; 21 | private readonly Action _addEntryAction; 22 | 23 | public ClilocAddForm(Func isNumberFreeAction, Action addEntryAction) 24 | { 25 | InitializeComponent(); 26 | 27 | Icon = Options.GetFiddlerIcon(); 28 | TopMost = true; 29 | 30 | _isNumberFreeAction = isNumberFreeAction; 31 | _addEntryAction = addEntryAction; 32 | } 33 | 34 | private void OnClickAdd(object sender, EventArgs e) 35 | { 36 | if (int.TryParse(NumberBox.Text, System.Globalization.NumberStyles.Integer, null, out int number)) 37 | { 38 | if (_isNumberFreeAction(number)) 39 | { 40 | _addEntryAction(number); 41 | 42 | Close(); 43 | } 44 | else 45 | { 46 | MessageBox.Show("Number not free.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, 47 | MessageBoxDefaultButton.Button1); 48 | } 49 | } 50 | else 51 | { 52 | MessageBox.Show("Error reading Number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, 53 | MessageBoxDefaultButton.Button1); 54 | } 55 | } 56 | 57 | private void OnClickCancel(object sender, EventArgs e) 58 | { 59 | Close(); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/ClilocAddForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/ClilocDetailForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Controls.Forms 17 | { 18 | public partial class ClilocDetailForm : Form 19 | { 20 | private readonly int _number; 21 | private readonly Action _saveEntryAction; 22 | 23 | public ClilocDetailForm(int number, string text, Action saveEntryAction) 24 | { 25 | InitializeComponent(); 26 | 27 | Icon = Options.GetFiddlerIcon(); 28 | TopMost = true; 29 | NumberLabel.Text = $"Nr: {number}"; 30 | TextBox.AppendText(text); 31 | 32 | _number = number; 33 | _saveEntryAction = saveEntryAction; 34 | } 35 | 36 | private void OnClickSave(object sender, EventArgs e) 37 | { 38 | _saveEntryAction(_number, TextBox.Text); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/FontOffsetForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using Ultima; 15 | using UoFiddler.Controls.Classes; 16 | 17 | namespace UoFiddler.Controls.Forms 18 | { 19 | public partial class FontOffsetForm : Form 20 | { 21 | private readonly int _font; 22 | private readonly int _char; 23 | 24 | public FontOffsetForm(int font, int ch) 25 | { 26 | InitializeComponent(); 27 | Icon = Options.GetFiddlerIcon(); 28 | CharLabel.Text = $"Character: '{(char)ch}' 0x{ch:X}"; 29 | offsetx.Value = UnicodeFonts.Fonts[font].Chars[ch].XOffset; 30 | offsety.Value = UnicodeFonts.Fonts[font].Chars[ch].YOffset; 31 | _font = font; 32 | _char = ch; 33 | } 34 | 35 | private void OnClickOK(object sender, EventArgs e) 36 | { 37 | UnicodeFonts.Fonts[_font].Chars[_char].XOffset = (sbyte)offsetx.Value; 38 | UnicodeFonts.Fonts[_font].Chars[_char].YOffset = (sbyte)offsety.Value; 39 | 40 | Close(); 41 | } 42 | 43 | private void OnClickCancel(object sender, EventArgs e) 44 | { 45 | Close(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/FontOffsetForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/FontTextForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Drawing; 14 | using System.Windows.Forms; 15 | using Ultima; 16 | using UoFiddler.Controls.Classes; 17 | 18 | namespace UoFiddler.Controls.Forms 19 | { 20 | public partial class FontTextForm : Form 21 | { 22 | private readonly int _type; 23 | private readonly int _font; 24 | 25 | public FontTextForm(int type, int font) 26 | { 27 | InitializeComponent(); 28 | Icon = Options.GetFiddlerIcon(); 29 | TopMost = true; 30 | _type = type; 31 | _font = font; 32 | pictureBox1.BackColor = Color.White; 33 | Text = _type == 1 34 | ? $"Unicode Font: {font}" 35 | : $"ASCII Font: {font}"; 36 | } 37 | 38 | private void OnTextChange(object sender, EventArgs e) 39 | { 40 | pictureBox1.Image = _type == 1 41 | ? UnicodeFonts.WriteText(_font, textBox1.Text) 42 | : AsciiText.DrawText(_font, textBox1.Text); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/FontTextForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/HuePopUpDress.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Controls.Forms 17 | { 18 | public partial class HuePopUpDress : Form 19 | { 20 | private readonly Action _changeHueAction; 21 | 22 | public HuePopUpDress(Action changeHueAction, int hue) 23 | { 24 | InitializeComponent(); 25 | 26 | Icon = Options.GetFiddlerIcon(); 27 | 28 | control.HuesEditable = false; 29 | 30 | _changeHueAction = changeHueAction; 31 | 32 | if ((hue & 0x8000) != 0) 33 | { 34 | hue ^= 0x8000; 35 | HueOnlyGray.Checked = true; 36 | } 37 | 38 | if (hue >= 0) 39 | { 40 | control.Selected = hue - 1; 41 | } 42 | } 43 | 44 | private void Click_OK(object sender, EventArgs e) 45 | { 46 | int selected = control.Selected + 1; 47 | 48 | if (HueOnlyGray.Checked) 49 | { 50 | selected ^= 0x8000; 51 | } 52 | 53 | _changeHueAction(selected); 54 | 55 | Close(); 56 | } 57 | 58 | private void OnClick_Clear(object sender, EventArgs e) 59 | { 60 | _changeHueAction(-1); 61 | 62 | Close(); 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/HuePopUpForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Controls.Forms 17 | { 18 | public partial class HuePopUpForm : Form 19 | { 20 | private readonly Action _changeHueAction; 21 | 22 | public HuePopUpForm(Action changeHueAction, int hue) 23 | { 24 | InitializeComponent(); 25 | 26 | Icon = Options.GetFiddlerIcon(); 27 | 28 | control.HuesEditable = false; 29 | 30 | _changeHueAction = changeHueAction; 31 | 32 | if ((hue & 0x8000) != 0) 33 | { 34 | hue ^= 0x8000; 35 | HueOnlyGray.Checked = true; 36 | } 37 | 38 | if (hue != 0) 39 | { 40 | control.Selected = hue; 41 | } 42 | } 43 | 44 | private void Click_OK(object sender, EventArgs e) 45 | { 46 | int selected = control.Selected; 47 | if (HueOnlyGray.Checked) 48 | { 49 | selected ^= 0x8000; 50 | } 51 | 52 | _changeHueAction(selected); 53 | 54 | Close(); 55 | } 56 | 57 | private void OnClick_Clear(object sender, EventArgs e) 58 | { 59 | _changeHueAction(-1); 60 | 61 | Close(); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/HuePopUpItemForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Controls.Forms 17 | { 18 | public partial class HuePopUpItemForm : Form 19 | { 20 | private readonly Action _updateSelectedHueAction; 21 | 22 | public HuePopUpItemForm(Action updateSelectedHueAction, int hue) 23 | { 24 | InitializeComponent(); 25 | 26 | Icon = Options.GetFiddlerIcon(); 27 | 28 | control.HuesEditable = false; 29 | 30 | if (hue >= 0) 31 | { 32 | control.Selected = hue; 33 | } 34 | 35 | _updateSelectedHueAction = updateSelectedHueAction; 36 | } 37 | 38 | private void Click_OK(object sender, EventArgs e) 39 | { 40 | _updateSelectedHueAction(control.Selected); 41 | 42 | Hide(); 43 | } 44 | 45 | private void OnClick_Clear(object sender, EventArgs e) 46 | { 47 | _updateSelectedHueAction(-1); 48 | 49 | Hide(); 50 | } 51 | 52 | public void SetHue(int hue) 53 | { 54 | control.Selected = hue; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapClearStaticsForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Controls.Forms 17 | { 18 | public partial class MapClearStaticsForm : Form 19 | { 20 | private readonly Action _refreshMap; 21 | private readonly Ultima.Map _map; 22 | 23 | public MapClearStaticsForm(Action refreshMap, Ultima.Map map) 24 | { 25 | InitializeComponent(); 26 | 27 | Icon = Options.GetFiddlerIcon(); 28 | 29 | _refreshMap = refreshMap; 30 | _map = map; 31 | 32 | numericUpDownX1.Maximum = map.Width; 33 | numericUpDownX2.Maximum = map.Width; 34 | numericUpDownY1.Maximum = map.Height; 35 | numericUpDownY2.Maximum = map.Height; 36 | } 37 | 38 | private void OnClickClear(object sender, EventArgs e) 39 | { 40 | int blockX1 = (int)numericUpDownX1.Value; 41 | int blockX2 = (int)numericUpDownX2.Value; 42 | 43 | int blockY1 = (int)numericUpDownY1.Value; 44 | int blockY2 = (int)numericUpDownY2.Value; 45 | 46 | int temp; 47 | 48 | if (blockX1 > blockX2) 49 | { 50 | temp = blockX1; 51 | 52 | blockX1 = blockX2; 53 | blockX2 = temp; 54 | } 55 | 56 | if (blockY1 > blockY2) 57 | { 58 | temp = blockY1; 59 | 60 | blockY1 = blockY2; 61 | blockY2 = temp; 62 | } 63 | 64 | blockX1 >>= 3; 65 | blockX2 >>= 3; 66 | 67 | blockY1 >>= 3; 68 | blockY2 >>= 3; 69 | 70 | for (int x = blockX1; x <= blockX2; ++x) 71 | { 72 | for (int y = blockY1; y <= blockY2; ++y) 73 | { 74 | //HuedTile[][][] tiles = _map.Tiles.GetStaticBlock(x, y, false); // TODO: unused variable? do we need to call GetStaticBlock() here? 75 | _map.Tiles.RemoveStaticBlock(x, y); 76 | } 77 | } 78 | 79 | _map.ResetCache(); 80 | 81 | MessageBox.Show("Done", "Clear Static", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); 82 | 83 | _refreshMap(); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapClearStaticsForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapDetailsForm.Designer.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | namespace UoFiddler.Controls.Forms 13 | { 14 | partial class MapDetailsForm 15 | { 16 | /// 17 | /// Required designer variable. 18 | /// 19 | private System.ComponentModel.IContainer components = null; 20 | 21 | /// 22 | /// Clean up any resources being used. 23 | /// 24 | /// true if managed resources should be disposed; otherwise, false. 25 | protected override void Dispose(bool disposing) 26 | { 27 | if (disposing && (components != null)) 28 | { 29 | components.Dispose(); 30 | } 31 | base.Dispose(disposing); 32 | } 33 | 34 | #region Windows Form Designer generated code 35 | 36 | /// 37 | /// Required method for Designer support - do not modify 38 | /// the contents of this method with the code editor. 39 | /// 40 | private void InitializeComponent() 41 | { 42 | this.richTextBox = new System.Windows.Forms.RichTextBox(); 43 | this.SuspendLayout(); 44 | // 45 | // richTextBox 46 | // 47 | this.richTextBox.DetectUrls = false; 48 | this.richTextBox.Dock = System.Windows.Forms.DockStyle.Fill; 49 | this.richTextBox.Location = new System.Drawing.Point(0, 0); 50 | this.richTextBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 51 | this.richTextBox.Name = "richTextBox"; 52 | this.richTextBox.ReadOnly = true; 53 | this.richTextBox.Size = new System.Drawing.Size(344, 301); 54 | this.richTextBox.TabIndex = 0; 55 | this.richTextBox.Text = ""; 56 | // 57 | // MapDetailsForm 58 | // 59 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 60 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 61 | this.ClientSize = new System.Drawing.Size(344, 301); 62 | this.Controls.Add(this.richTextBox); 63 | this.DoubleBuffered = true; 64 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; 65 | this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 66 | this.Name = "MapDetailsForm"; 67 | this.Text = "MapDetails"; 68 | this.ResumeLayout(false); 69 | 70 | } 71 | 72 | #endregion 73 | 74 | private System.Windows.Forms.RichTextBox richTextBox; 75 | } 76 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapDetailsForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System.Drawing; 13 | using System.Windows.Forms; 14 | using Ultima; 15 | using UoFiddler.Controls.Classes; 16 | 17 | namespace UoFiddler.Controls.Forms 18 | { 19 | public partial class MapDetailsForm : Form 20 | { 21 | public MapDetailsForm(Map currentMap, Point point) 22 | { 23 | InitializeComponent(); 24 | 25 | Icon = Options.GetFiddlerIcon(); 26 | TopMost = true; 27 | 28 | Tile currentTile = currentMap.Tiles.GetLandTile(point.X, point.Y); 29 | richTextBox.AppendText($"X: {point.X} Y: {point.Y}\n\n"); 30 | richTextBox.AppendText("LandTile:\n"); 31 | richTextBox.AppendText($"{TileData.LandTable[currentTile.Id].Name}: 0x{currentTile.Id:X} Altitude: {currentTile.Z}\n\n"); 32 | HuedTile[] staticsAtPoint = currentMap.Tiles.GetStaticTiles(point.X, point.Y); 33 | richTextBox.AppendText("Statics:\n"); 34 | foreach (HuedTile @static in staticsAtPoint) 35 | { 36 | ushort id = @static.Id; 37 | richTextBox.AppendText($"{TileData.ItemTable[id].Name}: 0x{id:X} Hue: {@static.Hue} Altitude: {@static.Z}\n"); 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapDetailsForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapDiffInsertForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapMarkerForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Drawing; 14 | using System.Windows.Forms; 15 | using UoFiddler.Controls.Classes; 16 | 17 | namespace UoFiddler.Controls.Forms 18 | { 19 | public partial class MapMarkerForm : Form 20 | { 21 | private readonly Action _addOverlayAction; 22 | private static Color _lastColor = Color.FromArgb(180, Color.Yellow); 23 | 24 | public MapMarkerForm(Action addOverlayAction, int x, int y, int map) 25 | { 26 | InitializeComponent(); 27 | Icon = Options.GetFiddlerIcon(); 28 | 29 | _addOverlayAction = addOverlayAction; 30 | 31 | numericUpDown1.Value = x; 32 | numericUpDown2.Value = y; 33 | 34 | comboBox1.Items.AddRange(Options.MapNames); 35 | comboBox1.SelectedIndex = map; 36 | 37 | pictureBox1.BackColor = _lastColor; 38 | } 39 | 40 | private void OnClickColor(object sender, EventArgs e) 41 | { 42 | if (colorDialog1.ShowDialog() != DialogResult.Cancel) 43 | { 44 | _lastColor = pictureBox1.BackColor = colorDialog1.Color; 45 | } 46 | } 47 | 48 | private void OnClickSave(object sender, EventArgs e) 49 | { 50 | _addOverlayAction( 51 | (int)numericUpDown1.Value, 52 | (int)numericUpDown2.Value, 53 | comboBox1.SelectedIndex, 54 | pictureBox1.BackColor, 55 | textBox1.Text); 56 | 57 | Close(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapMeltStaticsForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MapReplaceForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MultiImportForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.IO; 14 | using System.Windows.Forms; 15 | using Ultima; 16 | using UoFiddler.Controls.Classes; 17 | 18 | namespace UoFiddler.Controls.Forms 19 | { 20 | public partial class MultiImportForm : Form 21 | { 22 | private readonly int _id; 23 | private readonly Action _changeMultiAction; 24 | 25 | public MultiImportForm(int id, Action changeMultiAction) 26 | { 27 | InitializeComponent(); 28 | Icon = Options.GetFiddlerIcon(); 29 | 30 | _id = id; 31 | _changeMultiAction = changeMultiAction; 32 | 33 | importTypeComboBox.SelectedIndex = 0; 34 | } 35 | 36 | private void OnClickBrowse(object sender, EventArgs e) 37 | { 38 | using (OpenFileDialog dialog = new OpenFileDialog { Multiselect = false }) 39 | { 40 | string type = "txt"; 41 | 42 | switch (importTypeComboBox.SelectedIndex) 43 | { 44 | case 0: 45 | type = "txt"; 46 | break; 47 | case 1: 48 | type = "uoa"; 49 | break; 50 | case 2: 51 | type = "uoab"; 52 | break; 53 | case 3: 54 | type = "wsc"; 55 | break; 56 | case 4: 57 | type = "csv"; 58 | break; 59 | } 60 | 61 | dialog.Title = $"Choose {type} file to import"; 62 | dialog.CheckFileExists = true; 63 | dialog.Filter = type == "uoab" ? "{0} file (*.uoa)|*.uoa" : string.Format("{0} file (*.{0})|*.{0}", type); 64 | 65 | if (dialog.ShowDialog() == DialogResult.OK) 66 | { 67 | filenameTextBox.Text = dialog.FileName; 68 | } 69 | } 70 | } 71 | 72 | private void OnClickImport(object sender, EventArgs e) 73 | { 74 | if (!File.Exists(filenameTextBox.Text)) 75 | { 76 | return; 77 | } 78 | 79 | Multis.ImportType type = (Multis.ImportType)importTypeComboBox.SelectedIndex; 80 | MultiComponentList multi = Multis.ImportFromFile(_id, filenameTextBox.Text, type); 81 | 82 | _changeMultiAction(_id, multi); 83 | 84 | Options.ChangedUltimaClass["Multis"] = true; 85 | 86 | Close(); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/MultiImportForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/ProgressBarDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace UoFiddler.Controls.Forms 2 | { 3 | partial class ProgressBarDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.progressBar = new System.Windows.Forms.ProgressBar(); 32 | this.SuspendLayout(); 33 | // 34 | // progressBar 35 | // 36 | this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 37 | | System.Windows.Forms.AnchorStyles.Left) 38 | | System.Windows.Forms.AnchorStyles.Right))); 39 | this.progressBar.Location = new System.Drawing.Point(14, 14); 40 | this.progressBar.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 41 | this.progressBar.Name = "progressBar"; 42 | this.progressBar.Size = new System.Drawing.Size(307, 24); 43 | this.progressBar.TabIndex = 0; 44 | // 45 | // ProgressBarDialog 46 | // 47 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 49 | this.ClientSize = new System.Drawing.Size(334, 51); 50 | this.Controls.Add(this.progressBar); 51 | this.DoubleBuffered = true; 52 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 53 | this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 54 | this.Name = "ProgressBarDialog"; 55 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 56 | this.Text = "ProcessBar"; 57 | this.ResumeLayout(false); 58 | 59 | } 60 | 61 | #endregion 62 | 63 | private System.Windows.Forms.ProgressBar progressBar; 64 | } 65 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/ProgressBarDialog.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System.Windows.Forms; 13 | 14 | namespace UoFiddler.Controls.Forms 15 | { 16 | public partial class ProgressBarDialog : Form 17 | { 18 | public ProgressBarDialog() 19 | { 20 | InitializeComponent(); 21 | 22 | SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); 23 | } 24 | 25 | public ProgressBarDialog(int max, string desc, bool useFileSaveEvent = true) 26 | { 27 | InitializeComponent(); 28 | Text = desc; 29 | progressBar.Maximum = max; 30 | progressBar.Minimum = 0; 31 | progressBar.Value = 0; 32 | progressBar.Step = 1; 33 | if (useFileSaveEvent) 34 | { 35 | Ultima.Files.FileSaveEvent += OnChangeEvent; 36 | } 37 | else 38 | { 39 | Classes.ControlEvents.ProgressChangeEvent += OnChangeEvent; 40 | } 41 | 42 | Show(); 43 | } 44 | 45 | private void OnChangeEvent() 46 | { 47 | progressBar.PerformStep(); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Forms/ProgressBarDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Helpers/FormsDesignerHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace UoFiddler.Controls.Helpers 4 | { 5 | public static class FormsDesignerHelper 6 | { 7 | public static bool IsInDesignMode() 8 | { 9 | return Application.ProductName.Contains("Visual Studio"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Helpers/RichTextBoxExtensions.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System.Windows.Forms; 13 | 14 | namespace UoFiddler.Controls.Helpers 15 | { 16 | public static class RichTextBoxExtensions 17 | { 18 | public static void AddBasicContextMenu(this RichTextBox richTextBox) 19 | { 20 | if (richTextBox.ContextMenuStrip != null) 21 | { 22 | return; 23 | } 24 | 25 | ContextMenuStrip menuStrip = new ContextMenuStrip { ShowImageMargin = false }; 26 | 27 | ToolStripMenuItem menuItemCopy = new ToolStripMenuItem("Copy"); 28 | menuItemCopy.Click += (sender, e) => richTextBox.Copy(); 29 | menuStrip.Items.Add(menuItemCopy); 30 | 31 | menuStrip.Items.Add(new ToolStripSeparator()); 32 | 33 | ToolStripMenuItem menuItemSelectAll = new ToolStripMenuItem("Select All"); 34 | menuItemSelectAll.Click += (sender, e) => richTextBox.SelectAll(); 35 | menuStrip.Items.Add(menuItemSelectAll); 36 | 37 | menuStrip.Opening += (sender, cancelEventArgs) => 38 | { 39 | menuItemCopy.Enabled = richTextBox.SelectionLength > 0; 40 | menuItemSelectAll.Enabled = richTextBox.TextLength > 0 && richTextBox.SelectionLength < richTextBox.TextLength; 41 | }; 42 | 43 | richTextBox.ContextMenuStrip = menuStrip; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Helpers/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | 14 | namespace UoFiddler.Controls.Helpers 15 | { 16 | internal static class StringExtensions 17 | { 18 | public static bool ContainsCaseInsensitive(this string haystack, string needle) 19 | { 20 | return haystack.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Helpers/ThrowIf.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | 14 | namespace UoFiddler.Controls.Helpers 15 | { 16 | public static class ThrowIf 17 | { 18 | public static class Argument 19 | { 20 | public static void IsNull(object argument, string argumentName) 21 | { 22 | if (argument == null) 23 | { 24 | throw new ArgumentNullException(argumentName); 25 | } 26 | } 27 | 28 | public static void IsNullOrEmptyString(string argument, string argumentName) 29 | { 30 | IsNull(argument, argumentName); 31 | 32 | if (string.IsNullOrWhiteSpace(argument)) 33 | { 34 | throw new ArgumentException("String cannot be empty", argumentName); 35 | } 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Helpers/TreeViewExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Forms; 4 | 5 | namespace UoFiddler.Controls.Helpers 6 | { 7 | internal static class TreeViewExtensions 8 | { 9 | [DllImport("USER32", EntryPoint = "SendMessage", CharSet = CharSet.Auto, SetLastError = true)] 10 | public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); 11 | 12 | [DllImport("USER32", EntryPoint = "SendMessage", CharSet = CharSet.Auto, SetLastError = true)] 13 | public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, string lParam); 14 | 15 | public const int TvmGetEditControl = 0x110F; 16 | public const int WmSetText = 0xC; 17 | 18 | public static void SetEditText(this TreeView treeView, string name) 19 | { 20 | IntPtr editHandle = SendMessage(treeView.Handle, TvmGetEditControl, IntPtr.Zero, IntPtr.Zero); 21 | if (editHandle != IntPtr.Zero) 22 | { 23 | SendMessage(editHandle, WmSetText, IntPtr.Zero, name); 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Plugin/AvailablePlugin.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | 14 | namespace UoFiddler.Controls.Plugin 15 | { 16 | /// 17 | /// Data Class for Available Plugin. 18 | /// 19 | public class AvailablePlugin 20 | { 21 | public bool Loaded { get; private set; } 22 | 23 | public Type Type { get; set; } 24 | 25 | public PluginBase Instance { get; set; } 26 | 27 | public string AssemblyPath { get; set; } = ""; 28 | 29 | public void CreateInstance() 30 | { 31 | Instance = (PluginBase)Activator.CreateInstance(Type); 32 | Loaded = true; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Plugin/AvailablePlugins.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | namespace UoFiddler.Controls.Plugin 13 | { 14 | /// 15 | /// Collection for AvailablePlugin Type 16 | /// 17 | public class AvailablePlugins : System.Collections.CollectionBase 18 | { 19 | /// 20 | /// Add a Plugin to the collection of Available plugins 21 | /// 22 | /// The Plugin to Add 23 | public void Add(AvailablePlugin pluginToAdd) 24 | { 25 | List.Add(pluginToAdd); 26 | } 27 | 28 | /// 29 | /// Remove a Plugin to the collection of Available plugins 30 | /// 31 | /// The Plugin to Remove 32 | public void Remove(AvailablePlugin pluginToRemove) 33 | { 34 | List.Remove(pluginToRemove); 35 | } 36 | 37 | /// 38 | /// Finds a plugin in the available Plugins 39 | /// 40 | /// The name or File path of the plugin to find 41 | /// Available Plugin, or null if the plugin is not found 42 | public AvailablePlugin Find(string pluginNameOrPath) 43 | { 44 | AvailablePlugin toReturn = null; 45 | foreach (AvailablePlugin pluginOn in List) 46 | { 47 | if (pluginOn.Instance.Name.Equals(pluginNameOrPath) || 48 | pluginOn.AssemblyPath.Equals(pluginNameOrPath)) 49 | { 50 | toReturn = pluginOn; 51 | break; 52 | } 53 | } 54 | return toReturn; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Plugin/GlobalPlugins.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | namespace UoFiddler.Controls.Plugin 13 | { 14 | public static class GlobalPlugins 15 | { 16 | public static readonly PluginServices Plugins = new PluginServices(); 17 | } 18 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Plugin/Interfaces/IPluginHost.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using UoFiddler.Controls.UserControls; 13 | using UoFiddler.Controls.UserControls.TileView; 14 | 15 | namespace UoFiddler.Controls.Plugin.Interfaces 16 | { 17 | public interface IPluginHost 18 | { 19 | /// 20 | /// Returns the ItemsControl 21 | /// 22 | /// 23 | ItemsControl GetItemsControl(); 24 | 25 | /// 26 | /// Gets the TileView of ItemsControl 27 | /// 28 | /// 29 | TileViewControl GetItemsControlTileView(); 30 | 31 | /// 32 | /// Gets the current selected graphic id in ItemsControl 33 | /// 34 | /// Graphic id or -1 if none selected 35 | int GetSelectedIdFromItemsControl(); 36 | } 37 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Plugin/PluginBase.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System.Windows.Forms; 13 | using UoFiddler.Controls.Plugin.Interfaces; 14 | 15 | namespace UoFiddler.Controls.Plugin 16 | { 17 | public abstract class PluginBase 18 | { 19 | public abstract IPluginHost Host { get; set; } 20 | 21 | public abstract string Name { get; } 22 | public abstract string Description { get; } 23 | public abstract string Author { get; } 24 | public abstract string Version { get; } 25 | 26 | public abstract void Initialize(); 27 | public abstract void Unload(); 28 | 29 | /// 30 | /// On Startup called to modify the Plugin ToolStripDropDownButton 31 | /// 32 | /// 33 | public virtual void ModifyPluginToolStrip(ToolStripDropDownButton toolStrip) { } 34 | 35 | /// 36 | /// On Startup called to modify the tab pages 37 | /// 38 | /// 39 | public virtual void ModifyTabPages(TabControl tabControl) { } 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /UoFiddler.Controls/Plugin/PluginEvents.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System.Windows.Forms; 13 | 14 | namespace UoFiddler.Controls.Plugin 15 | { 16 | public static class PluginEvents 17 | { 18 | /// 19 | /// OnLoad called in ItemsControl to modify Contextmenu 20 | /// 21 | /// 22 | public delegate void ModifyItemsControlContextMenuHandler(ContextMenuStrip contextmenu); 23 | 24 | /// 25 | /// OnLoad called in ItemsControl to modify Contextmenu 26 | /// 27 | public static event ModifyItemsControlContextMenuHandler ModifyItemsControlContextMenuEvent; 28 | 29 | public static void FireModifyItemShowContextMenuEvent(ContextMenuStrip contextmenu) 30 | { 31 | ModifyItemsControlContextMenuEvent?.Invoke(contextmenu); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /UoFiddler.Controls/Resources/emptySquare.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Controls/Resources/emptySquare.jpg -------------------------------------------------------------------------------- /UoFiddler.Controls/Resources/fullSquare.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Controls/Resources/fullSquare.jpg -------------------------------------------------------------------------------- /UoFiddler.Controls/Resources/mouse.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Controls/Resources/mouse.bmp -------------------------------------------------------------------------------- /UoFiddler.Controls/Resources/padlock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Controls/Resources/padlock.jpg -------------------------------------------------------------------------------- /UoFiddler.Controls/Resources/staticPlayButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Controls/Resources/staticPlayButton.png -------------------------------------------------------------------------------- /UoFiddler.Controls/UserControls/CollapsibleSplitter.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace UoFiddler.Controls.UserControls 2 | { 3 | partial class CollapsibleSplitter 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | this.ResumeLayout(false); 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UoFiddler.Controls/UserControls/ListViewWithScrollbar.Designer.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | namespace UoFiddler.Controls.UserControls 13 | { 14 | partial class ListViewWithScrollbar 15 | { 16 | /// 17 | /// Required designer variable. 18 | /// 19 | private System.ComponentModel.IContainer components = null; 20 | 21 | /// 22 | /// Clean up any resources being used. 23 | /// 24 | /// true if managed resources should be disposed; otherwise, false. 25 | protected override void Dispose(bool disposing) 26 | { 27 | if (disposing && (components != null)) 28 | { 29 | components.Dispose(); 30 | } 31 | base.Dispose(disposing); 32 | } 33 | 34 | #region Component Designer generated code 35 | 36 | /// 37 | /// Required method for Designer support - do not modify 38 | /// the contents of this method with the code editor. 39 | /// 40 | private void InitializeComponent() 41 | { 42 | components = new System.ComponentModel.Container(); 43 | } 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /UoFiddler.Controls/UserControls/ListViewWithScrollbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Forms; 4 | 5 | namespace UoFiddler.Controls.UserControls 6 | { 7 | public partial class ListViewWithScrollbar : ListView 8 | { 9 | private const int WS_HSCROLL = 0x00100000; 10 | private const int SB_HORZ = 0; 11 | 12 | public ListViewWithScrollbar() 13 | { 14 | InitializeComponent(); 15 | } 16 | 17 | protected override CreateParams CreateParams 18 | { 19 | get 20 | { 21 | CreateParams cp = base.CreateParams; 22 | cp.Style |= WS_HSCROLL; // Always show the horizontal scrollbar 23 | return cp; 24 | } 25 | } 26 | 27 | private const int WM_NCCALCSIZE = 0x0083; 28 | 29 | protected override void WndProc(ref Message m) 30 | { 31 | if (m.Msg == WM_NCCALCSIZE) 32 | { 33 | ShowScrollBar(this.Handle, SB_HORZ, true); 34 | } 35 | base.WndProc(ref m); 36 | 37 | } 38 | 39 | [DllImport("user32.dll", SetLastError = true)] 40 | private static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex); 41 | 42 | [DllImport("user32.dll", SetLastError = true)] 43 | private static extern IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong); 44 | 45 | [DllImport("user32.dll")] 46 | private static extern bool ShowScrollBar(IntPtr hWnd, int wBar, bool bShow); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /UoFiddler.Controls/UserControls/TileView/CacheItemsEventHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace UoFiddler.Controls.UserControls.TileView 5 | { 6 | public class CacheItemEventArgs : EventArgs 7 | { 8 | public CacheItemEventArgs(List indices) 9 | { 10 | Indices = indices; 11 | } 12 | 13 | public List Indices { get; } 14 | 15 | public bool Success; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.Compare/Classes/SecondHue.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Ultima; 3 | 4 | namespace UoFiddler.Plugin.Compare.Classes 5 | { 6 | internal static class SecondHue 7 | { 8 | public static Hue[] List { get; private set; } 9 | 10 | /// 11 | /// Reads hues.mul and fills 12 | /// 13 | public static void Initialize(string path) 14 | { 15 | int index = 0; 16 | 17 | List = new Hue[3000]; 18 | 19 | if (path != null) 20 | { 21 | using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) 22 | { 23 | BinaryReader bin = new BinaryReader(fs); 24 | 25 | int blockCount = (int)fs.Length / 708; 26 | 27 | if (blockCount > 375) 28 | { 29 | blockCount = 375; 30 | } 31 | 32 | for (int i = 0; i < blockCount; ++i) 33 | { 34 | bin.ReadInt32(); 35 | 36 | for (int j = 0; j < 8; ++j, ++index) 37 | { 38 | List[index] = new Hue(index, bin); 39 | } 40 | } 41 | } 42 | } 43 | 44 | for (; index < List.Length; ++index) 45 | { 46 | List[index] = new Hue(index); 47 | } 48 | } 49 | 50 | // TODO: unused method? 51 | // public static Hue GetHue(int index) 52 | // { 53 | // index &= 0x3FFF; 54 | // 55 | // if (index >= 0 && index < 3000) 56 | // { 57 | // return List[index]; 58 | // } 59 | // 60 | // return List[0]; 61 | // } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.Compare/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace UoFiddler.Plugin.Compare.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UoFiddler.Plugin.Compare.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.ExamplePlugin/Forms/ExampleForm.Designer.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | namespace UoFiddler.Plugin.ExamplePlugin.Forms 13 | { 14 | partial class ExampleForm 15 | { 16 | /// 17 | /// Required designer variable. 18 | /// 19 | private System.ComponentModel.IContainer components = null; 20 | 21 | /// 22 | /// Clean up any resources being used. 23 | /// 24 | /// true if managed resources should be disposed; otherwise, false. 25 | protected override void Dispose(bool disposing) 26 | { 27 | if (disposing && (components != null)) 28 | { 29 | components.Dispose(); 30 | } 31 | base.Dispose(disposing); 32 | } 33 | 34 | #region Windows Form Designer generated code 35 | 36 | /// 37 | /// Required method for Designer support - do not modify 38 | /// the contents of this method with the code editor. 39 | /// 40 | private void InitializeComponent() 41 | { 42 | this.SuspendLayout(); 43 | // 44 | // ExampleForm 45 | // 46 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 47 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 48 | this.ClientSize = new System.Drawing.Size(384, 285); 49 | this.DoubleBuffered = true; 50 | this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 51 | this.Name = "ExampleForm"; 52 | this.Text = "Example"; 53 | this.ResumeLayout(false); 54 | 55 | } 56 | 57 | #endregion 58 | } 59 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.ExamplePlugin/Forms/ExampleForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System.Windows.Forms; 13 | 14 | namespace UoFiddler.Plugin.ExamplePlugin.Forms 15 | { 16 | public partial class ExampleForm : Form 17 | { 18 | public ExampleForm() 19 | { 20 | InitializeComponent(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.ExamplePlugin/Forms/ExampleForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.ExamplePlugin/UoFiddler.Plugin.ExamplePlugin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | TestPlugin 4 | net8.0-windows 5 | true 6 | false 7 | FiddlerPlugin 8 | FiddlerPlugin 9 | Copyright © 2025 10 | 11 | 12 | true 13 | 14 | 15 | portable 16 | ..\UoFiddler\bin\$(Configuration)\plugins\ 17 | 18 | 19 | none 20 | ..\UoFiddler\bin\$(Configuration)\plugins\ 21 | Off 22 | 23 | 24 | 25 | 26 | 27 | 28 | Form 29 | 30 | 31 | ExampleForm.cs 32 | 33 | 34 | UserControl 35 | 36 | 37 | ExampleControl.cs 38 | 39 | 40 | 41 | 42 | false 43 | runtime 44 | 45 | 46 | false 47 | runtime 48 | 49 | 50 | 51 | 52 | ExampleForm.cs 53 | 54 | 55 | ExampleControl.cs 56 | 57 | 58 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.ExamplePlugin/UserControls/ExampleControl.Designer.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | namespace UoFiddler.Plugin.ExamplePlugin.UserControls 13 | { 14 | partial class ExampleControl 15 | { 16 | /// 17 | /// Required designer variable. 18 | /// 19 | private System.ComponentModel.IContainer components = null; 20 | 21 | /// 22 | /// Clean up any resources being used. 23 | /// 24 | /// true if managed resources should be disposed; otherwise, false. 25 | protected override void Dispose(bool disposing) 26 | { 27 | if (disposing && (components != null)) 28 | { 29 | components.Dispose(); 30 | } 31 | base.Dispose(disposing); 32 | } 33 | 34 | #region Component Designer generated code 35 | 36 | /// 37 | /// Required method for Designer support - do not modify 38 | /// the contents of this method with the code editor. 39 | /// 40 | private void InitializeComponent() 41 | { 42 | this.button1 = new System.Windows.Forms.Button(); 43 | this.SuspendLayout(); 44 | // 45 | // button1 46 | // 47 | this.button1.Location = new System.Drawing.Point(132, 82); 48 | this.button1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 49 | this.button1.Name = "button1"; 50 | this.button1.Size = new System.Drawing.Size(88, 27); 51 | this.button1.TabIndex = 0; 52 | this.button1.Text = "Say Hello"; 53 | this.button1.UseVisualStyleBackColor = true; 54 | this.button1.Click += new System.EventHandler(this.OnClickSayHello); 55 | // 56 | // ExampleControl 57 | // 58 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 59 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 60 | this.Controls.Add(this.button1); 61 | this.DoubleBuffered = true; 62 | this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 63 | this.Name = "ExampleControl"; 64 | this.Size = new System.Drawing.Size(500, 300); 65 | this.ResumeLayout(false); 66 | 67 | } 68 | 69 | #endregion 70 | 71 | private System.Windows.Forms.Button button1; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.ExamplePlugin/UserControls/ExampleControl.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using Ultima; 15 | 16 | namespace UoFiddler.Plugin.ExamplePlugin.UserControls 17 | { 18 | public partial class ExampleControl : UserControl 19 | { 20 | public ExampleControl() 21 | { 22 | InitializeComponent(); 23 | } 24 | 25 | private void OnClickSayHello(object sender, EventArgs e) 26 | { 27 | if (Client.Running) 28 | { 29 | Client.SendText("Hello World... I am an example plugIn form."); 30 | } 31 | else 32 | { 33 | MessageBox.Show("UO client is not running so I will say hello here. Hi!"); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.ExamplePlugin/UserControls/ExampleControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Forms/MassImportForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Imports/ImportEntryGump.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Collections.Generic; 13 | using System.Drawing; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Plugin.MassImport.Imports 17 | { 18 | public class ImportEntryGump : ImportEntry 19 | { 20 | public override int MaxIndex => 0xFFFF; 21 | 22 | public override string Name => "Gump"; 23 | 24 | public override void Import(bool direct, ref Dictionary changedClasses) 25 | { 26 | if (!Remove) 27 | { 28 | using (var bmpTemp = new Bitmap(File)) 29 | { 30 | Bitmap bitmap = new Bitmap(bmpTemp); 31 | 32 | if (File.Contains(".bmp")) 33 | { 34 | bitmap = Utils.ConvertBmp(bitmap); 35 | } 36 | 37 | Ultima.Gumps.ReplaceGump(Index, bitmap); 38 | } 39 | } 40 | else 41 | { 42 | Ultima.Gumps.RemoveGump(Index); 43 | } 44 | 45 | if (!direct) 46 | { 47 | ControlEvents.FireGumpChangeEvent(this, Index); 48 | Options.ChangedUltimaClass["Gumps"] = true; 49 | } 50 | 51 | changedClasses["Gumps"] = true; 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Imports/ImportEntryHue.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Collections.Generic; 13 | using UoFiddler.Controls.Classes; 14 | 15 | namespace UoFiddler.Plugin.MassImport.Imports 16 | { 17 | public class ImportEntryHue : ImportEntry 18 | { 19 | public override int MaxIndex => 3000; 20 | 21 | public override string Name => "Hue"; 22 | 23 | protected override void TestFile(ref string message) 24 | { 25 | if (!File.Contains(".txt")) 26 | { 27 | message += " Invalid file format"; 28 | Valid = false; 29 | } 30 | else 31 | { 32 | Valid = true; 33 | } 34 | } 35 | 36 | public override void Import(bool direct, ref Dictionary changedClasses) 37 | { 38 | if (!Remove) 39 | { 40 | Ultima.Hues.List[Index].Import(File); 41 | } 42 | else 43 | { 44 | Ultima.Hues.List[Index].Name = ""; 45 | 46 | for (int i = 0; i < Ultima.Hues.List[Index].Colors.Length; ++i) 47 | { 48 | Ultima.Hues.List[Index].Colors[i] = 0; 49 | } 50 | 51 | Ultima.Hues.List[Index].TableStart = 0; 52 | Ultima.Hues.List[Index].TableEnd = 0; 53 | } 54 | 55 | if (!direct) 56 | { 57 | ControlEvents.FireHueChangeEvent(); 58 | Options.ChangedUltimaClass["Hues"] = true; 59 | } 60 | 61 | changedClasses["Hues"] = true; 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Imports/ImportEntryInvalid.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Collections.Generic; 13 | 14 | namespace UoFiddler.Plugin.MassImport.Imports 15 | { 16 | public class ImportEntryInvalid : ImportEntry 17 | { 18 | public override string Name => "Invalid"; 19 | 20 | protected override void TestFile(ref string message) 21 | { 22 | Valid = false; 23 | } 24 | 25 | public override void Import(bool direct, ref Dictionary changedClasses) 26 | { 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Imports/ImportEntryItem.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Collections.Generic; 13 | using System.Drawing; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Plugin.MassImport.Imports 17 | { 18 | public class ImportEntryItem : ImportEntry 19 | { 20 | public override int MaxIndex => Ultima.Art.GetMaxItemId(); 21 | 22 | public override string Name => "Item"; 23 | 24 | public override void Import(bool direct, ref Dictionary changedClasses) 25 | { 26 | if (!Remove) 27 | { 28 | using (var bmpTemp = new Bitmap(File)) 29 | { 30 | Bitmap bitmap = new Bitmap(bmpTemp); 31 | 32 | if (File.Contains(".bmp")) 33 | { 34 | bitmap = Utils.ConvertBmp(bitmap); 35 | } 36 | 37 | Ultima.Art.ReplaceStatic(Index, bitmap); 38 | } 39 | } 40 | else 41 | { 42 | Ultima.Art.RemoveStatic(Index); 43 | } 44 | 45 | if (!direct) 46 | { 47 | ControlEvents.FireItemChangeEvent(this, Index); 48 | Options.ChangedUltimaClass["Art"] = true; 49 | } 50 | 51 | changedClasses["Art"] = true; 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Imports/ImportEntryLandTile.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Collections.Generic; 13 | using System.Drawing; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Plugin.MassImport.Imports 17 | { 18 | public class ImportEntryLandTile : ImportEntry 19 | { 20 | public override string Name => "LandTile"; 21 | 22 | public override void Import(bool direct, ref Dictionary changedClasses) 23 | { 24 | if (!Remove) 25 | { 26 | using (var bmpTemp = new Bitmap(File)) 27 | { 28 | Bitmap bitmap = new Bitmap(bmpTemp); 29 | 30 | if (File.Contains(".bmp")) 31 | { 32 | bitmap = Utils.ConvertBmp(bitmap); 33 | } 34 | 35 | Ultima.Art.ReplaceLand(Index, bitmap); 36 | } 37 | } 38 | else 39 | { 40 | Ultima.Art.RemoveLand(Index); 41 | } 42 | 43 | if (!direct) 44 | { 45 | ControlEvents.FireLandTileChangeEvent(this, Index); 46 | Options.ChangedUltimaClass["Art"] = true; 47 | } 48 | 49 | changedClasses["Art"] = true; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Imports/ImportEntryTexture.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Collections.Generic; 13 | using System.Drawing; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Plugin.MassImport.Imports 17 | { 18 | public class ImportEntryTexture : ImportEntry 19 | { 20 | public override int MaxIndex => Ultima.Textures.GetIdxLength(); 21 | 22 | public override string Name => "Texture"; 23 | 24 | public override void Import(bool direct, ref Dictionary changedClasses) 25 | { 26 | if (!Remove) 27 | { 28 | using (var bmpTemp = new Bitmap(File)) 29 | { 30 | Bitmap bitmap = new Bitmap(bmpTemp); 31 | 32 | if (File.Contains(".bmp")) 33 | { 34 | bitmap = Utils.ConvertBmp(bitmap); 35 | } 36 | 37 | Ultima.Textures.Replace(Index, bitmap); 38 | } 39 | } 40 | else 41 | { 42 | Ultima.Textures.Remove(Index); 43 | } 44 | 45 | if (!direct) 46 | { 47 | ControlEvents.FireTextureChangeEvent(this, Index); 48 | Options.ChangedUltimaClass["Texture"] = true; 49 | } 50 | 51 | changedClasses["Texture"] = true; 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Imports/ImportEntryTileDataItem.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Collections.Generic; 13 | using UoFiddler.Controls.Classes; 14 | 15 | namespace UoFiddler.Plugin.MassImport.Imports 16 | { 17 | public class ImportEntryTileDataItem : ImportEntry 18 | { 19 | private string[] _tiledata; 20 | 21 | public override int MaxIndex => Ultima.Art.GetMaxItemId(); 22 | 23 | public override string Name => "TileDataItem"; 24 | 25 | protected override void TestFile(ref string message) 26 | { 27 | if (!File.Contains(".csv")) 28 | { 29 | message += " Invalid File format"; 30 | Valid = false; 31 | } 32 | else 33 | { 34 | Valid = GetTileDataInfo(File, ref message, ref _tiledata); 35 | } 36 | } 37 | 38 | public override void Import(bool direct, ref Dictionary changedClasses) 39 | { 40 | Ultima.TileData.ItemTable[Index].ReadData(_tiledata); 41 | if (!direct) 42 | { 43 | Options.ChangedUltimaClass["TileData"] = true; 44 | ControlEvents.FireTileDataChangeEvent(this, Index + 0x4000); 45 | } 46 | 47 | changedClasses["TileData"] = true; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/Imports/ImportEntryTileDataLand.cs: -------------------------------------------------------------------------------- 1 | // /*************************************************************************** 2 | // * 3 | // * $Author: Turley 4 | // * 5 | // * "THE BEER-WARE LICENSE" 6 | // * As long as you retain this notice you can do whatever you want with 7 | // * this stuff. If we meet some day, and you think this stuff is worth it, 8 | // * you can buy me a beer in return. 9 | // * 10 | // ***************************************************************************/ 11 | 12 | using System.Collections.Generic; 13 | using UoFiddler.Controls.Classes; 14 | 15 | namespace UoFiddler.Plugin.MassImport.Imports 16 | { 17 | public class ImportEntryTileDataLand : ImportEntry 18 | { 19 | private string[] _tiledata; 20 | 21 | public override string Name => "TileDataLand"; 22 | 23 | protected override void TestFile(ref string message) 24 | { 25 | if (!File.Contains(".csv")) 26 | { 27 | message += " Invalid file format"; 28 | Valid = false; 29 | } 30 | else 31 | { 32 | Valid = GetTileDataInfo(File, ref message, ref _tiledata); 33 | } 34 | } 35 | 36 | public override void Import(bool direct, ref Dictionary changedClasses) 37 | { 38 | Ultima.TileData.LandTable[Index].ReadData(_tiledata); 39 | if (!direct) 40 | { 41 | Options.ChangedUltimaClass["TileData"] = true; 42 | ControlEvents.FireTileDataChangeEvent(this, Index); 43 | } 44 | 45 | changedClasses["TileData"] = true; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/MassImportPluginBase.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using Ultima; 15 | using UoFiddler.Controls.Plugin; 16 | using UoFiddler.Controls.Plugin.Interfaces; 17 | 18 | namespace UoFiddler.Plugin.MassImport 19 | { 20 | public class MassImportPluginBase : PluginBase 21 | { 22 | /// 23 | /// Name of the plugin 24 | /// 25 | public override string Name { get; } = "MassImportPlugin"; 26 | 27 | /// 28 | /// Description of the Plugin's purpose 29 | /// 30 | public override string Description { get; } = "Import xml based"; 31 | 32 | /// 33 | /// Author of the plugin 34 | /// 35 | public override string Author { get; } = "Turley"; 36 | 37 | /// 38 | /// Version of the plugin 39 | /// 40 | public override string Version { get; } = "1.1.0"; 41 | 42 | /// 43 | /// Host of the plugin. 44 | /// 45 | public override IPluginHost Host { get; set; } = null; 46 | 47 | public override void Initialize() 48 | { 49 | _ = Files.RootDir; 50 | } 51 | 52 | public override void Unload() { } 53 | 54 | public override void ModifyTabPages(TabControl tabControl) { } 55 | 56 | public override void ModifyPluginToolStrip(ToolStripDropDownButton toolStrip) 57 | { 58 | ToolStripMenuItem item = new ToolStripMenuItem 59 | { 60 | Text = "Mass Import" 61 | }; 62 | item.Click += ToolStripClick; 63 | toolStrip.DropDownItems.Add(item); 64 | } 65 | 66 | private Forms.MassImportForm _importForm; 67 | 68 | private void ToolStripClick(object sender, EventArgs e) 69 | { 70 | if (_importForm?.IsDisposed == false) 71 | { 72 | return; 73 | } 74 | 75 | _importForm = new Forms.MassImportForm 76 | { 77 | TopMost = true 78 | }; 79 | _importForm.Show(); 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.MassImport/UoFiddler.Plugin.MassImport.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | MassImport 4 | net8.0-windows 5 | true 6 | false 7 | MassImportPlugin 8 | MassImportPlugin 9 | Copyright © 2025 10 | 1.1.0.0 11 | 1.1.0.0 12 | 13 | 14 | true 15 | 16 | 17 | portable 18 | ..\UoFiddler\bin\$(Configuration)\plugins\ 19 | 20 | 21 | true 22 | 23 | 24 | none 25 | ..\UoFiddler\bin\$(Configuration)\plugins\ 26 | Off 27 | 28 | 29 | 30 | 31 | 32 | 33 | Form 34 | 35 | 36 | MassImportForm.cs 37 | 38 | 39 | 40 | 41 | false 42 | runtime 43 | 44 | 45 | false 46 | runtime 47 | 48 | 49 | 50 | 51 | MassImportForm.cs 52 | 53 | 54 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace UoFiddler.Plugin.MultiEditor.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UoFiddler.Plugin.MultiEditor.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/UoFiddler.Plugin.MultiEditor.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | MultiEditor 4 | net8.0-windows 5 | true 6 | false 7 | MultiEditor 8 | MultiEditor 9 | Copyright © 2025 10 | 1.5.0.0 11 | 1.5.0.0 12 | true 13 | false 14 | 15 | 16 | true 17 | 18 | 19 | portable 20 | ..\UoFiddler\bin\$(Configuration)\plugins\ 21 | 22 | 23 | none 24 | ..\UoFiddler\bin\$(Configuration)\plugins\ 25 | Off 26 | 27 | 28 | 29 | UserControl 30 | 31 | 32 | MultiEditorControl.cs 33 | 34 | 35 | True 36 | True 37 | Resources.resx 38 | 39 | 40 | 41 | 42 | false 43 | runtime 44 | 45 | 46 | false 47 | runtime 48 | 49 | 50 | 51 | 52 | MultiEditorControl.cs 53 | 54 | 55 | ResXFileCodeGenerator 56 | Resources.Designer.cs 57 | 58 | 59 | 60 | 61 | PreserveNewest 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/AltitudeButton.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/AltitudeButton.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/AltitudeButton_Selected.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/AltitudeButton_Selected.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/AltitudeButton_Selected.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/AltitudeButton_Selected.psd -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/DrawButton.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/DrawButton.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/DrawButton_Selected.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/DrawButton_Selected.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/PipetteButton.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/PipetteButton.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/PipetteButton_Selected.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/PipetteButton_Selected.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/RemoveButton.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/RemoveButton.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/RemoveButton_Selected.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/RemoveButton_Selected.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/SelectButton.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/SelectButton.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/SelectButton_Selected.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/SelectButton_Selected.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/TransButton.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/TransButton.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/TransButton_Selected.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/TransButton_Selected.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/TransButton_Selected.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/TransButton_Selected.psd -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/VirtualFloorButton.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/VirtualFloorButton.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/VirtualFloorButton_Selected.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/VirtualFloorButton_Selected.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/VirtualFloorButton_Selected.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/VirtualFloorButton_Selected.psd -------------------------------------------------------------------------------- /UoFiddler.Plugin.MultiEditor/images/treeViewImage.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler.Plugin.MultiEditor/images/treeViewImage.bmp -------------------------------------------------------------------------------- /UoFiddler.Plugin.SendItem/Forms/SendItemOptionsForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Plugin.SendItem.Forms 17 | { 18 | public partial class SendItemOptionsForm : Form 19 | { 20 | public SendItemOptionsForm() 21 | { 22 | InitializeComponent(); 23 | Icon = Options.GetFiddlerIcon(); 24 | cmdtext.Text = SendItemPluginBase.Cmd; 25 | argstext.Text = SendItemPluginBase.CmdArg; 26 | SendOnClick.Checked = SendItemPluginBase.OverrideClick; 27 | } 28 | 29 | private void OnClickSave(object sender, EventArgs e) 30 | { 31 | SendItemPluginBase.Cmd = cmdtext.Text; 32 | SendItemPluginBase.CmdArg = argstext.Text; 33 | SendItemPluginBase.OverrideClick = SendOnClick.Checked; 34 | Close(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.SendItem/UoFiddler.Plugin.SendItem.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | SendItem 4 | net8.0-windows 5 | true 6 | false 7 | SendItem 8 | SendItem 9 | Copyright © 2025 10 | 1.0.1.0 11 | 1.0.1.0 12 | 13 | 14 | true 15 | 16 | 17 | portable 18 | ..\UoFiddler\bin\$(Configuration)\plugins\ 19 | 20 | 21 | none 22 | ..\UoFiddler\bin\$(Configuration)\plugins\ 23 | Off 24 | 25 | 26 | 27 | 28 | 29 | 30 | Form 31 | 32 | 33 | SendItemOptionsForm.cs 34 | 35 | 36 | 37 | 38 | false 39 | runtime 40 | 41 | 42 | false 43 | runtime 44 | 45 | 46 | 47 | 48 | SendItemOptionsForm.cs 49 | 50 | 51 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.UopPacker/Classes/FileType.cs: -------------------------------------------------------------------------------- 1 | namespace UoFiddler.Plugin.UopPacker.Classes 2 | { 3 | public enum FileType 4 | { 5 | ArtLegacyMul, 6 | GumpartLegacyMul, 7 | MapLegacyMul, 8 | SoundLegacyMul, 9 | MultiCollection 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.UopPacker/UoFiddler.Plugin.UopPacker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | UOPPacker 4 | net8.0-windows 5 | true 6 | false 7 | UOP Packer 8 | LegacyMUL Converter 9 | Copyright © 2025 10 | 1.1.1 11 | 1.1.1 12 | 13 | 14 | true 15 | 16 | 17 | portable 18 | ..\UoFiddler\bin\$(Configuration)\plugins\ 19 | 20 | 21 | none 22 | ..\UoFiddler\bin\$(Configuration)\plugins\ 23 | Off 24 | 25 | 26 | 27 | 28 | 29 | 30 | false 31 | runtime 32 | 33 | 34 | false 35 | runtime 36 | 37 | 38 | 39 | 40 | UserControl 41 | 42 | 43 | UopPackerControl.cs 44 | 45 | 46 | 47 | 48 | UopPackerControl.cs 49 | Designer 50 | 51 | 52 | -------------------------------------------------------------------------------- /UoFiddler.Plugin.UopPacker/UopPacker.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using Ultima; 15 | using UoFiddler.Controls.Plugin; 16 | using UoFiddler.Controls.Plugin.Interfaces; 17 | using UoFiddler.Plugin.UopPacker.UserControls; 18 | 19 | namespace UoFiddler.Plugin.UopPacker 20 | { 21 | public class UopPacker : PluginBase 22 | { 23 | private readonly Version _ver; 24 | 25 | public UopPacker() 26 | { 27 | _ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 28 | } 29 | 30 | /// 31 | /// Name of the plugin 32 | /// 33 | public override string Name { get; } = "UOP Packer"; 34 | 35 | /// 36 | /// Description of the Plugin's purpose 37 | /// 38 | public override string Description { get; } = "UOP packer/unpacker\r\nUses RunUO UOP packer"; 39 | 40 | /// 41 | /// Author of the plugin 42 | /// 43 | public override string Author { get; } = "Feeh / Epila"; 44 | 45 | /// 46 | /// Version of the plugin 47 | /// 48 | public override string Version { get { return _ver.ToString(); } } 49 | 50 | /// 51 | /// Host of the plugin. 52 | /// 53 | public override IPluginHost Host { get; set; } 54 | 55 | public override void Initialize() 56 | { 57 | _ = Files.RootDir; 58 | } 59 | 60 | public override void Unload() 61 | { 62 | } 63 | 64 | public override void ModifyTabPages(TabControl tabControl) 65 | { 66 | TabPage page = new TabPage 67 | { 68 | Tag = 0, // at end used for undock/dock feature to define the order 69 | Text = "UOP Packer" 70 | }; 71 | page.Controls.Add(new UopPackerControl(Version)); 72 | tabControl.TabPages.Add(page); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /UoFiddler/Classes/ExternTool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace UoFiddler.Classes 4 | { 5 | public sealed class ExternTool 6 | { 7 | public string Name { get; set; } 8 | public string FileName { get; set; } 9 | public List Args { get; } 10 | public List ArgsName { get; } 11 | 12 | public ExternTool(string name, string filename) 13 | { 14 | Name = name; 15 | FileName = filename; 16 | Args = new List(); 17 | ArgsName = new List(); 18 | } 19 | 20 | public string FormatName() 21 | { 22 | return $"{Name}: {FileName}"; 23 | } 24 | 25 | public string FormatArg(int i) 26 | { 27 | return $"{ArgsName[i]}: {Args[i]}"; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /UoFiddler/Classes/UpdateChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Octokit; 4 | using UoFiddler.Controls.Helpers; 5 | 6 | namespace UoFiddler.Classes 7 | { 8 | internal sealed class UpdateChecker 9 | { 10 | private readonly IGitHubClient _githubClient; 11 | private readonly string _repositoryName; 12 | private readonly string _repositoryOwner; 13 | private readonly Version _currentVersion; 14 | 15 | public UpdateChecker(string repositoryOwner, string repositoryName, Version currentVersion) 16 | { 17 | ThrowIf.Argument.IsNullOrEmptyString(repositoryOwner, nameof(repositoryOwner)); 18 | ThrowIf.Argument.IsNullOrEmptyString(repositoryName, nameof(repositoryName)); 19 | ThrowIf.Argument.IsNull(currentVersion, nameof(currentVersion)); 20 | 21 | _githubClient = new GitHubClient(new ProductHeaderValue($"{repositoryName}-update-checker")); 22 | 23 | _repositoryOwner = repositoryOwner; 24 | _repositoryName = repositoryName; 25 | _currentVersion = currentVersion; 26 | } 27 | 28 | public async Task CheckUpdateAsync() 29 | { 30 | try 31 | { 32 | var rateLimit = await _githubClient.RateLimit.GetRateLimits().ConfigureAwait(false); 33 | if (rateLimit.Resources.Core.Remaining == 0) 34 | { 35 | return UpdateResponse.Error($"Update API rate limit exceeded. Limit will reset at {rateLimit.Resources.Core.Reset.LocalDateTime}. Please try again later."); 36 | } 37 | 38 | var latestRelease = await _githubClient.Repository.Release.GetLatest(_repositoryOwner, _repositoryName).ConfigureAwait(false); 39 | 40 | bool isNewVersion = false; 41 | if (Version.TryParse(StripInitialV(latestRelease.TagName), out Version newVersion)) 42 | { 43 | isNewVersion = newVersion > _currentVersion; 44 | } 45 | 46 | return UpdateResponse.Ok(latestRelease.Body, latestRelease.HtmlUrl, newVersion, isNewVersion); 47 | } 48 | catch (NotFoundException ex) 49 | { 50 | return UpdateResponse.Error($"Now new\r\nMessage: {ex.Message}"); 51 | } 52 | catch (AggregateException ae) 53 | { 54 | var message = string.Empty; 55 | 56 | foreach (var ex in ae.InnerExceptions) 57 | { 58 | message += $"Exception: {ex.GetType().Name}\r\nMessage: {ex.Message}\r\n"; 59 | } 60 | 61 | return UpdateResponse.Error($"Problem with checking version:\r\n{message}"); 62 | } 63 | } 64 | 65 | private static string StripInitialV(string versionString) 66 | { 67 | return (versionString[0] == 'v') ? versionString[1..] : versionString; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /UoFiddler/Classes/UpdateResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UoFiddler.Classes 4 | { 5 | public sealed class UpdateResponse 6 | { 7 | public bool HasErrors { get; private init; } 8 | public string ErrorMessage { get; private init; } 9 | 10 | public string Body { get; private init; } 11 | public string HtmlUrl { get; private init; } 12 | public bool IsNewVersion { get; private init; } 13 | public Version NewVersion { get; private init; } 14 | 15 | public static UpdateResponse Error(string errorMessage) 16 | { 17 | return new UpdateResponse 18 | { 19 | HasErrors = true, 20 | ErrorMessage = errorMessage 21 | }; 22 | } 23 | 24 | public static UpdateResponse Ok(string body, string htmlUrl, Version newVersion, bool isNewVersion) 25 | { 26 | return new UpdateResponse 27 | { 28 | Body = body, 29 | HtmlUrl = htmlUrl, 30 | NewVersion = newVersion, 31 | IsNewVersion = isNewVersion 32 | }; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /UoFiddler/Classes/UpdateRunner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Threading.Tasks; 4 | using System.Windows.Forms; 5 | 6 | namespace UoFiddler.Classes 7 | { 8 | internal static class UpdateRunner 9 | { 10 | public static async Task RunAsync(string repositoryOwner, string repositoryName, Version currentVersion, bool upToDateNotification = true) 11 | { 12 | const string updateCheckCaption = "Check for update"; 13 | 14 | try 15 | { 16 | var updateChecker = new UpdateChecker(repositoryOwner, repositoryName, currentVersion); 17 | 18 | var response = await updateChecker.CheckUpdateAsync().ConfigureAwait(false); 19 | if (response.HasErrors) 20 | { 21 | MessageBox.Show($"Update check failed: {response.ErrorMessage}"); 22 | } 23 | else if (response.IsNewVersion) 24 | { 25 | string text = $"A new version was found: {response.NewVersion}\r\nDownload now?"; 26 | DialogResult result = MessageBox.Show(text, updateCheckCaption, MessageBoxButtons.YesNo); 27 | if (result == DialogResult.Yes) 28 | { 29 | Process.Start(new ProcessStartInfo 30 | { 31 | FileName = response.HtmlUrl, 32 | UseShellExecute = true 33 | }); 34 | } 35 | } 36 | else 37 | { 38 | if (!upToDateNotification) 39 | { 40 | return; 41 | } 42 | 43 | MessageBox.Show("Your version is up-to-date", updateCheckCaption); 44 | } 45 | } 46 | catch (Exception ex) 47 | { 48 | // some other exception (connection issues probably). Put in log and continue as usual. 49 | if (upToDateNotification) 50 | { 51 | MessageBox.Show("Update check failed. Check application log for details.", updateCheckCaption); 52 | } 53 | 54 | FiddlerOptions.Logger.Error(ex, "Update check failed"); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /UoFiddler/FiddlerAppContext.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using Serilog; 15 | using UoFiddler.Classes; 16 | using UoFiddler.Controls.Classes; 17 | using UoFiddler.Controls.UserControls; 18 | using UoFiddler.Forms; 19 | 20 | namespace UoFiddler 21 | { 22 | internal sealed class FiddlerAppContext : ApplicationContext 23 | { 24 | private readonly ILogger _logger; 25 | 26 | internal FiddlerAppContext(ILogger logger) 27 | { 28 | _logger = logger; 29 | 30 | Application.SetHighDpiMode(HighDpiMode.SystemAware); 31 | Application.EnableVisualStyles(); 32 | Application.SetCompatibleTextRenderingDefault(false); 33 | Application.ApplicationExit += OnApplicationExit; 34 | 35 | FiddlerOptions.SetLogger(_logger); 36 | FiddlerOptions.Startup(); 37 | 38 | _logger.Information("Starting loading profile form..."); 39 | var profile = new LoadProfileForm { TopMost = true }; 40 | var profileResult = profile.ShowDialog(); 41 | if (profileResult == DialogResult.Cancel) 42 | { 43 | _logger.Information("No profile loaded... exiting"); 44 | return; 45 | } 46 | 47 | if (FiddlerOptions.UpdateCheckOnStart) 48 | { 49 | _logger.Information("Update check. Current version is {Version}", FiddlerOptions.AppVersion); 50 | UpdateRunner.RunAsync(FiddlerOptions.RepositoryOwner, FiddlerOptions.RepositoryName, FiddlerOptions.AppVersion, false).GetAwaiter().GetResult(); 51 | } 52 | 53 | _logger.Information("Starting main form..."); 54 | MainForm = new MainForm 55 | { 56 | Text = $"{Application.ProductName} (Profile: {Options.ProfileName.Replace("Options_", "").Replace(".xml", "")})" 57 | }; 58 | MainForm.Show(); 59 | } 60 | 61 | private void OnApplicationExit(object sender, EventArgs e) 62 | { 63 | FiddlerOptions.SaveProfile(); 64 | MapControl.SaveMapOverlays(); 65 | _logger.Information("UOFiddler - Application exit"); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /UoFiddler/Forms/AboutBoxForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using System.Windows.Forms; 15 | using UoFiddler.Classes; 16 | using UoFiddler.Controls.Classes; 17 | 18 | namespace UoFiddler.Forms 19 | { 20 | public partial class AboutBoxForm : Form 21 | { 22 | public AboutBoxForm() 23 | { 24 | InitializeComponent(); 25 | Icon = Options.GetFiddlerIcon(); 26 | 27 | checkBoxCheckOnStart.Checked = FiddlerOptions.UpdateCheckOnStart; 28 | checkBoxFormState.Checked = FiddlerOptions.StoreFormState; 29 | } 30 | 31 | private void OnChangeCheck(object sender, EventArgs e) 32 | { 33 | FiddlerOptions.UpdateCheckOnStart = checkBoxCheckOnStart.Checked; 34 | } 35 | 36 | private async void OnClickUpdate(object sender, EventArgs e) 37 | { 38 | await UpdateRunner.RunAsync(FiddlerOptions.RepositoryOwner, FiddlerOptions.RepositoryName, FiddlerOptions.AppVersion).ConfigureAwait(false); 39 | } 40 | 41 | private void OnClickLink(object sender, LinkLabelLinkClickedEventArgs e) 42 | { 43 | Process.Start(new ProcessStartInfo 44 | { 45 | FileName = "http://uofiddler.polserver.com/", 46 | UseShellExecute = true 47 | }); 48 | } 49 | 50 | private void OnChangeFormState(object sender, EventArgs e) 51 | { 52 | FiddlerOptions.StoreFormState = checkBoxFormState.Checked; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /UoFiddler/Forms/ExceptionForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Forms 17 | { 18 | public partial class ExceptionForm : Form 19 | { 20 | public ExceptionForm(Exception err) 21 | { 22 | InitializeComponent(); 23 | Icon = Options.GetFiddlerIcon(); 24 | 25 | richTextBox.Text = err.InnerException != null 26 | ? $"{err.InnerException.Message}\n{err.InnerException.GetType()}" 27 | : string.Empty; 28 | 29 | richTextBox.Text = $"{richTextBox.Text}\n\n{err.Message}\n\n{err.StackTrace}"; 30 | } 31 | 32 | private void OnClick(object sender, EventArgs e) 33 | { 34 | Close(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /UoFiddler/Forms/ExceptionForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler/Forms/LoadProfileForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler/Forms/ManagePluginsForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler/Forms/ManageToolsForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler/Forms/UnDockedForm.Designer.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | namespace UoFiddler.Forms 13 | { 14 | partial class UnDockedForm 15 | { 16 | /// 17 | /// Required designer variable. 18 | /// 19 | private System.ComponentModel.IContainer components = null; 20 | 21 | /// 22 | /// Clean up any resources being used. 23 | /// 24 | /// true if managed resources should be disposed; otherwise, false. 25 | protected override void Dispose(bool disposing) 26 | { 27 | if (disposing && (components != null)) 28 | { 29 | components.Dispose(); 30 | } 31 | base.Dispose(disposing); 32 | } 33 | 34 | #region Windows Form Designer generated code 35 | 36 | /// 37 | /// Required method for Designer support - do not modify 38 | /// the contents of this method with the code editor. 39 | /// 40 | private void InitializeComponent() 41 | { 42 | this.SuspendLayout(); 43 | // 44 | // UnDockedForm 45 | // 46 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 47 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 48 | this.ClientSize = new System.Drawing.Size(724, 381); 49 | this.DoubleBuffered = true; 50 | this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); 51 | this.Name = "UnDockedForm"; 52 | this.Text = "UnDocked"; 53 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnClose); 54 | this.ResumeLayout(false); 55 | 56 | } 57 | 58 | #endregion 59 | 60 | } 61 | } -------------------------------------------------------------------------------- /UoFiddler/Forms/UnDockedForm.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Windows.Forms; 14 | using UoFiddler.Controls.Classes; 15 | 16 | namespace UoFiddler.Forms 17 | { 18 | public partial class UnDockedForm : Form 19 | { 20 | private readonly TabPage _oldTab; 21 | private readonly Action _reDockAction; 22 | 23 | public UnDockedForm(TabPage oldTab, Action reDockAction) 24 | { 25 | Control control = oldTab.Controls[0]; 26 | Controls.Clear(); 27 | Controls.Add(control); 28 | 29 | InitializeComponent(); 30 | 31 | Icon = Options.GetFiddlerIcon(); 32 | 33 | // TODO: virtual member call in constructor? 34 | Text = oldTab.Text; 35 | _oldTab = oldTab; 36 | _reDockAction = reDockAction; 37 | 38 | if (ActiveForm?.TopMost == true) 39 | { 40 | TopMost = true; 41 | } 42 | 43 | ControlEvents.AlwaysOnTopChangeEvent += OnAlwaysOnTopChangeEvent; 44 | } 45 | 46 | private void OnAlwaysOnTopChangeEvent(bool value) 47 | { 48 | TopMost = value; 49 | } 50 | 51 | // TODO: unused? 52 | // public void ChangeControl(Control contr) 53 | // { 54 | // Controls.Clear(); 55 | // Controls.Add(contr); 56 | // PerformLayout(); 57 | // } 58 | 59 | private void OnClose(object sender, FormClosingEventArgs e) 60 | { 61 | Control control = Controls[0]; 62 | 63 | _oldTab.Controls.Clear(); 64 | _oldTab.Controls.Add(control); 65 | 66 | _reDockAction(_oldTab); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /UoFiddler/Forms/UnDockedForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 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 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /UoFiddler/Options_default.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UoFiddler/Program.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * $Author: Turley 4 | * 5 | * "THE BEER-WARE LICENSE" 6 | * As long as you retain this notice you can do whatever you want with 7 | * this stuff. If we meet some day, and you think this stuff is worth it, 8 | * you can buy me a beer in return. 9 | * 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.IO; 14 | using System.Text; 15 | using System.Windows.Forms; 16 | using Serilog; 17 | using UoFiddler.Forms; 18 | 19 | namespace UoFiddler 20 | { 21 | internal static class Program 22 | { 23 | /// 24 | /// The main entry point for the application. 25 | /// 26 | [STAThread] 27 | private static void Main() 28 | { 29 | string fiddlerAppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "UoFiddler"); 30 | string logFileName = Path.Combine(fiddlerAppDataPath, "log", "uo-fiddler-log.txt"); 31 | 32 | var logger = new LoggerConfiguration() 33 | .MinimumLevel.Information() 34 | .WriteTo.File(logFileName, 35 | fileSizeLimitBytes: 44040192, 36 | rollingInterval: RollingInterval.Day, 37 | rollOnFileSizeLimit: true) 38 | .CreateLogger(); 39 | 40 | logger.Information("UOFiddler - Application start"); 41 | 42 | Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); 43 | 44 | try 45 | { 46 | FiddlerAppContext fiddlerAppContext = new FiddlerAppContext(logger); 47 | Application.Run(fiddlerAppContext); 48 | } 49 | catch (Exception err) 50 | { 51 | Clipboard.SetDataObject(err.ToString(), true); 52 | logger.Fatal(err, "UOFiddler - unhandled exception caught!"); 53 | Application.Run(new ExceptionForm(err)); 54 | logger.Fatal("UOFiddler - unhandled exception - Application exit"); 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /UoFiddler/Resources/UOFiddler.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler/Resources/UOFiddler.jpg -------------------------------------------------------------------------------- /UoFiddler/Resources/UOFiddlerIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polserver/UOFiddler/6e8c67cdee6de276bf0a55c819322f32aac4f2b5/UoFiddler/Resources/UOFiddlerIcon.ico -------------------------------------------------------------------------------- /UoFiddler/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | --------------------------------------------------------------------------------