Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

稻草人吃软饭染发 #90

Open
wants to merge 113 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
d32ebbf
Pretend to be skyui 5.2
Odie Sep 7, 2018
b6eb4c2
Fixes inventorymenu.swf crash
Odie Sep 7, 2018
fc518c0
Catches up files for quest_journal.swf to 5.2
Odie Sep 8, 2018
dc0330b
quest_journal updated to match changes to VR version
Odie Sep 11, 2018
192c924
Fixes onCategoryButtonPress() and UpdatePermissions()
Odie Sep 11, 2018
473a8ab
Merge branch 'fixes/save-crash'
Odie Sep 11, 2018
dd48cde
Adds VR button art
Odie Sep 12, 2018
ee0e225
[WIP] slight refactoring of MappedButton
Odie Sep 12, 2018
7f05b91
Moves all new icons into ButtonArt
Odie Sep 12, 2018
16750cd
Setting ButtonArt by name now works
Odie Sep 13, 2018
87c87f4
Quest Page button prompts updated (for vive only)
Odie Sep 13, 2018
9bc8465
SystemPage can now use VR button art
Odie Sep 13, 2018
ea2bfbe
Moves ButtonArt picking functions into skyui.defines.Input
Odie Sep 13, 2018
ecddd17
Fixes bug where stats page categories grows infinitely
Odie Sep 14, 2018
abb6cb1
Fixes SystemPage save/load menu refresh bug
Odie Sep 14, 2018
c6c64e8
Inventory Menu now using VR icons
Odie Sep 14, 2018
4395f6d
Merge branch 'feature/vr-icons'
Odie Sep 15, 2018
abc512e
Adds a flash js script t6o build all skyui swfs
Odie Sep 15, 2018
97bf41a
Fixes bug where quest_journal always resets to quest page
Odie Sep 15, 2018
f4daf8c
Ports over containermenu changes from SE => VR
Odie Sep 15, 2018
64079bf
Adds ability to "switch tabs" in the container menu
Odie Sep 16, 2018
9c49c10
Merge branch 'feature/containermenu'
Odie Sep 17, 2018
a331abc
Better inventorymenu primary button prompt
Odie Sep 17, 2018
c8582c5
Store & Restore inventory list position by category
Odie Sep 17, 2018
16dbdc2
Container menu tab switching now rate limited separately
Odie Sep 18, 2018
6f0a3a9
Container menu sorting now working
Odie Sep 18, 2018
982100e
Sorting input window now adjusted based on platform
Odie Sep 19, 2018
a65907e
Sort toggling input handling moved into TabularList
Odie Sep 19, 2018
418d2a8
Bartermenu now working
Odie Sep 19, 2018
6eadc43
Fixes broken quantity slider when in containermenu
Odie Sep 19, 2018
7b8a3d9
Crafting menu now working
Odie Sep 21, 2018
9a0692b
Magic menu appears to be working
Odie Sep 22, 2018
d11bdf1
Gift menu now working
Odie Sep 23, 2018
9462e14
Restores inventory menu fade
Odie Sep 25, 2018
79101e0
Restores magic menu fade
Odie Sep 25, 2018
61c79aa
Fixes item card fading in inventory menu
Odie Sep 25, 2018
ba011ea
Debug log can now be used to add indentation
Odie Sep 25, 2018
65264a4
Tweaks the position of the inventory list
Odie Sep 25, 2018
52d00a8
Enlarge MappedButton text & vertical centering
Odie Sep 26, 2018
a2c8490
Fixes up button prompts on all screens
Odie Sep 26, 2018
1a6769e
Adds better action prompts for container and inventory menu
Odie Sep 27, 2018
e4e3cf4
Removes irrelevant buttons prompts from barter menu
Odie Sep 27, 2018
236adc0
ItemCard now uses MappedButton to bring in VR icons
Odie Sep 28, 2018
3c45cdb
Vertically center inventory list entries
Odie Sep 28, 2018
c879868
Better vertical centering of bottombar contents
Odie Sep 29, 2018
a8598a1
Fixes quest page button prompt visibility
Odie Sep 29, 2018
4094abf
Stops cp-built-files from copying files not to be replaced
Odie Sep 29, 2018
c11df10
Updates config.txt font to more readable size for VR
Odie Sep 29, 2018
64089ee
Don't build files we won't want packaged
Odie Sep 29, 2018
9daac97
Fixes itemcard defaulting to dragonfont *again*
Odie Sep 29, 2018
0e75803
Updates inventory list animation curve
Odie Sep 29, 2018
d9532f8
Quest_Journal tab switching now uses VR icons
Odie Sep 29, 2018
52613a8
Merge branch 'fixes/spit-n-polish'
Odie Sep 29, 2018
d157799
Adds Oculus button art
Odie Oct 1, 2018
6d73d25
Catches up papyrus scripts up to v5.2
Odie Oct 4, 2018
ef072a3
Actually catches papyrus scripts up to v5.2
Odie Oct 5, 2018
ca31c03
Disables map and fav menu version checking
Odie Oct 5, 2018
55cffbc
Merge branch 'fixes/spit-n-polish'
Odie Oct 6, 2018
bc68ee5
Fixes broken help texts
Odie Oct 8, 2018
e700a7c
Known dragon words will now show its pronunciation after a 1.5s delay
Odie Oct 13, 2018
127d511
Properly generate correct shout spelling
Odie Oct 14, 2018
d4fed7c
Merge branch 'feature/16/dragon-shout-pronunciation'
Odie Oct 14, 2018
62cdd19
Store & Restore crafting list position by category
Odie Oct 20, 2018
0859d4d
Fixes bug where shout pronunciation is not shown sometimes
Odie Nov 12, 2018
3b88871
Fixes missing armor rating bug
Odie Nov 13, 2018
d857643
Updates readme to be more useful
Odie Dec 12, 2018
198a00a
Create LICENSE
Odie Dec 12, 2018
38255b5
Import example plugin project
Odie Oct 3, 2021
1b0f6f3
Now has a minimal, working SKSEVR plugin
Odie Oct 4, 2021
ac77a84
Adds luajit and lua functions for FormDB
Odie Oct 10, 2021
fae9cfc
Finished most of the data management wiring
Odie Oct 11, 2021
627cf05
"New" icon now being displayed
Odie Oct 12, 2021
a9632ca
Now able to display and clean up the new item icon
Odie Oct 12, 2021
a42cd8b
Removed debug printfs
Odie Oct 12, 2021
a70f265
Various usability fixes
Odie Oct 15, 2021
64cdc56
Fixes arrow type readout in inventory screens
Odie Oct 30, 2021
2192dc8
Fixes stat page to scroll the detail data pane
Odie Oct 30, 2021
ad83f51
Adds missing file SkyUI_SE.esp
Odie Oct 30, 2021
bd472f6
SteamVR keyboard now working
Odie Oct 30, 2021
e270b8f
Now able to print out ControllerState data
Odie Nov 2, 2021
826da94
Can now generate and print out widget state
Odie Oct 15, 2018
2becb83
[Refactor] move generic input processing into skyui.VRInput
Odie Oct 15, 2018
17e2149
Now able to generate events from inputs
Odie Oct 16, 2018
0a7d699
Adds functions to determine touched quadrant
Odie Oct 16, 2018
2af8fc6
Input system now able to detect swipes
Odie Oct 17, 2018
efdb7f1
Fixes up quest_journal debug display
Odie Nov 3, 2021
833d7a3
VRInput appears to be mostly working again
Odie Nov 3, 2021
41277e4
Now dispatching ControllerState from skyui's dll
Odie Nov 4, 2021
5b3aa20
Now able to receive input events in InventoryMenu
Odie Nov 7, 2021
dd05b77
InventoryMenu searchbox now working
Odie Nov 8, 2021
ac0fe60
Searching working in MagicMenu and ContainerMenu
Odie Nov 9, 2021
bd9ec69
Fetches controller name from OpenVR
Odie Nov 9, 2021
3fe40df
Search key working in InventoryMenu
Odie Nov 10, 2021
5551ff7
Index controller should work for ContainerMenu and MagicMenu now
Odie Nov 10, 2021
2eefbde
Adds "search" button art for Index
Odie Nov 11, 2021
a163d86
Adds custom INI
Odie Nov 12, 2021
a8e8042
Enables search box for GiftMenu
Odie Nov 12, 2021
05e5bf0
Enabled search box for CraftingMenu
Odie Nov 12, 2021
3b1dc82
Moves the "search" button prompt so it's shown more often
Odie Nov 12, 2021
b845f74
Enable search box for BarterMenu
Odie Nov 12, 2021
a2c1718
Disables debug logs
Odie Nov 12, 2021
e9e36f0
Better oculus support
Odie Nov 13, 2021
4853bf2
Build against DLL runtime
Odie Nov 13, 2021
a1c2311
[VRInput] Enlarge "center" region
Odie Nov 13, 2021
8078fa5
Enable oculus and similar controllers
Odie Nov 14, 2021
5ff6271
Merge branch 'feature/58/keyboard'
Odie Nov 14, 2021
8f1e523
Fixes negative numbers transfer (Papyrus => Scaleform) bug
Odie Nov 17, 2021
2cafede
Adds a pack-release script
Odie Nov 20, 2021
74120d3
Better keybinding for Oculus Quest 2
Odie Nov 30, 2021
9e0ddde
Settings file is now read via lua
Odie Dec 3, 2021
932dae1
Move to using config files to determine action keybinds
Odie Dec 6, 2021
95c3d19
luajit now compiled with PlatformToolset v141
Odie May 10, 2023
bbe0c32
Fixes crash problem with higgs
Odie May 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
compile-error.txt
10 changes: 10 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[submodule "sksevr_plugin/skse"]
path = sksevr_plugin/skse
url = [email protected]:Odie/sksevr-mirror.git
[submodule "sksevr_plugin/common"]
path = sksevr_plugin/common
url = [email protected]:Odie/sksevr-common-mirror.git
[submodule "sksevr_plugin/luajit"]
path = sksevr_plugin/luajit
url = https://luajit.org/git/luajit.git
ignore = dirty
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2012 schlangster

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
52 changes: 44 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
Related repositories
SkyUI - VR
----------

