diff --git a/Text input fallback.esp b/Text input fallback.esp new file mode 100644 index 00000000..e8a358fe Binary files /dev/null and b/Text input fallback.esp differ diff --git a/scripts/_00e_a0_banksystemquest.pex b/scripts/_00e_a0_banksystemquest.pex index d3f8bbbd..4e0a7849 100644 Binary files a/scripts/_00e_a0_banksystemquest.pex and b/scripts/_00e_a0_banksystemquest.pex differ diff --git a/scripts/_00e_fs_nq02_functions.pex b/scripts/_00e_fs_nq02_functions.pex index bfe8949c..12d4cfb2 100644 Binary files a/scripts/_00e_fs_nq02_functions.pex and b/scripts/_00e_fs_nq02_functions.pex differ diff --git a/scripts/_00e_game_playerhouse_boardsc.pex b/scripts/_00e_game_playerhouse_boardsc.pex index b8e13b26..2ccd93e9 100644 Binary files a/scripts/_00e_game_playerhouse_boardsc.pex and b/scripts/_00e_game_playerhouse_boardsc.pex differ diff --git a/scripts/_00e_game_playerhouse_documentsc.pex b/scripts/_00e_game_playerhouse_documentsc.pex index 069711b9..6f8190ae 100644 Binary files a/scripts/_00e_game_playerhouse_documentsc.pex and b/scripts/_00e_game_playerhouse_documentsc.pex differ diff --git a/scripts/_00e_nq06_functions.pex b/scripts/_00e_nq06_functions.pex index 8f66fc96..4f57349c 100644 Binary files a/scripts/_00e_nq06_functions.pex and b/scripts/_00e_nq06_functions.pex differ diff --git a/scripts/enderalfunctions.pex b/scripts/enderalfunctions.pex index 6afc9a12..68d02e48 100644 Binary files a/scripts/enderalfunctions.pex and b/scripts/enderalfunctions.pex differ diff --git a/source/scripts/_00e_a0_banksystemquest.psc b/source/scripts/_00e_a0_banksystemquest.psc index 786cbb32..ff71a863 100644 --- a/source/scripts/_00e_a0_banksystemquest.psc +++ b/source/scripts/_00e_a0_banksystemquest.psc @@ -91,10 +91,61 @@ function Transfer(string TransferRate, string TransferAction) if TransferRate == "start" if TransferAction == "Deposit" iMaxAmount = GetPlayer().GetItemCount(Gold) - CashFlow = (((Self as QUEST) as FORM) as UILIB_1).ShowTextInput(_00E_BankSystem_Deposit_Comfy .GetName()+iMaxAmount+")", iMaxAmount) as Int + + if EnderalFunctions.TextInputEnabled() + CashFlow = (((Self as QUEST) as FORM) as UILIB_1).ShowTextInput(_00E_BankSystem_Deposit_Comfy.GetName() + iMaxAmount + ")", iMaxAmount) as Int + else + int iFallback = _00E_BankSystem_Deposit_FallbackSelect.Show(Deposited) + + if iFallback == 0 + CashFlow = 100 + elseif iFallback == 1 + CashFlow = 250 + elseif iFallback == 2 + CashFlow = 500 + elseif iFallback == 3 + CashFlow = 1000 + elseif iFallback == 4 + CashFlow = 1500 + elseif iFallback == 5 + CashFlow = 2000 + else + bTransferInAction = False + return + endif + endif else iMaxAmount = REFdepositBox.GetItemCount(Gold) - CashFlow = (((Self as QUEST) as FORM) as UILIB_1).ShowTextInput(_00E_BankSystem_Withdraw_Comfy .GetName()+iMaxAmount+")", iMaxAmount) as Int + + if EnderalFunctions.TextInputEnabled() + CashFlow = (((Self as QUEST) as FORM) as UILIB_1).ShowTextInput(_00E_BankSystem_Withdraw_Comfy.GetName() + iMaxAmount + ")", iMaxAmount) as Int + else + int iFallback = _00E_BankSystem_Withdraw_FallbackSelect.Show(iMaxAmount) + + if iFallback == 0 + CashFlow = 100 + elseif iFallback == 1 + CashFlow = 250 + elseif iFallback == 2 + CashFlow = 500 + elseif iFallback == 3 + CashFlow = 1000 + elseif iFallback == 4 + CashFlow = 1500 + elseif iFallback == 5 + CashFlow = 2000 + elseif iFallback == 6 + CashFlow = iMaxAmount + else + bTransferInAction = False + return + endif + endif + endif + + if CashFlow <= 0 + bTransferInAction = False + return endif if CashFlow > iMaxAmount @@ -227,6 +278,8 @@ Message Property _00E_Bank_NotEnoughMoneyWithdraw Auto Message Property _00E_Bank_NotEnoughMoneyDeposit Auto Message Property _00E_BankSystem_Deposit_Comfy Auto +Message Property _00E_BankSystem_Deposit_FallbackSelect Auto +Message Property _00E_BankSystem_Withdraw_FallbackSelect Auto Message Property _00E_BankSystem_Withdraw_Comfy Auto Message Property _00E_BankSystem_Root Auto @@ -248,4 +301,5 @@ Topic Property BankSystem_D0_PlayerWithdrawTopic Auto float property Zins auto hidden float property ZinsPercent auto hidden -float property Deposited auto hidden \ No newline at end of file +float property Deposited auto hidden + diff --git a/source/scripts/_00e_fs_nq02_functions.psc b/source/scripts/_00e_fs_nq02_functions.psc index 6a2524f2..0e093fcd 100644 --- a/source/scripts/_00e_fs_nq02_functions.psc +++ b/source/scripts/_00e_fs_nq02_functions.psc @@ -872,13 +872,6 @@ Weapon Property _01E_07_SteelDagger Auto Function PrepareCardgame() - If PlayerRef.GetItemCount(Gold001)<20; Failsafe, falls Player kein Gold hat - PlayerRef.AddItem(Gold001, 20, true) - EndIf - - If _00E_FS_NQ02_EsmeREF.GetItemCount(Gold001)<20 ; Failsafe, falls Esme kein Gold hat - _00E_FS_NQ02_EsmeREF.AddItem(Gold001, 20, true) - EndIf OpenCardInterface() ;CardgameVar1 = 1 -> Spiel 1 gewonnen ;CardgameVar1 = 2 -> Spiel 1 verloren @@ -915,15 +908,40 @@ Function PlayCards() EndFunction int Function Step01() ; place your bet + + If PlayerRef.GetItemCount(Gold001) < 20; Failsafe, falls Player kein Gold hat + PlayerRef.AddItem(Gold001, 20, true) + EndIf + + If _00E_FS_NQ02_EsmeREF.GetItemCount(Gold001) < 160 ; Failsafe, falls Esme kein Gold hat + _00E_FS_NQ02_EsmeREF.AddItem(Gold001, 160, true) + EndIf + ; need to calculate the max bet first If _00E_FS_NQ02_EsmeREF.GetItemCount(Gold001) > PlayerRef.GetItemCount(Gold001) - MaxBet = (PlayerRef.GetItemCount(Gold001))/2 + MaxBet = PlayerRef.GetItemCount(Gold001) / 2 ElseIf _00E_FS_NQ02_EsmeREF.GetItemCount(Gold001) < PlayerRef.GetItemCount(Gold001) - MaxBet = (_00E_FS_NQ02_EsmeREF.GetItemCount(Gold001))/2 + MaxBet = _00E_FS_NQ02_EsmeREF.GetItemCount(Gold001) / 2 Else - MaxBet = (PlayerRef.GetItemCount(Gold001))/2 + MaxBet = PlayerRef.GetItemCount(Gold001) / 2 EndIf - PlayerBet = (((self as QUEST) as FORM) as UILIB_1).ShowTextInput(PlaceYourBet .GetName()+MaxBet, MaxBet) as int + + if EnderalFunctions.TextInputEnabled() + PlayerBet = (((self as QUEST) as FORM) as UILIB_1).ShowTextInput(PlaceYourBet.GetName()+MaxBet, MaxBet) as int + else + int iFallbackBet = _SAG_PlaceYourBet_FallbackMessageEsme.Show() + + if iFallbackBet == 3 + PlayerBet = 80 + elseif iFallbackBet == 2 + PlayerBet = 50 + elseif iFallbackBet == 1 + PlayerBet = 20 + else + PlayerBet = 10 + endif + endif + If PlayerBet > MaxBet || PlayerBet == 0 Step01() RETURN 0 @@ -936,7 +954,7 @@ int Function Step01() ; place your bet GlobalBet = OpponentBet + PlayerBet _00E_FS_NQ02_PC_BetMessage.Show(PlayerBet, OpponentBet, GlobalBet) EnemyPurse.EnableNoWait(true) - RegisterForKey(14) + RegisterForKey(14) ; not doing anything? RegisterForKey(271) Step02() Return PlayerBet @@ -1089,7 +1107,9 @@ Function FinishGameAndClearUp() PlayerREF.MoveTo(_00E_FS_NQ02_PlayerChairREF) EnablePlayerControls() - SetGameSettingString("sCharGenControlsDisabled", s_chargeninitialtext) + if SKSE.GetVersion() + SetGameSettingString("sCharGenControlsDisabled", s_chargeninitialtext) + endif SetInChargen(abDisableSaving = false, abDisableWaiting = true, abShowControlsDisabledMessage = false) EndFunction @@ -1131,6 +1151,7 @@ Spell Property dunReanimateSelf Auto Actor Property Commentator Auto Message Property PlaceYourBet Auto +Message Property _SAG_PlaceYourBet_FallbackMessageEsme Auto GlobalVariable Property ExAequo Auto GlobalVariable Property WonGames Auto @@ -1185,4 +1206,4 @@ Sound Property _00E_TavernGames_DiceRollM Auto Sound Property _00E_MAGFXFireOilIgniteLow Auto Sound Property _00E_FS_Phasmalist_EnterWorld_Male Auto -MiscObject Property Gold001 Auto \ No newline at end of file +MiscObject Property Gold001 Auto diff --git a/source/scripts/_00e_game_playerhouse_boardsc.psc b/source/scripts/_00e_game_playerhouse_boardsc.psc index 0c8bc8ab..ac66a693 100644 --- a/source/scripts/_00e_game_playerhouse_boardsc.psc +++ b/source/scripts/_00e_game_playerhouse_boardsc.psc @@ -93,7 +93,7 @@ function OnActivate(ObjectReference akActionRef) elseif iButton == 5 - if SKSE.GetVersion() + if EnderalFunctions.TextInputEnabled() Cell cCurrentCell = Self.GetParentCell() String sHouseName = NQ24.ChooseHouseName() cCurrentCell.SetName(sHouseName) @@ -104,7 +104,7 @@ function OnActivate(ObjectReference akActionRef) Player.sHouseNobleQuarterName = sHouseName EndIf else - Debug.Notification("Renaming requires SKSE") + Debug.Notification("Renaming requires SKSE and keyboard") endif elseif iButton == 6 diff --git a/source/scripts/_00e_game_playerhouse_documentsc.psc b/source/scripts/_00e_game_playerhouse_documentsc.psc index 9041e133..75eef97d 100644 --- a/source/scripts/_00e_game_playerhouse_documentsc.psc +++ b/source/scripts/_00e_game_playerhouse_documentsc.psc @@ -16,7 +16,7 @@ Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldCo cHouseCell.SetActorOwner(PlayerREF.GetActorBase()) HouseBoardREF.Enable() - if SKSE.GetVersion() + if EnderalFunctions.TextInputEnabled() sHouseName = NQ24.ChooseHouseName() If sHouseName == "" sHouseName = DefaultHouseName.GetName() diff --git a/source/scripts/_00e_nq06_functions.psc b/source/scripts/_00e_nq06_functions.psc index a8ff8475..a3a2c777 100644 --- a/source/scripts/_00e_nq06_functions.psc +++ b/source/scripts/_00e_nq06_functions.psc @@ -8,7 +8,7 @@ Function SetHorseName() _00E_HorseOwned.SetValueInt(1) - if ! SKSE.GetVersion() + if ! EnderalFunctions.TextInputEnabled() return endif @@ -29,7 +29,7 @@ Function SetMuleName() _00E_MuleOwned.SetValueInt(1) - if ! SKSE.GetVersion() + if ! EnderalFunctions.TextInputEnabled() return endif @@ -50,7 +50,7 @@ Function SetFatherShadowName() _00E_FathersShadowOwned.SetValueInt(1) - if ! SKSE.GetVersion() + if ! EnderalFunctions.TextInputEnabled() return endif @@ -75,7 +75,7 @@ EndFunction Function RenameMount(bool _bReturnToSelection) - if SKSE.GetVersion() + if EnderalFunctions.TextInputEnabled() int iRenameSelection = _00E_NQ06_RenameMountSelection.Show() If iRenameSelection == 0 SetMuleName() @@ -87,7 +87,7 @@ Function RenameMount(bool _bReturnToSelection) ReturnToSelection(_bReturnToSelection) else - Debug.Notification("Renaming requires SKSE") + Debug.Notification("Renaming requires SKSE and keyboard") endif EndFunction diff --git a/source/scripts/_00e_playerhousing_cellnamesc.psc b/source/scripts/_00e_playerhousing_cellnamesc.psc index abce1b76..6079fc53 100644 --- a/source/scripts/_00e_playerhousing_cellnamesc.psc +++ b/source/scripts/_00e_playerhousing_cellnamesc.psc @@ -6,6 +6,7 @@ Scriptname _00E_PlayerHousing_CellNameSC extends ReferenceAlias ;===================================================================================== Event OnPlayerLoadGame() + ; Not calling TextInputEnabled() in case renames were made with keyboard earlier if ! SKSE.GetVersion() return endif diff --git a/source/scripts/enderalfunctions.psc b/source/scripts/enderalfunctions.psc index 2ee11fc3..fea69967 100644 --- a/source/scripts/enderalfunctions.psc +++ b/source/scripts/enderalfunctions.psc @@ -31,3 +31,12 @@ String Function GetPlayerClassNameGlobal() global Quest AffinityQuest = Game.GetFormFromFile(0x1597B, "Enderal - Forgotten Stories.esm") as Quest return (AffinityQuest.GetAlias(0) as _00E_AffinityControl).GetPlayerClassName() endfunction + +bool function IsVR() global + ; Current VR build 2.0.12 (game version 1.4.15) + return SKSE.GetVersionRelease() == 60 +endfunction + +bool function TextInputEnabled() global + return SKSE.GetVersion() && ! Game.UsingGamepad() && ! IsVR() +endfunction