Compare commits

..

No commits in common. "10f930d20de0a8f99e66722027d03ef05cc89758" and "a65e253f645109c7ba7a8b9d97d4828885642ca8" have entirely different histories.

View file

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