This repository hosts the source and the packaged releases for a working
version of SkyUI (and MCM) for SkyrimVR.

### Getting SkyUI

To get the mod, head on over to
[the release page](https://github.com/Odie/skyui-vr/releases/) and grab the
lastest version. All you need is the .7z file. (Ignore the source code download
links.)

### Prerequsite
Make sure [SKSE VR](http://skse.silverlock.org/) is installed. (Don't forget
the .pex files!)

### Installation

For MO2 users, use the "Install from file" icon in the toolbar.

For Vortex users, drop the .7z file over the vortex window.


VR specific controls
--------------------
### Unofficial UI SDK
https://github.com/Mardoxx/skyrimui

Disclaimer
----------
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Currently, there are certain limitations to how the UIs in the game can process
inputs from the VR controllers. At the moment, the UI seems to mostly receive
up/down/right/left signals from the game. This makes operating a more complex
UI like SkyUI a little difficult, but not impossible.

Here's what you need to know.

### Toggle trade direction
In the barter menu or the gift menu, keep hitting "left" until you've reached
the first item on the category list (titled "All"). Hit "left" again and the
trade direction should toggle.

Thanks to MIT license for providing this standard disclaimer.
### Sorting items
This applies to any screen where you can see an inventory list. With the first
item in the list selected (or nothing selected), hit "up" once to move the
sorted column to the next one. Hit "up" twice in quick succession to change the
sort direction.

Thanks to Bethesda Game Studios for creating The Elder Scrolls V: Skyrim, providing the base content and allowing us to mod it.
For trackpad users, trying using "slow swipe" and "fast swipe" to differentiate
between these two actions. The number of controller vibrations indicates how many
"up" events the game has registered.
Empty file added build/exported/skyui/.gitkeep
Empty file.
Empty file.
12 changes: 6 additions & 6 deletions build/skyui/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ itemcard.yOffset = 0


; =====================================================================================================================
[ItemList]
[ItemList]
; =====================================================================================================================
quantityMenu.minCount = 6 ; Number of items required to trigger quantity dialog. 0 is disabled


; =====================================================================================================================
[Appearance]
[Appearance]
; =====================================================================================================================
icons.category.source = 'skyui/icons_category_psychosteve.swf'

Expand All @@ -50,7 +50,7 @@ colors.negative.disabled = 0x800000


; =====================================================================================================================
[ListLayout]
[ListLayout]
; =====================================================================================================================
vars.a_textBorder.value = <0, 0, 1.1, 0> ; left right top bottom
vars.n_iconSize.value = 18
Expand All @@ -63,7 +63,7 @@ defaults.entry.textFormat.align = right
defaults.entry.textFormat.bold = false
defaults.entry.textFormat.italic = false
defaults.entry.textFormat.underline = false
defaults.entry.textFormat.size = 14
defaults.entry.textFormat.size = 18
defaults.entry.textFormat.letterSpacing = 0.8
defaults.entry.textFormat.kerning = false
defaults.entry.textFormat.leftMargin = 0
Expand All @@ -76,7 +76,7 @@ defaults.label.textFormat.align = right
defaults.label.textFormat.bold = false
defaults.label.textFormat.italic = false
defaults.label.textFormat.underline = false
defaults.label.textFormat.size = 12
defaults.label.textFormat.size = 16
defaults.label.textFormat.letterSpacing = 0.8
defaults.label.textFormat.kerning = false
defaults.label.textFormat.leftMargin = 0
Expand Down Expand Up @@ -757,4 +757,4 @@ layouts.smithingListLayout.name = 'SmithingListLayout'
layouts.smithingListLayout.views = <defaultCraftingView>

layouts.alchemyListLayout.name = 'AlchemyListLayout'
layouts.alchemyListLayout.views = <alchemyView>
layouts.alchemyListLayout.views = <alchemyView>
7 changes: 4 additions & 3 deletions dist/Data/Interface/skyui/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,24 @@ columns.itemNameColumn.label.textFormat.align = left

columns.itemNameColumn.state1.label.text = '$NAME'
columns.itemNameColumn.state1.entry.text = @text
columns.itemNameColumn.state1.sortAttributes = <newItem, text>
columns.itemNameColumn.state1.sortOptions = {ASCENDING | CASEINSENSITIVE}

columns.itemNameColumn.state2.label.text = '$EQUIPPED'
columns.itemNameColumn.state2.entry.text = @text
columns.itemNameColumn.state2.sortAttributes = <isEquipped, equipState, text>
columns.itemNameColumn.state2.sortAttributes = <newItem, isEquipped, equipState, text>
columns.itemNameColumn.state2.sortOptions = <{DESCENDING | NUMERIC}, {DESCENDING | NUMERIC}, {ASCENDING | CASEINSENSITIVE}>
columns.itemNameColumn.state2.playerOnly = true

columns.itemNameColumn.state3.label.text = '$STOLEN'
columns.itemNameColumn.state3.entry.text = @text
columns.itemNameColumn.state3.sortAttributes = <isStolen, text>
columns.itemNameColumn.state3.sortAttributes = <newItem, isStolen, text>
columns.itemNameColumn.state3.sortOptions = <{DESCENDING | NUMERIC}, {ASCENDING | CASEINSENSITIVE}>
columns.itemNameColumn.state3.playerOnly = true

columns.itemNameColumn.state4.label.text = '$ENCHANTED'
columns.itemNameColumn.state4.entry.text = @text
columns.itemNameColumn.state4.sortAttributes = <isEnchanted, text>
columns.itemNameColumn.state4.sortAttributes = <newItem, isEnchanted, text>
columns.itemNameColumn.state4.sortOptions = <{DESCENDING | NUMERIC}, {ASCENDING | CASEINSENSITIVE}>


Expand Down
107 changes: 98 additions & 9 deletions dist/Data/Scripts/Source/SKI_ConfigBase.psc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ int property STATE_RESET = 1 autoReadonly
int property STATE_SLIDER = 2 autoReadonly
int property STATE_MENU = 3 autoReadonly
int property STATE_COLOR = 4 autoReadonly
int property STATE_INPUT = 5 autoReadonly

int property OPTION_TYPE_EMPTY = 0x00 autoReadonly
int property OPTION_TYPE_HEADER = 0x01 autoReadonly
Expand All @@ -19,6 +20,7 @@ int property OPTION_TYPE_SLIDER = 0x04 autoReadonly
int property OPTION_TYPE_MENU = 0x05 autoReadonly
int property OPTION_TYPE_COLOR = 0x06 autoReadonly
int property OPTION_TYPE_KEYMAP = 0x07 autoReadonly
int property OPTION_TYPE_INPUT = 0x08 autoReadonly

int property OPTION_FLAG_NONE = 0x00 autoReadonly
int property OPTION_FLAG_DISABLED = 0x01 autoReadonly
Expand Down Expand Up @@ -56,6 +58,7 @@ int[] _colorParams
int _activeOption = -1

string _infoText
string _inputStartText

bool _messageResult = false
bool _waitForMessage = false
Expand Down Expand Up @@ -741,7 +744,7 @@ bool function ShowMessage(string a_message, bool a_withCancel = true, string a_a
endWhile

UnregisterForModEvent("SKICP_messageDialogClosed")

return _messageResult
endFunction

Expand All @@ -765,7 +768,7 @@ function OpenConfig()
endFunction

function CloseConfig()
OnConfigClose()
OnConfigClose()
ClearOptionBuffers()
_waitForMessage = false

Expand All @@ -780,14 +783,14 @@ endFunction
function SetPage(string a_page, int a_index)
_currentPage = a_page
_currentPageNum = 1+a_index

; Set default title, can be overridden in OnPageReset
if (a_page != "")
SetTitleText(a_page)
else
SetTitleText(ModName)
endIf

ClearOptionBuffers()
_state = STATE_RESET
OnPageReset(a_page)
Expand All @@ -805,18 +808,18 @@ int function AddOption(int a_optionType, string a_text, string a_strValue, float
if (pos == -1)
return -1 ; invalid
endIf

_optionFlagsBuf[pos] = a_optionType + a_flags * 0x100
_textBuf[pos] = a_text
_strValueBuf[pos] = a_strValue
_numValueBuf[pos] = a_numValue

; Just use numerical value of fill mode
_cursorPosition += _cursorFillMode
if (_cursorPosition >= 128)
_cursorPosition = -1
endIf

; byte 1 - position
; byte 2 - page
return pos + _currentPageNum * 0x100
Expand All @@ -827,7 +830,7 @@ function AddOptionST(string a_stateName, int a_optionType, string a_text, string
Error("State option name " + a_stateName + " is already in use")
return
endIf

int index = AddOption(a_optionType, a_text, a_strValue, a_numValue, a_flags) % 0x100
if (index < 0)
return
Expand Down Expand Up @@ -868,7 +871,7 @@ function WriteOptionBuffers()
endif
i += 1
endWhile

UI.InvokeIntA(menu, root + ".setOptionFlagsBuffer", _optionFlagsBuf)
UI.InvokeStringA(menu, root + ".setOptionTextBuffer", _textBuf)
UI.InvokeStringA(menu, root + ".setOptionStrValueBuffer", _strValueBuf)
Expand Down Expand Up @@ -1114,3 +1117,89 @@ function RemapKey(int a_index, int a_keyCode, string a_conflictControl, string a
OnOptionKeyMapChange(option, a_keyCode, a_conflictControl, a_conflictName)
endIf
endFunction

function OnOptionInputOpen(Int a_option)
{Called when a text input option has been selected}
endFunction

function OnInputOpenST()
{Called when a text input state option has been selected}
endFunction

function OnOptionInputAccept(Int a_option, String a_input)
{Called when a new text input has been accepted}
endFunction

function OnInputAcceptST(String a_input)
{Called when a new text input has been accepted for this state option}
endFunction

function SetInputOptionValue(Int a_option, String a_value, Bool a_noUpdate)
Int index = a_option % 256
Int type = _optionFlagsBuf[index] % 256
if type != self.OPTION_TYPE_INPUT
Int pageIdx = a_option / 256 - 1
if pageIdx != -1
self.Error("Option type mismatch. Expected input option, page \"" + Pages[pageIdx] + "\", index " + index as String)
else
self.Error("Option type mismatch. Expected input option, page \"\", index " + index as String)
endIf
return
endIf
self.SetOptionStrValue(index, a_value, a_noUpdate)
endFunction

function SetInputOptionValueST(String a_value, Bool a_noUpdate, String a_stateName)
Int index = self.GetStateOptionIndex(a_stateName)
if index < 0
self.Error("Cannot use SetInputOptionValueST outside a valid option state")
return
endIf
self.SetInputOptionValue(index, a_value, a_noUpdate)
endFunction

function RequestInputDialogData(Int a_index)
_activeOption = a_index + _currentPageNum * 256
_inputStartText = ""
_state = self.STATE_INPUT
String optionState = _stateOptionMap[a_index]
if optionState != ""
String oldState = self.GetState()
self.GotoState(optionState)
self.OnInputOpenST()
self.GotoState(oldState)
else
self.OnOptionInputOpen(_activeOption)
endIf
_state = self.STATE_DEFAULT
ui.InvokeString(self.JOURNAL_MENU, self.MENU_ROOT + ".setInputDialogParams", _inputStartText)
endFunction

Int function AddInputOption(String a_text, String a_value, Int a_flags)
return self.AddOption(self.OPTION_TYPE_INPUT, a_text, a_value, 0 as Float, a_flags)
endFunction

function AddInputOptionST(String a_stateName, String a_text, String a_value, Int a_flags)
self.AddOptionST(a_stateName, self.OPTION_TYPE_INPUT, a_text, a_value, 0 as Float, a_flags)
endFunction

function SetInputDialogStartText(String a_text)
if _state != self.STATE_INPUT
self.Error("Cannot set input dialog params while outside OnOptionInputOpen()")
return
endIf
_inputStartText = a_text
endFunction

function SetInputText(String a_text)
String optionState = _stateOptionMap[_activeOption % 256]
if optionState != ""
String oldState = self.GetState()
self.GotoState(optionState)
self.OnInputAcceptST(a_text)
self.GotoState(oldState)
else
self.OnOptionInputAccept(_activeOption, a_text)
endIf
_activeOption = -1
endFunction
11 changes: 11 additions & 0 deletions dist/Data/Scripts/Source/SKI_ConfigManager.psc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ event OnGameReload()
RegisterForModEvent("SKICP_menuAccepted", "OnMenuAccept")
RegisterForModEvent("SKICP_colorSelected", "OnColorSelect")
RegisterForModEvent("SKICP_colorAccepted", "OnColorAccept")
self.RegisterForModEvent("SKICP_inputSelected", "OnInputSelect")
self.RegisterForModEvent("SKICP_inputAccepted", "OnInputAccept")
RegisterForModEvent("SKICP_dialogCanceled", "OnDialogCancel")

RegisterForMenu(JOURNAL_MENU)
Expand Down Expand Up @@ -357,6 +359,15 @@ function Log(string a_msg)
Debug.Trace(self + ": " + a_msg)
endFunction

function OnInputSelect(String a_eventName, String a_strArg, Float a_numArg, Form a_sender)
Int optionIndex = a_numArg as Int
_activeConfig.RequestInputDialogData(optionIndex)
endFunction

function OnInputAccept(String a_eventName, String a_strArg, Float a_numArg, Form a_sender)
_activeConfig.SetInputText(a_strArg)
ui.InvokeBool(self.JOURNAL_MENU, self.MENU_ROOT + ".unlock", true)
endFunction

; STATES ---------------------------------------------------------------------------------------

Expand Down
Loading