Skip to content
Kapiainen edited this page Aug 21, 2014 · 31 revisions

Install

  1. Download the library archive
  2. Unpack the archive to /Skyrim/Data/

Use

NOTE: The files in this library should never be modified as that could cause issues when multiple mods are using the library!

The recommended way to use the library is to attach the API script (UILIB_N, where N is replaced by the version number) to the same form as the one that your script, which will make use of the library, is attached to. The functions starting with Show (ShowTextInput, ShowList, etc.) can then be called in the following manner:

UILIB_N UILib = ((Self as Form) as UILIB_N)
String sResult = UILib.ShowTextInput("Title", "Initial message")
Int iResult = UILib.ShowList("Title", sOptions, 0, 3) ;sOptions is an initialized string array
UILib.ShowNotification("A message", "#FF3300")
UILib.ShowNotificationIcon("Another message with an icon", "testicon.swf", 0, "#3399FF")

Icons used by ShowNotificationIcon should be placed in /Skyrim/Data/Interface/Exported/ since the icon path parameter is relative to the aforementioned folder.

All the menus support nested translations, which follow the pattern:

"$Enemy hits you for {" + myDamage + "} damage."

The different sections are then translated based on text files, which are placed in /Skyrim/Data/Interface/Translations/. The names of these text files follow the pattern MODNAME_LANGUAGE.txt, for example TestMod_ENGLISH.txt. The text files have to use the UTF16 Little Endian (aka UCS-2 Little Endian) with BOM encoding. These text files contain tab-separated string values that could look like this:

$Enemy hits you for {} damage.	Enemy hits you for {} damage.

The output in the game would then be, if myDamage is an integer with a value of 10:

Enemy hits you for 10 damage.

Package

SkyUILib is designed to have its files included in mods that use it. The files can be supplied as an additional package alongside a mod, but they can also be included in the main mod package. The latter option is recommended.

Include at least the following files depending upon the version of the library you are using in your mod:

Version 1

/Data/Interface/Exported/uilib/UILIB_1_notificationarea.swf
/Data/Interface/uilib/buttonArt.swf
/Data/Interface/uilib/UILIB_1_ListMenu.swf
/Data/Interface/uilib/UILIB_1_TextInputMenu.swf
/Data/Scripts/UILIB_1.pex
Clone this wiki locally