|
|
|
@ -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 |
|
|
|
@ -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 |
|
|
|
@ -56,6 +58,7 @@ int[] _colorParams |
|
|
|
|
int _activeOption = -1 |
|
|
|
|
|
|
|
|
|
string _infoText |
|
|
|
|
string _inputStartText |
|
|
|
|
|
|
|
|
|
bool _messageResult = false |
|
|
|
|
bool _waitForMessage = false |
|
|
|
@ -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 |
|
|
|
|