mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-13 12:40:50 +00:00
added test patches
This commit is contained in:
parent
cd3a029c5c
commit
e60c055c42
@ -16,6 +16,10 @@ namespace QSB.ShipSync.Patches
|
||||
Prefix(nameof(HatchController_OnEntry));
|
||||
Prefix(nameof(ShipTractorBeamSwitch_OnTriggerExit));
|
||||
Prefix(nameof(InteractZone_UpdateInteractVolume));
|
||||
Prefix(nameof(ShipElectricalComponent_OnEnterShip));
|
||||
Prefix(nameof(ShipElectricalComponent_OnExitShip));
|
||||
Prefix(nameof(ElectricalSystem_SetPowered));
|
||||
Prefix(nameof(ElectricalComponent_SetPowered));
|
||||
}
|
||||
|
||||
public static bool HatchController_OnPressInteract()
|
||||
@ -81,5 +85,41 @@ namespace QSB.ShipSync.Patches
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ShipElectricalComponent_OnEnterShip(ShipElectricalComponent __instance, bool ____damaged, ElectricalSystem ____electricalSystem)
|
||||
{
|
||||
__instance.CallBase<ShipElectricalComponent, ShipComponent>("OnEnterShip");
|
||||
if (!____damaged)
|
||||
{
|
||||
DebugLog.DebugWrite($"ShipElectricalComponent - OnEnterShip");
|
||||
____electricalSystem.SetPowered(true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ShipElectricalComponent_OnExitShip(ShipElectricalComponent __instance, bool ____damaged, ElectricalSystem ____electricalSystem)
|
||||
{
|
||||
__instance.CallBase<ShipElectricalComponent, ShipComponent>("OnExitShip");
|
||||
if (!____damaged)
|
||||
{
|
||||
DebugLog.DebugWrite($"ShipElectricalComponent - OnExitShip");
|
||||
____electricalSystem.SetPowered(false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ElectricalSystem_SetPowered(ElectricalSystem __instance, bool powered)
|
||||
{
|
||||
DebugLog.DebugWrite($"[SYSTEM] {__instance.name} set powered {powered}");
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool ElectricalComponent_SetPowered(ElectricalComponent __instance, bool powered)
|
||||
{
|
||||
DebugLog.DebugWrite($"[COMPONENT] {__instance.name} set powered {powered}");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user