Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superglue #10

Merged
merged 13 commits into from
Sep 16, 2021
12 changes: 5 additions & 7 deletions source/Kaboom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ModuleKaboom : PartModule
{
[KSPField(isPersistant = true, guiActiveEditor = true, guiActive = true, guiName = "Kaboom delay",
groupDisplayName = "<color=red><b>Switch Safety Cover</b></color>", groupName = "Kaboom", groupStartCollapsed = true,
guiUnits = "Seconds"),
guiUnits = " Seconds"),
UI_FloatRange(minValue = 0f, maxValue = 30f, stepIncrement = 1f)]

public float delay = 0;
Expand All @@ -28,23 +28,21 @@ public class ModuleKaboom : PartModule
[KSPField(isPersistant = true)]
public bool isGlued = false;

[KSPField(guiName = "Superglue", guiActive = true, guiActiveEditor = true, groupName = "Kaboom")]
[KSPField(isPersistant = true, guiName = "Superglue", guiActive = true, guiActiveEditor = true, groupName = "Kaboom")]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yalov "Superglue it" love it - keeps up the kampy/cheeky/not taking itself too seriously attitude of KaboOom!

public string gluedText = Localizer.Format("#autoLOC_6001071"); /*Disabled*/


[KSPEvent(guiName = "Enable Superglue", guiActive = true, guiActiveEditor = true, groupName = "Kaboom", active = true)]
[KSPEvent(guiName = "Toggle Superglue", guiActive = true, guiActiveEditor = true, groupName = "Kaboom", active = true)]
public void GluedEvent()
{
isGlued = !isGlued;
if (isGlued)
{
gluedText = Events["GluedEvent"].guiName = Localizer.Format("#autoLOC_6001072")/*Enabled*/;
Events["GluedEvent"].guiName = "Disable Superglue";
gluedText = Localizer.Format("#autoLOC_6001072")/*Enabled*/;
}
else
{
gluedText = Events["GluedEvent"].guiName = Localizer.Format("#autoLOC_6001071")/*Disabled*/;
Events["GluedEvent"].guiName = "Enable Superglue";
gluedText = Localizer.Format("#autoLOC_6001071")/*Disabled*/;
}
}

Expand Down