This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* EditTextPreference that only allows input of IP Addresses, using the Phone | |
* input type, and automatically inserts periods at the earliest appropriate | |
* interval. | |
*/ | |
// Note; this probably isn't the best pattern for this - a Factory of Decorator | |
// pattern would have made more sense, rather than inheritance. However, this | |
// pattern is consistent with how other android Widgets are invoked, so I went | |
// with this to prevent confusion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* EditText that only allows input of IP Addresses, using the Phone | |
* input type, and automatically inserts periods at the earliest appropriate | |
* interval. | |
*/ | |
// Note; this probably isn't the best pattern for this - a Factory of Decorator | |
// pattern would have made more sense, rather than inheritance. However, this | |
// pattern is consistent with how other android Widgets are invoked, so I went | |
// with this to prevent confusion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SomeAssemblyRequired | |
{ | |
[KSPAddon(KSPAddon.Startup.EditorAny, true)] | |
public class EditorModule : MonoBehaviour | |
{ | |
void Start() | |
{ | |
EditorLogic.fetch.launchBtn.onClick.RemoveAllListeners(); | |
EditorLogic.fetch.launchBtn.onClick.AddListener(delegate { OnLaunchClick(); }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void OnLaunchClick() | |
{ | |
PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), | |
new Vector2(0.5f, 0.5f), | |
new MultiOptionDialog("", | |
"Vessel Build Summary", | |
HighLogic.UISkin, | |
new Rect(0.5f, 0.5f, 300f, 300f), | |
new DialogGUIFlexibleSpace(), | |
new DialogGUIHorizontalLayout( |