Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!

Tiny UI Fix for The Sims 3

SCREENSHOTS
5,103 Downloads 133 Thanks  Thanks 55 Favourited 22,657 Views
Picked Upload!   This is a picked upload! It showcases some of the best talent and creativity available on MTS and in the community.
Uploaded: 27th Dec 2023 at 8:48 PM
Updated: 26th Mar 2024 at 7:52 PM
Tiny UI Fix is a UI scaling and fixing mod for The Sims 3. It is distributed as a script that can generate a mod which scales the UI of The Sims 3 by an arbitrary multiplier.

Installation
Tiny UI Fix for TS3 is a PowerShell script, but it is also distributed as a Batch file and Shell script for easy usage on Windows and macOS respectively.

On Windows

On macOS

Advanced installation

Usage
Unlike a conventional mod for The Sims 3, Tiny UI Fix is not distributed as a package, instead it is distributed as a script which will generate a package—named tiny-ui-fix.package—specifically tailored for your installation of the game and your other active mods. Because of this, the script should be run again when core mods and mods that affect the UI are added or removed from your installation of the game.

After the script is started, the script is configured through a web-browser using the configurator, usually the configurator can be found at http://127.0.0.1:49603, but you can press enter when the script prompts you to to open the configurator.

The script prompting you to start the configurator:


What the configurator looks like:


The configurator is used as follows:
At the left, we have the "Configuration" panel, this is used to configure the active patchsets.

At the moment there are two options:
UI Scale: which is a multiplier which controls how big the game's UI is. A value of one would keep the UI the same size as it normally is, whereas a value of two would make the UI twice as big as usual.
Text Scale: which is a multiplier which controls how big the game's text is; by default, this is the same as the UI Scale.
This is independent of the UI Scale, so if the Text Scale is set to be much larger than the UI Scale: text may overlap other elements of the UI.

―――

Moving towards the right, we have the "Active Patchsets" panel, this is used to browse and enable/disable which patchsets are being used for the UI scaling.

A patchset is a bundle of patches that the Tiny UI Fix can apply when it scales the UI, they are effectively mods for the Tiny UI Fix. Additional patchsets (if they are available) can be placed in the "Patchsets" folder of the "tiny-ui-fix-for-ts3" folder that the script resides in.

Every patchset is uniquely identified by an ID.

If you are a mod author, and you want to make someone else's mod compatible with the Tiny UI Fix: a patchset may be the easiest/least-disruptive way to do so.

―――

Moving again to the right, we have the "Patchset Load-order" panel, this is used to control the order in which the Tiny UI Fix applies the patchsets; patchsets with a lower position-number are applied before patchsets with a higher position-number. Generally, the patchset load-order doesn't matter unless two-or-more patchsets conflict with one another (such as if they applied patches to the same thing).

―――

Lastly, we're now at the rightmost panel, which is the "Actions" panel, this is used to get the Tiny UI Fix to actually do something.
"Generate package" will make the script start generating the tiny-ui-fix.package file.
"Export load-order" will write the current patchset load-order to the "Import/Export" text-box.
"Import load-order" will read and use a patchset load-order from the "Import/Export" text-box.
"Check for updates" will check if there are any updates available for the Tiny UI Fix.
"Cancel" will cancel any changes that have been made, and will cause the script to exit.

―――

The script uses a library with an s3pi-compatible interface for manipulating Sims 3 package files.
If the script cannot find such a library on your device, it will offer to download Peter Jones's s3pi library. On Windows, if you have S3PE installed its copy of s3pi will be used.

Compatibility
Tiny UI Fix has been developed for and tested with version 1.67 of The Sims 3, but it should be compatible with version 1.69, and version 1.70.

Thanks to the dynamic nature with which this mod is generated, it should be compatible with the vast majority of mods, including core mods, such as the NRaas Industries suite of mods.
However, mods which perform hard-coded adjustments to UI coordinates or dimensions via C# DLLs will require a patch for full compatibility, otherwise some elements of the game's UI may be incorrectly positioned or sized.
Such a patch is included with the Tiny UI Fix for the NRaas Industries suite of mods.

