Store Entries values to persistent variables

This commit is contained in:
Beu 2022-03-09 21:56:28 +01:00
parent 2e0c3ba925
commit 8ef6b9d7ca

View File

@ -367,7 +367,7 @@ Text GetManialink() {
<frame pos="0 -10"> <frame pos="0 -10">
<label class="text" size="8 3" pos="0 -1" text="Steer:"/> <label class="text" size="8 3" pos="0 -1" text="Steer:"/>
<frameinstance pos="8 0" modelid="framemodel-tooltip" tooltip="Set single value between -1. and 1. to set it, or comma separated 2 values to select a random value between the two"/> <frameinstance pos="8 0" modelid="framemodel-tooltip" tooltip="Set single value between -1. and 1. to set it, or comma separated 2 values to select a random value between the two"/>
<entry id="entry-playerscontrol-steer" class="entry" pos="0 -6" size="72 4" default="0." /> <entry id="entry-playerscontrol-steer" class="entry" pos="0 -6" size="72 4"/>
</frame> </frame>
<frame pos="0 -20"> <frame pos="0 -20">
<label class="text" size="20 3" pos="0 -1" text="Send config to:"/> <label class="text" size="20 3" pos="0 -1" text="Send config to:"/>
@ -532,6 +532,22 @@ Text GetManialink() {
declare CMlEntry Entry_ForVars_Players = (Page.GetFirstChild("entry-forvars-player") as CMlEntry); declare CMlEntry Entry_ForVars_Players = (Page.GetFirstChild("entry-forvars-player") as CMlEntry);
wait(InputPlayer != Null);
declare persistent Text P_DebugMode_CustomEvent_Name for InputPlayer.User;
Entry_CustomEvent_Name.Value = P_DebugMode_CustomEvent_Name;
declare persistent Text P_DebugMode_CustomEvent_Data for InputPlayer.User;
Entry_CustomEvent_Data.Value = P_DebugMode_CustomEvent_Data;
declare persistent Text P_DebugMode_ForVars_Players for InputPlayer.User;
Entry_ForVars_Players.Value = P_DebugMode_ForVars_Players;
declare persistent Text P_DebugMode_Bots_Name for InputPlayer.User;
Entry_Bots_Name.Value = P_DebugMode_Bots_Name;
declare persistent Text P_DebugMode_Bots_TeamId for InputPlayer.User;
Entry_Bots_TeamId.Value = P_DebugMode_Bots_TeamId;
declare persistent Text P_DebugMode_PlayersControl_Speed for InputPlayer.User;
Entry_PlayersControl_Speed.Value = P_DebugMode_PlayersControl_Speed;
declare persistent Text P_DebugMode_PlayersControl_Steer for InputPlayer.User;
Entry_PlayersControl_Steer.Value = P_DebugMode_PlayersControl_Steer;
declare netread Text Net_DebugMode_Logs for Teams[0]; declare netread Text Net_DebugMode_Logs for Teams[0];
declare netread Integer Net_DebugMode_Logs_Serial for Teams[0]; declare netread Integer Net_DebugMode_Logs_Serial for Teams[0];
declare Integer Last_Logs_Serial; declare Integer Last_Logs_Serial;
@ -653,6 +669,14 @@ Text GetManialink() {
SwitchToTab(Last_TabSelected, Event.Control.ControlId); SwitchToTab(Last_TabSelected, Event.Control.ControlId);
Last_TabSelected = Event.Control.ControlId; Last_TabSelected = Event.Control.ControlId;
} }
// Save value to persistent variable
P_DebugMode_CustomEvent_Name = Entry_CustomEvent_Name.Value;
P_DebugMode_CustomEvent_Data = Entry_CustomEvent_Data.Value;
P_DebugMode_ForVars_Players = Entry_ForVars_Players.Value;
P_DebugMode_Bots_Name = Entry_Bots_Name.Value;
P_DebugMode_Bots_TeamId = Entry_Bots_TeamId.Value;
P_DebugMode_PlayersControl_Speed = Entry_PlayersControl_Speed.Value;
P_DebugMode_PlayersControl_Steer = Entry_PlayersControl_Steer.Value;
} }
case CMlScriptEvent::Type::MouseOver: { case CMlScriptEvent::Type::MouseOver: {
if (Event.Control.Parent.ToolTip != "") { if (Event.Control.Parent.ToolTip != "") {