MobileUO changes from ClassicUO - mandlar/MobileUO GitHub Wiki

Modified files inside of MobileUO from ClassicUO base. These are all the files that are NOT symlinked.

MobileUO version: https://github.com/VoxelBoy/MobileUO/tree/37908e969efaabf453da6b88c78c9e5414e889b8

ClassicUO version: https://github.com/ClassicUO/ClassicUO/tree/303c2ae699ca02caa6b09fbe5fbcb0c92f8bbd68

Analyzed: 2024-12-20

  • ClassicUO/src/
    • Client.cs
      • public static GameController Game { get; set; } removed private setter
      • Adds public static event Action SceneChanged; and public static void InvokeSceneChanged()
      • Load():
        • Commented out UltimaLive.Enable();
        • Commented out UoAssist.Start();
    • CUOEnvironment.cs
      • public static string ExecutablePath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location); removed readonly
    • GameController.cs
      • Adds using ClassicUO.Game.UI.Controls;
      • Adds variables public UltimaBatcher2D Batcher => _uoSpriteBatch; and public static UnityEngine.TouchScreenKeyboard TouchScreenKeyboard;
      • GameController(): comments out _graphicDeviceManager.PreparingDeviceSettings += (sender, e) => e.GraphicsDeviceInformation.PresentationParameters.RenderTargetUsage = RenderTargetUsage.DiscardContents;
      • Initialize(): comments out if (_graphicDeviceManager.GraphicsDevice.Adapter.IsProfileSupported(GraphicsProfile.HiDef)) _graphicDeviceManager.GraphicsProfile = GraphicsProfile.HiDef;
      • LoadContent():
        • Adds true parameter to _hues_sampler[0].SetData()
        • Adds GraphicsDevice.Textures[1].UnityTexture.filterMode = UnityEngine.FilterMode.Point; GraphicsDevice.Textures[2].UnityTexture.filterMode = UnityEngine.FilterMode.Point;
      • UnloadContent:
        • made public from protected
        • //NOTE: My dispose related changes, see if they're still necessary and //NOTE: We force the sockets to disconnect in case they haven't already been disposed
      • SetScene(): adds //NOTE: Added this to be able to react to scene changes, mainly for calculating render scale factor Client.InvokeSceneChanged();
      • SetWindowBorderless: Adds SDL namespace to SDL.SDL_SetWindowBordered() and SDL.SDL_GetCurrentDisplayMode()
        • Can it be removed?
      • Update():
        • Comments out Mouse.Update() for new MouseUpdate()
        • Adds call to new UnityInputUpdate();
      • HandleSDLEvent(): comments out block inside of case SDL.SDL_EventType.SDL_KEYUP for if (e->key.keysym.sym == SDL_Keycode.SDLK_PRINTSCREEN)
      • Adds a number of unity private functions to help support input: MouseUpdate(), UnityInputUpdate(), HandleChatMode(), ConvertUnityMousePosition() and SimulateMouse()
  • ClassicUO/src/Configuration/
    • Profile.cs
      • public bool UseXBR { get; set; } = false; from true
      • ReadGumps(): GUMP_TYPE.GT_ASSISTANTMACROBUTTON and GUMP_TYPE.GT_ASSISTANTHOTKEYBUTTON added to switch (type)
    • ProfileManager.cs
      • adds variable public static System.Action ProfileLoaded;
      • Load(): ProfileLoaded?.Invoke(); added
    • Settings.cs
      • adds variable [JsonProperty("internal_assistant")] public bool EnableInternalAssistant { get; set; } = true;
  • ClassicUO/src/Game/
    • CircleOfTransparency.cs
      • public static void Dispose() function added
    • GameCursor.cs
      • GameCursor(): commented out if (pixels != null && pixels.Length != 0) block
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
      • public void Dispose() function added
    • World.cs
      • Clear(): Land.Dispose(); call added
  • ClassicUO/src/Game/Data/
    • NONE
  • ClassicUO/src/Game/GameObjects/
    • DragEffect.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • Land.cs
      • public static void Dispose() function added
  • ClassicUO/src/Game/GameObjects/Views/
    • AnimatedEffectView.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • ItemView.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • LightningEffectView.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • MobileView.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • MovingEffectView.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • MultiView.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • StaticView.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • TileView.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
  • ClassicUO/src/Game/Managers/
    • AnimatedStaticsManager.cs
      • Process(): added if logic: if (offset < info->FrameCount && o.index + 0x4000 < static_data.Length)
    • AudioManager.cs
      • StopMusic(): added logic to stop sounds, see block below //NOTE: Also discard sounds
    • AuraManager.cs
      • public static void Dispose() function added
    • UIManager.cs
      • Clear(): added logic to clear - Gumps.Clear(); and for loop on _mouseDownControls to null them
      • public static void Dispose() function added
      • public static Control GetMouseOverControl(Point position) vs private static Control GetMouseOverControl(Point position)
  • ClassicUO/src/Game/Map/
    • NONE
  • ClassicUO/src/Game/Scenes/
    • GameScene.cs
      • Added viewport variables: public static int MinimumViewportWidth = 200; and public static int MinimumViewportHeight = 300;
      • Added joystick variables: public Vector2 JoystickInput; and public float JoystickRunThreshold;
      • Load(): use new MinimumViewportWidth and MinimumViewportHeight variables
      • Unload(): added dispose for CircleOfTransparency.Dispose();
      • Update():
        • Commented out if block: if (UnityEngine.Application.isMobilePlatform == false || UserPreferences.UseMouseOnMobile.CurrentValue == 1)
        • Added joystick if block: if (JoystickInput != Vector2.Zero && UserPreferences.JoystickCancelsFollow.CurrentValue == (int) PreferenceEnums.JoystickCancelsFollow.On)
      • Draw(): //Revert scaling during game scene drawing
      • DrawWorld():
        • //NOTE: This extra Clear is important, otherwise hall-of-mirrors effects can happen in areas which are not drawn, such as black tiles surrounding caves
        • Commented out // DrawLights(batcher);
      • DrawLights(): ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • LoginScene.cs
      • Unload(): //NOTE: We force the login socket to disconnect in case it hasn't already been disposed
  • ClassicUO/src/Game/UI/
    • Tooltip.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
  • ClassicUO/src/Game/UI/Controls/
    • AlphaBlendControl.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • Button.cs
      • Added variables for enlarging buttons: private bool enlarged; and private const int smallButtonThreshold = 12;
      • added function: ToggleSize()
      • ButtonGraphicNormal(): added if (_textures[NORMAL] == null) return;
      • ButtonGraphicPressed(): added if (_textures[NORMAL] == null) return;
      • ButtonGraphicOver(): added if (_textures[NORMAL] == null) return;
      • Update(): added //NOTE: Added for enlarging small buttons in MobileUO ToggleSize(UserPreferences.EnlargeSmallButtons.CurrentValue == (int) PreferenceEnums.EnlargeSmallButtons.On);
    • ButtonTileArt.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • Checkbox.cs
      • Added for Assistant: public ushort Hue
    • Control.cs
      • Added variables protected const int MOBILE_CLOSE_BUTTON_ID = -9999; and public Control ControlToForwardMouseEventsTo;
      • Clear(): //NOTE: Prevent mobile close buttons from being disposed
      • InvokeMouseDown(): ControlToForwardMouseEventsTo?.InvokeMouseDown(position, button);
      • InvokeMouseUp(): ControlToForwardMouseEventsTo?.InvokeMouseUp(position, button);
      • InvokeMouseCloseGumpWithRClick(): ControlToForwardMouseEventsTo?.InvokeMouseCloseGumpWithRClick();
      • InvokeMouseOver(): ControlToForwardMouseEventsTo?.InvokeMouseOver(position);
      • InvokeMouseEnter(): ControlToForwardMouseEventsTo?.InvokeMouseEnter(position);
      • InvokeMouseExit(): ControlToForwardMouseEventsTo?.InvokeMouseExit(position);
      • InvokeMouseDoubleClick(): ControlToForwardMouseEventsTo?.InvokeMouseDoubleClick(position, button);
      • InvokeMouseWheel(): ControlToForwardMouseEventsTo?.InvokeMouseWheel(delta);
      • OnButtonClick(): //NOTE: Mobile close button functionality
      • Added function: public bool IsMobileCloseButton()
    • GumpPic.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • GumpPicTiled.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • GumpPicWithWidth.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • HitBox.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • HtmlControl.cs
      • OnMouseUp(): adds if (UnityEngine.Application.isMobilePlatform) to UnityEngine.Application.OpenURL(result.Link);
    • ItemGump.cs
      • Added variable: public static bool PixelCheck = false;
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
      • Contains(): added PixelCheck to parameters: if (texture.Contains(x, y, PixelCheck)) and if (texture.Contains(x - 5, y - 5, PixelCheck))
    • Line.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • NiceButton.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • ResizePic.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • StaticPic.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • StbTextBox.cs
      • added using ClassicUO.Game.UI.Gumps.Login;
      • OnMouseDown(): //NOTE: Show touchscreen keyboard when abstract text box is selected
    • TextureControl.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • WorldViewport.cs
      • Draw(): commented out if (_scene.UseAltLights) and else if (_scene.UseLights)
  • ClassicUO/src/Game/UI/Gumps/
    • BuffGump.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • Gump.cs
      • Added enums: GT_ASSISTANTMACROBUTTON, GT_ASSISTANTHOTKEYBUTTON
      • Added variables: private Button closeButton; and public static bool CloseButtonsEnabled;
      • added functions for making sure close button is always on top: OnChildAdded(), InitCloseButton(), UpdateCloseButton()
      • Dispose(): added close button dispose if (closeButton != null && closeButton.IsDisposed == false)
    • HealthBarGump.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • InfoBarGump.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • MiniMapGump.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • ModernBookGump.cs
      • OnMouseDown(): //NOTE: Show touchscreen keyboard when abstract text box is selected
    • PaperdollGump.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • ResizableGump.cs
      • ResizableGump(): //Upscale resize button on mobile
    • ShopGump.cs
      • GenerateVirtualTextures(): added parameter keepData = true to GumpsLoader.Instance.GetTexture()
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
    • SystemChatControl.cs
      • Dispose(): added foreach (var chatLineTime in _textEntries) to destroy them
    • WorldMapGump.cs
      • added variables: private bool readyToCreateTexture; private int realWidth; private int realHeight; private Color[] buffer;
      • Load(): quite a few changes/refactoring here -> investigate git blame to see why
      • Update(): added if (readyToCreateTexture)
    • WorldViewportGump.cs
      • added variable: public WorldViewport Viewport => _viewport;
      • WorldViewportGump(): added //Upscale resize button on mobile
      • Update(): using GameScene.MinimumViewportWidth and GameScene.MinimumViewportHeight variables
      • ResizeGameWindow(): using GameScene.MinimumViewportWidth and GameScene.MinimumViewportHeight variables
  • ClassicUO/src/Game/UI/Gumps/CharCreation/
    • NONE
  • ClassicUO/src/Game/UI/Gumps/Login/
    • LoginGump.cs
      • LoginGump():
        • //Upscale arrow button on mobile
        • Commented out HtmlControls for PayPal donate / Patreon
    • Added UpscaleNextArrow() function
    • Update(): //Setting ButtonGraphicNormal resets the button's Width and Height so we need to apply the upscaling again
    • public class PasswordStbTextBox : StbTextBox vs private class PasswordStbTextBox : StbTextBox
    • public enum Buttons vs private enum Buttons
  • ClassicUO/src/Input/
    • Keyboard.cs
      • added private to setters for Alt, Shift and Ctrl variables
        • look up git blame to see why
  • ClassicUO/src/Interfaces/
    • NONE
  • ClassicUO/src/IO/
    • UOFile.cs
      • Dispose(): sets _accessor and _file to null
    • UOFileLoader.cs
      • GetTexture(): adds optional keepData parameter
    • UOFileManager.cs
      • GetUOFilePath(): adds fix for iOS for file case sensitivity
      • Load(): comments out .Loads() and runs them one by one instead of loop
        • look up git blame to see why
  • ClassicUO/src/IO/Audio/
    • Sound.cs
      • adds variable: protected virtual uint DistortionFix => 0;
      • Play(): adds distortion fix
      • Stop(): sets volume to 0.0f
    • UOMusic.cs
      • Update(): commented out OnBufferNeeded();
        • look up git blame to see why
      • OnBufferNeeded(): commented while loop
    • UOSound.cs
      • adds variable: protected override uint DistortionFix => 500;
        • doesn't appear to be used - can probably remove and symlink file
  • ClassicUO/src/IO/Audio/MP3Sharp
    • NONE
  • ClassicUO/src/IO/Audio/MP3Sharp/Decoding/
    • NONE
  • ClassicUO/src/IO/Audio/MP3Sharp/Decoding/Decoders/
    • NONE
  • ClassicUO/src/IO/Audio/MP3Sharp/Decoding/Decoders/LayerI/
    • NONE
  • ClassicUO/src/IO/Audio/MP3Sharp/Decoding/Decoders/LayerII/
    • NONE
  • ClassicUO/src/IO/Audio/MP3Sharp/Decoding/Decoders/LayerIII/
    • NONE
  • ClassicUO/src/IO/Audio/MP3Sharp/IO/
    • NONE
  • ClassicUO/src/IO/Audio/MP3Sharp/Support/
    • NONE
  • ClassicUO/src/IO/Resources/
    • AnimationsLoader.cs
      • ClearResources(): a lot of changes/refactor of logic
    • AnimDataLoader.cs
      • adds ClearResources(); override
    • ArtLoader.cs
      • GetTexture(): adds keepData parameter
      • ClearResources(): adds dispose/nulling
    • FontsLoader.cs
      • adds ClearResources(); override
    • GumpsLoader.cs
      • GetTexture(): adds keepData parameter
      • adds ClearResources(); override
    • HuesLoader.cs
      • adds ClearResources(); override
    • LightsLoader.cs
      • GetTexture(): adds keepData parameter
      • adds ClearResources(); override
    • MapLoader.cs
      • adds ClearResources(); override
    • MultiLoader.cs
      • adds ClearResources(); override
    • MultiMapLoader.cs
      • adds ClearResources(); override
    • ProfessionLoader.cs
      • adds ClearResources(); override
    • SkillsLoader.cs
      • adds ClearResources(); override
    • SoundsLoader.cs
      • Load(): recursively gets mp3 music files
      • adds variable: private static byte[] _SilenceArr = new byte[22050];//this will create a silence of 0.5 sec
      • TryGetSound(): adds _SilenceArr to music array
      • TryParseConfigLine():
        • adds musicFileList parameter
        • uses GetTrueFileName() function - // check if name exists as file, ignoring case since UO isn't consistent with file case (necessary for *nix) // also, not every filename in Config.txt has a file extension, so let's strip it out just in case.
      • adds GetTrueFileName() function
      • ClearResources(): adds dispose/nulling
    • SpeechesLoader.cs
      • adds ClearResources(); override
    • TexmapsLoader.cs
      • GetTexture(): adds keepData parameter
      • adds ClearResources(); override
    • TileDataLoader.cs
      • adds ClearResources(); override
  • ClassicUO/src/Network/
    • PackerHandlers.cs
      • OpenUrl(): adds if (UnityEngine.Application.isMobilePlatform) block
    • Plugin.cs
      • adds variable: private const string hardcodedInternalAssistantPath = "internal_assistant";
      • removes [MarshalAs(UnmanagedType.FunctionPtr)] from variables
      • adds LoadInternalAssistant() function
      • Load(): comments out desktop loading, adds internal assistant
  • ClassicUO/src/Network/Encryption/
    • NONE
  • ClassicUO/src/Renderer/
    • Batcher2D.cs
      • UltimaBatcher2D vs UltimaBatcher2D_Unused
        • Replaced by UnityBatcher.cs's UltimaBatcher2D?
      • ShaderHueTranslator.SHADER_SHADOW vs ShaderHuesTraslator.SHADER_SHADOW
      • StandardEffect() commented out
      • GetResource() return new byte[1]; (used by no longer used UltimaBatcher2D)
    • Fonts.cs
      • removes "ClassicUO.Renderer.fonts." and ".xnb" from fonts
    • RenderedText.cs
      • ShaderHueTranslator.GetHueVector vs ShaderHuesTraslator.GetHueVector
      • Adds Dispose() function
    • ShaderHueTranslator.cs
      • class renamed internal static class ShaderHueTranslator vs internal static class ShaderHuesTraslator. Revert back and symlink the file
      • cascade effect: revert rename in other files and symlink them if that's the only change
      • the name is fixed later in ClassicUO git history, so it'll eventually be fixed again
    • SpriteFont.cs
      • Create(): logic to load resource via Unity var bytes = UnityEngine.Resources.Load<UnityEngine.TextAsset>(name).bytes;
    • Texture2DCache.CS
      • Adds Dispose() function
    • UOTexture.cs
      • PushData(): adds keeptData optional parameter
      • Contains(): logic changes for getting from Unity
      • adds function GetDataAtPos(); //Used for Contains checks in texture using Unity's own texture data, instead of keeping a copy of the data in _data field
    • XBREffect.cs
      • public Vector2 _vectorSize; made public from private
      • XBREffect(): comments out // _textureSizeParam = Parameters["textureSize"];
      • SetSize(): comments out // _textureSizeParam.SetValue(_vectorSize);
  • ClassicUO/src/Renderer/fonts/
    • NONE
  • ClassicUO/src/shaders/
    • NONE
  • ClassicUO/src/Utility/
    • Exstentions.cs
      • ExtractToDirectory(): commented out //NOTE: Commented out because ZipArchive is not available in Unity's .NET version, it seems, and also not needed //NOTE: since this is only used by the Updater class
    • QueuedPool.cs
      • public readonly Stack<T> _pool; made public from private
    • UnsafeMemoryManager.cs
      • UnsafeMemoryManager(), AsPointer(), ToStruct(), As(), Reinterpret(), DoubleStruct() commented out
      • ToStruct(): //NOTE: __makeref and TypedReference usage breaks IL2CPP compiler, use Marshal class instead return Marshal.PtrToStructure<T>(ptr);
      • SizeOf(): //NOTE: __makeref and TypedReference usage breaks IL2CPP compiler, use Marshal class instead return Marshal.SizeOf<T>();
    • ZLib.cs
      • ZLib(): removes switch (SDL2.SDL.SDL_GetPlatform())
      • class Compressor64 removed
      • class CompressorUnix64 removed
  • ClassicUO/src/Utility/Collections/
    • NONE
  • ClassicUO/src/Utility/JSON/
    • NONE
  • ClassicUO/src/Utility/Logging/
    • NONE
  • ClassicUO/src/Utility/Platforms/
    • NONE
  • ClassicUO/src/Utility/StbTextedit/
    • NONE
  • ClassicUO/src/Utility/ZLib/
    • NONE
⚠️ **GitHub.com Fallback** ⚠️