If you are a mod author and you would like to make your mod compatible with the Tiny UI Fix's UI scaling, A—thank you , B—please see the For mod authors section of this document.

Known issues
  • Some icons and graphics are visually stretched in one dimension.
  • Some icons disappear when they are selected.
  • Scrollbars that would usually scroll smoothly when the arrows are clicked do not scroll smoothly.
  • The options menu is @#$%&!ed.
  • When LazyDuchess's Smooth Patch package is active, after scrolling through clothing in Create A Sim, the rows of clothing icons may not snap perfectly back into place.
  • If Windows' "Controlled folder access" setting is enabled, and the Tiny UI Fix script is used to temporarily allow PowerShell to access controlled folders: if multiple instances of the script are run at around the same time, the script that allowed PowerShell to access controlled folders may disallow PowerShell from accessing controlled folders before the other instances of the script have finished writing, which could cause their writing to fail.

Source code
The Tiny UI Fix is open-source; its source-code can be found on GitHub at https://github.com/just-harry/tiny-ui-fix-for-ts3

How it works
The UI of the Sims 3 is composed of four distinct layers/components: XML layout files which specify the structure and content of the UI; CSS-based style files which specify the sizing, space, and style of text; .NET assemblies (C# DLLs) which can manipulate the UI controls/windows specified by the XML layout files; the game's C++ engine which actually draws the UI and handles interaction.
When modding The Sims 3, we can toy about with the first three of those.

Thus, scaling the UI requires the following:


For mod authors
Making your mod compatible with Tiny UI Fix

If your mod relies on hard-coded adjustments being made to the coordinates or dimensions of a UI control via a C# DLL those adjustments will be incorrect when the UI is scaled.
The Tiny UI Fix has been designed to make it easy for other mods to integrate with the Tiny UI Fix's UI scaling, so no changes are needed to your mod's build process, nor is an assembly reference required, nor does the load-order of the mods matter.

To integrate with the UI scaling added by the Tiny UI Fix: define a class named TinyUIFixForTS3Integration in a namespace of your mod, and then in that class define a static member named getUIScale, the type of the getUIScale member should be a delegate-type that takes no parameters and returns a float, make the default value for the getUIScale member a delegate that returns 1.0f (that way, if the Tiny UI Fix isn't present, your UI scale will be usual scale of 1x).

To illustrate, your code should look something like:
Code:
namespace YourCoolMod
{
	public static class TinyUIFixForTS3Integration
	{
		public delegate float FloatGetter ();

		public static FloatGetter getUIScale = () => 1f;
	}
}


which you would then use like so:
Code:
namespace YourCoolMod
{
	public class YourEventHandler
	{
		public void OnChangeOfAreaOfControl (WindowBase sender, UIAreaChangeEventArgs eventArgs)
		{
			sender.Position += 50f * TinyUIFixForTS3Integration.getUIScale();
		}
	}
}


And that's it!

―――

Some technical notes:
The Tiny UI Fix offers the following guarantees:
  • The delegates that it sets for the getUIScale field will always be non-null, and the value that those delegates return will always satisfy the following condition: uiScale > 0f && uiScale < float.PositiveInfinity, that is, the UI-scale will always be a positive number. You don't have to worry about dividing-by-zero or infinity values or NaN values or anything like that.
  • If a .NET module defines multiple TinyUIFixForTS3Integration types, then the order in which they are integrated in is the order in which they are sorted in ascending order by StringComparer.Ordinal.Compare(a.FullName, b.FullName).
  • The order in which .NET modules and .NET assemblies are integrated in is undefined.

Licensing
Tiny UI Fix for The Sims 3, and its accompanying documentation, is distributed under the Boost Software License, Version 1.0.

Acknowledgements
Jb Evain and all contributors for the Mono.Cecil library, which is used for .NET assembly manipulation.
Peter Jones, Inge Jones, and all contributors for the s3pi library, which is used as the default choice for Sims 3 package manipulation.