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; }
removedprivate
setter - Adds
public static event Action SceneChanged;
andpublic static void InvokeSceneChanged()
-
Load()
:- Commented out
UltimaLive.Enable();
- Commented out
UoAssist.Start();
- Commented out
-
- CUOEnvironment.cs
-
public static string ExecutablePath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
removedreadonly
-
- GameController.cs
- Adds
using ClassicUO.Game.UI.Controls;
- Adds variables
public UltimaBatcher2D Batcher => _uoSpriteBatch;
andpublic static UnityEngine.TouchScreenKeyboard TouchScreenKeyboard;
-
GameController()
: comments out_graphicDeviceManager.PreparingDeviceSettings += (sender, e) => e.GraphicsDeviceInformation.PresentationParameters.RenderTargetUsage = RenderTargetUsage.DiscardContents;
-
Initialize()
: comments outif (_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;
- Adds
-
UnloadContent
:- made
public
fromprotected
- /
/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
- made
-
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 toSDL.SDL_SetWindowBordered()
andSDL.SDL_GetCurrentDisplayMode()
- Can it be removed?
-
Update()
:- Comments out
Mouse.Update()
for newMouseUpdate()
- Adds call to new
UnityInputUpdate();
- Comments out
-
HandleSDLEvent()
: comments out block inside ofcase SDL.SDL_EventType.SDL_KEYUP
forif (e->key.keysym.sym == SDL_Keycode.SDLK_PRINTSCREEN)
- Adds a number of unity private functions to help support input:
MouseUpdate()
,UnityInputUpdate()
,HandleChatMode()
,ConvertUnityMousePosition()
andSimulateMouse()
- Adds
- Client.cs
- ClassicUO/src/Configuration/
- Profile.cs
-
public bool UseXBR { get; set; } = false;
from true -
ReadGumps()
:GUMP_TYPE.GT_ASSISTANTMACROBUTTON
andGUMP_TYPE.GT_ASSISTANTHOTKEYBUTTON
added toswitch (type)
-
- ProfileManager.cs
- adds variable
public static System.Action ProfileLoaded;
-
Load()
:ProfileLoaded?.Invoke();
added
- adds variable
- Settings.cs
- adds variable
[JsonProperty("internal_assistant")] public bool EnableInternalAssistant { get; set; } = true;
- adds variable
- Profile.cs
- ClassicUO/src/Game/
- CircleOfTransparency.cs
-
public static void Dispose()
function added
-
- GameCursor.cs
-
GameCursor()
: commented outif (pixels != null && pixels.Length != 0)
block -
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
public void Dispose() function
added
-
- World.cs
-
Clear()
:Land.Dispose();
call added
-
- CircleOfTransparency.cs
- ClassicUO/src/Game/Data/
- NONE
- ClassicUO/src/Game/GameObjects/
- DragEffect.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- Land.cs
-
public static void Dispose() function
added
-
- DragEffect.cs
- ClassicUO/src/Game/GameObjects/Views/
- AnimatedEffectView.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- ItemView.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- LightningEffectView.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- MobileView.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- MovingEffectView.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- MultiView.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- StaticView.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- TileView.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- AnimatedEffectView.cs
- 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)
vsprivate static Control GetMouseOverControl(Point position)
-
- AnimatedStaticsManager.cs
- ClassicUO/src/Game/Map/
- NONE
- ClassicUO/src/Game/Scenes/
- GameScene.cs
- Added viewport variables:
public static int MinimumViewportWidth = 200;
andpublic static int MinimumViewportHeight = 300;
- Added joystick variables:
public Vector2 JoystickInput;
andpublic float JoystickRunThreshold;
-
Load()
: use newMinimumViewportWidth
andMinimumViewportHeight
variables -
Unload()
: added dispose forCircleOfTransparency.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)
- Commented out if block:
-
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
vsShaderHuesTraslator.GetHueVector
- Added viewport variables:
- LoginScene.cs
-
Unload()
://NOTE: We force the login socket to disconnect in case it hasn't already been disposed
-
- GameScene.cs
- ClassicUO/src/Game/UI/
- Tooltip.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- Tooltip.cs
- ClassicUO/src/Game/UI/Controls/
- AlphaBlendControl.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- Button.cs
- Added variables for enlarging buttons:
private bool enlarged;
andprivate const int smallButtonThreshold = 12;
- added function:
ToggleSize()
-
ButtonGraphicNormal()
: addedif (_textures[NORMAL] == null) return;
-
ButtonGraphicPressed()
: addedif (_textures[NORMAL] == null) return;
-
ButtonGraphicOver()
: addedif (_textures[NORMAL] == null) return;
-
Update()
: added//NOTE: Added for enlarging small buttons in MobileUO ToggleSize(UserPreferences.EnlargeSmallButtons.CurrentValue == (int) PreferenceEnums.EnlargeSmallButtons.On);
- Added variables for enlarging buttons:
- ButtonTileArt.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- Checkbox.cs
- Added for Assistant:
public ushort Hue
- Added for Assistant:
- Control.cs
- Added variables
protected const int MOBILE_CLOSE_BUTTON_ID = -9999;
andpublic 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()
- Added variables
- GumpPic.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- GumpPicTiled.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- GumpPicWithWidth.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- HitBox.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- HtmlControl.cs
-
OnMouseUp()
: addsif (UnityEngine.Application.isMobilePlatform)
toUnityEngine.Application.OpenURL(result.Link);
-
- ItemGump.cs
- Added variable:
public static bool PixelCheck = false;
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
Contains()
: addedPixelCheck
to parameters:if (texture.Contains(x, y, PixelCheck)) and if (texture.Contains(x - 5, y - 5, PixelCheck))
- Added variable:
- Line.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- NiceButton.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- ResizePic.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- StaticPic.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- StbTextBox.cs
- added
using ClassicUO.Game.UI.Gumps.Login;
-
OnMouseDown()
://NOTE: Show touchscreen keyboard when abstract text box is selected
- added
- TextureControl.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- WorldViewport.cs
-
Draw()
: commented outif (_scene.UseAltLights)
andelse if (_scene.UseLights)
-
- AlphaBlendControl.cs
- ClassicUO/src/Game/UI/Gumps/
- BuffGump.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- Gump.cs
- Added enums:
GT_ASSISTANTMACROBUTTON
,GT_ASSISTANTHOTKEYBUTTON
- Added variables:
private Button closeButton;
andpublic static bool CloseButtonsEnabled;
- added functions for making sure close button is always on top:
OnChildAdded()
,InitCloseButton()
,UpdateCloseButton()
-
Dispose()
: added close button disposeif (closeButton != null && closeButton.IsDisposed == false)
- Added enums:
- HealthBarGump.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- InfoBarGump.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- MiniMapGump.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- ModernBookGump.cs
-
OnMouseDown()
://NOTE: Show touchscreen keyboard when abstract text box is selected
-
- PaperdollGump.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- ResizableGump.cs
-
ResizableGump()
://Upscale resize button on mobile
-
- ShopGump.cs
-
GenerateVirtualTextures()
: added parameterkeepData = true
toGumpsLoader.Instance.GetTexture()
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
-
- SystemChatControl.cs
-
Dispose()
: addedforeach (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()
: addedif (readyToCreateTexture)
- added variables:
- WorldViewportGump.cs
- added variable:
public WorldViewport Viewport => _viewport;
-
WorldViewportGump()
: added//Upscale resize button on mobile
-
Update()
: usingGameScene.MinimumViewportWidth
andGameScene.MinimumViewportHeight
variables -
ResizeGameWindow()
: usingGameScene.MinimumViewportWidth
andGameScene.MinimumViewportHeight
variables
- added variable:
- BuffGump.cs
- 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
vsprivate class PasswordStbTextBox : StbTextBox
-
public enum Buttons
vsprivate enum Buttons
- LoginGump.cs
- ClassicUO/src/Input/
- Keyboard.cs
- added
private
to setters forAlt
,Shift
andCtrl
variables- look up git blame to see why
- added
- Keyboard.cs
- ClassicUO/src/Interfaces/
- NONE
- ClassicUO/src/IO/
- UOFile.cs
-
Dispose()
: sets_accessor
and_file
to null
-
- UOFileLoader.cs
-
GetTexture()
: adds optionalkeepData
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
-
- UOFile.cs
- ClassicUO/src/IO/Audio/
- Sound.cs
- adds variable:
protected virtual uint DistortionFix => 0;
-
Play()
: adds distortion fix -
Stop()
: sets volume to0.0f
- adds variable:
- UOMusic.cs
-
Update()
: commented outOnBufferNeeded();
- 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
- adds variable:
- Sound.cs
- 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
- adds
- ArtLoader.cs
-
GetTexture()
: addskeepData
parameter -
ClearResources()
: adds dispose/nulling
-
- FontsLoader.cs
- adds
ClearResources();
override
- adds
- GumpsLoader.cs
-
GetTexture()
: addskeepData
parameter - adds
ClearResources();
override
-
- HuesLoader.cs
- adds
ClearResources();
override
- adds
- LightsLoader.cs
-
GetTexture()
: addskeepData
parameter - adds
ClearResources();
override
-
- MapLoader.cs
- adds
ClearResources();
override
- adds
- MultiLoader.cs
- adds
ClearResources();
override
- adds
- MultiMapLoader.cs
- adds
ClearResources();
override
- adds
- ProfessionLoader.cs
- adds
ClearResources();
override
- adds
- SkillsLoader.cs
- adds
ClearResources();
override
- adds
- 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 - T
ryParseConfigLine()
:- 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
- adds
GetTrueFileName()
function -
ClearResources()
: adds dispose/nulling
-
- SpeechesLoader.cs
- adds
ClearResources();
override
- adds
- TexmapsLoader.cs
-
GetTexture()
: addskeepData
parameter - adds
ClearResources();
override
-
- TileDataLoader.cs
- adds
ClearResources();
override
- adds
- AnimationsLoader.cs
- ClassicUO/src/Network/
- PackerHandlers.cs
-
OpenUrl()
: addsif (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
- adds variable:
- PackerHandlers.cs
- ClassicUO/src/Network/Encryption/
- NONE
- ClassicUO/src/Renderer/
- Batcher2D.cs
-
UltimaBatcher2D
vsUltimaBatcher2D_Unused
- Replaced by UnityBatcher.cs's
UltimaBatcher2D
?
- Replaced by UnityBatcher.cs's
-
ShaderHueTranslator.SHADER_SHADOW
vsShaderHuesTraslator.SHADER_SHADOW
-
StandardEffect()
commented out -
GetResource()
return new byte[1];
(used by no longer usedUltimaBatcher2D
)
-
- Fonts.cs
- removes
"ClassicUO.Renderer.fonts."
and".xnb"
from fonts
- removes
- RenderedText.cs
-
ShaderHueTranslator.GetHueVector
vsShaderHuesTraslator.GetHueVector
- Adds
Dispose()
function
-
- ShaderHueTranslator.cs
- class renamed
internal static class ShaderHueTranslator
vsinternal 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
- class renamed
- SpriteFont.cs
-
Create()
: logic to load resource via Unityvar bytes = UnityEngine.Resources.Load<UnityEngine.TextAsset>(name).bytes;
-
- Texture2DCache.CS
- Adds
Dispose()
function
- Adds
- 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);
-
- Batcher2D.cs
- 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()
: removesswitch (SDL2.SDL.SDL_GetPlatform())
- class
Compressor64
removed - class
CompressorUnix64
removed
-
- Exstentions.cs
- 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