Compare commits

...

2 commits

Author SHA1 Message Date
10f930d20d
fixed a runtime error 2024-11-07 19:54:14 -05:00
981d59e934
add more descriptive comments to the CustomData configuration 2024-11-07 19:49:04 -05:00

View file

@ -84,46 +84,50 @@ namespace IngameScript
"Maneuvering_Thruster_Prefix", "Maneuvering_Thruster_Prefix",
"[MANEUVERING]" "[MANEUVERING]"
); );
_configIni.SetComment("AutomaticConnectorActions", "Polling", "Enable polling"); _configIni.SetComment(
"AutomaticConnectorActions",
"Polling",
"If Polling is enabled, the script will check for docked/undocked connectors every 10 ticks. Otherwise, the script will only run manually."
);
_configIni.SetComment( _configIni.SetComment(
"AutomaticConnectorActions", "AutomaticConnectorActions",
"Connector_Prefix", "Connector_Prefix",
"Connector prefix" "If the connector's name contains this string, the script will manage it."
); );
_configIni.SetComment( _configIni.SetComment(
"AutomaticConnectorActions", "AutomaticConnectorActions",
"Manage_Gyroscopes", "Manage_Gyroscopes",
"Manage gyroscopes" "If this is enabled, the script will disable and enable gyroscopes when docking and undocking, respectively."
); );
_configIni.SetComment( _configIni.SetComment(
"AutomaticConnectorActions", "AutomaticConnectorActions",
"Recharge_Batteries", "Recharge_Batteries",
"Recharge batteries" "If this is enabled, the script will set all batteries to recharge mode when docking and set them to auto mode when undocking."
); );
_configIni.SetComment( _configIni.SetComment(
"AutomaticConnectorActions", "AutomaticConnectorActions",
"Stockpile_Gas_Tanks", "Stockpile_Gas_Tanks",
"Stockpile gas tanks" "If this is enabled, the script will set all gas tanks to stockpile when docking and set them to not stockpile when undocking."
); );
_configIni.SetComment( _configIni.SetComment(
"AutomaticConnectorActions", "AutomaticConnectorActions",
"Manage_Thrusters", "Manage_Thrusters",
"Manage thrusters" "If this is enabled, the script will disable all thrusters when docking."
); );
_configIni.SetComment( _configIni.SetComment(
"AutomaticConnectorActions", "AutomaticConnectorActions",
"Enable_All_Thrusters_On_Undock", "Enable_All_Thrusters_On_Undock",
"Enable all thrusters on undock" "If this is enabled, the script will enable all thrusters when undocking."
); );
_configIni.SetComment( _configIni.SetComment(
"AutomaticConnectorActions", "AutomaticConnectorActions",
"Manage_Maneuvering_Thrusters", "Manage_Maneuvering_Thrusters",
"Manage maneuvering thrusters" "If this is enabled, the script will disable and enable maneuvering thrusters when docking and undocking, respectively."
); );
_configIni.SetComment( _configIni.SetComment(
"AutomaticConnectorActions", "AutomaticConnectorActions",
"Maneuvering_Thruster_Prefix", "Maneuvering_Thruster_Prefix",
"Prefix for maneuvering thrusters" "If the maneuvering thruster's name contains this string, the script will manage it."
); );
Me.CustomData = _configIni.ToString(); Me.CustomData = _configIni.ToString();
} }
@ -168,11 +172,10 @@ namespace IngameScript
} }
} }
public void Save(bool isDocked) public void Save()
{ {
_isDocked = isDocked;
_storageIni.Clear(); _storageIni.Clear();
_storageIni.Set("AutomaticConnectorActions", "Is_Docked", isDocked); _storageIni.Set("AutomaticConnectorActions", "Is_Docked", _isDocked);
Storage = _storageIni.ToString(); Storage = _storageIni.ToString();
} }
@ -256,7 +259,8 @@ namespace IngameScript
Echo("Set grid batteries to recharge."); Echo("Set grid batteries to recharge.");
} }
Save(true); _isDocked = true;
Save();
} }
private void Undock() private void Undock()
@ -363,7 +367,8 @@ namespace IngameScript
Echo("Turned on grid thrusters."); Echo("Turned on grid thrusters.");
} }
Save(false); _isDocked = false;
Save();
} }
public void Main(string argument, UpdateType updateSource) public void Main(string argument, UpdateType updateSource)