Mardoxx_Sandbox - schlangster/skyui GitHub Wiki

##Widget Framework

Version 1.0

###Meter Widget

  • Make a new script MyMod_MyMeter.psc that contains scriptname MyMod_MyMeter extends SKI_MeterWidget
  • Attach MyMod_MyMeter to a quest (MyMeterInstance, for instance), set initial properties
  • Add MyMod_MyMeter property MyMeter auto to the script which will be controling the meter
  • Fill MyMeter with MyMeterInstance

All properties of SKI_MeterWidget can be accessed and modified at runtime and update accordingly.

For instance, to update the meter's percent, call myMeter.Percent = percent as float.

##MCM Demo

Version 1.0

##Software The following are needed.

  • Skyrim >= v1.6.89
  • Creation Kit >= v1.6.89
  • SKSE >= v1.06.02

Notes

It is usually best practice to prefix any objects, scripts, etc. with a unique identifier to avoid collisions with other mods.

SkyUI, for example, uses SKI_, here we'll use DEMO_.

Basic Menu

This example will outline how to create a very basic config menu with one toggle option.

Firstly we will create the papyrus interface to the config options.

All config menus must extend SKI_ConfigBase.

scriptname DEMO_ConfigMenu extends SKI_ConfigBase

Next we define the toggle option's ID.

int	_toggleOptionOID_B

It is advised that you postfix the option ID's as outlined in ..... for easy identification and uniqueness.

The initial state of the option is now defined

bool	_toggleValue		= false

Next we implement the OnPageReset event which will render the options for each page of the mod's config menu.

In it we add the toggle option by setting our option ID equal to the corresponding function.

event OnPageReset(string a_page)
	_toggleOptionOID_B = AddToggleOption("Toggle Me", _toggleValue)
endEvent

The next event we can handle is OnOptionDefault which is called when you press the reset default button

event OnOptionDefault(int a_option)
	if (a_option == _toggleOptionOID_B)
		_toggleValue = false
		SetToggleOptionValue(a_option, _toggleValue)
	endIf
endEvent

We now need to handle what happens when we select the option.

In this case, we want to toggle our boolean value.

event OnOptionSelect(int a_option)
	if (a_option == _toggleOptionOID_B)
		_toggleValue = !_toggleValue
		SetToggleOptionValue(a_option, _toggleValue)
	endIf
endEvent

We now need to save this script, as DEMO_ConfigMenu.psc, compile it, and attach it to a quest.

There are two properties you can set for the config menu script, we will only worry about ModName for now.

The ModName property is the name by which your config menu is displayed in the control panel.

Save the esp, add it to your mod list after SkyUI, launch skse_loader.exe, and open the Mod Config panel and you should see sometihng similar to this

images/demomenu/DemoMenu_BasicMenu_s.png

(Larger)

Papyrus ini

http://forums.bethsoft.com/topic/1435074-multithreaded-cpu-ini-tweaks-that-actually-work/page__view__findpost__p__22050362

Loose files

Data/Interface/bartermenu.swf
Data/Interface/containermenu.swf
Data/Interface/inventorymenu.swf
Data/Interface/map.swf
Data/Interface/magicmenu.swf
Data/Interface/quest_journal.swf
Data/Interface/skyui_cfg.txt
Data/Interface/skyui_translate.txt

Data/Scripts/SKI_ActiveEffectsWidget.pex
Data/Scripts/SKI_ConfigBase.pex
Data/Scripts/SKI_ConfigManager.pex
Data/Scripts/SKI_Main.pex
Data/Scripts/SKI_MeterWidget.pex
Data/Scripts/SKI_PlayerLoadGameAlias.pex
Data/Scripts/SKI_QuestBase.pex
Data/Scripts/SKI_StatusWidget.pex
Data/Scripts/SKI_WidgetBase.pex
Data/Scripts/SKI_WidgetManager.pex

Data/Scripts/Source/SKI_ConfigBase.psc
Data/Scripts/Source/SKI_MeterWidget.psc
Data/Scripts/Source/SKI_QuestBase.psc
Data/Scripts/Source/SKI_StatusWidget.psc
Data/Scripts/Source/SKI_WidgetBase.psc

and the folder
Data/Interface/skyui/