Difference between revisions of "Options Menu"
Jump to navigation
Jump to search
→Examples
imported>Threedee |
imported>Threedee |
||
Line 264: | Line 264: | ||
;=================================================== | ;=================================================== | ||
</source> | |||
*This next example shows how you would open a simple menu using a script attached to a MagicEffect form used by a Spell: | |||
<source lang="papyrus"> | |||
ScriptName OptionsMenuScript extends ActiveMagicEffect | |||
{ A template for a MagicEffect script that opens a simple menu.} | |||
Message Property OptionsMESG Auto ; The Message form that configures the menu buttons | |||
;============================================================== | |||
Event OnEffectStart(Actor akTarget, Actor akCaster) | |||
If akCaster == Game.GetPlayer(); Only the player can open the menu | |||
Menu() | |||
EndIf | |||
Dispel() | |||
EndEvent | |||
Function Menu() | |||
Int iButton = OptionsMESG.Show() ; Shows your menu. | |||
If iButton == 0 ; Mage | |||
Debug.Notification("Mage selected") | |||
ElseIf iButton == 1 ; Thief | |||
Debug.Notification("Thief selected") | |||
ElseIf iButton == 2 ; Warrior | |||
Debug.Notification("Warrior selected") | |||
EndIf | |||
EndFunction | |||
;============================================================== | |||
</source> | </source> | ||