private void IconClicked(EditorPartIcon icon, EditorIconEvents.EditorIconClickEvent evt) { Log.Info("IconClicked"); if (!ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.primary) && !ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.secondary)) { return; } Log.Info("Icon was clicked for " + icon.partInfo.name + " (" + icon.partInfo.title + "), icon.name: " + icon.name); _icon = icon; ShowPruneMenu(); evt.Veto(); // prevent part from being spawned }
private void Start() { _button = GetComponent <Button>(); _originalClickHandler = GetComponent <PointerClickHandler>(); _icon = GetComponent <EditorPartIcon>(); if (_button == null || _originalClickHandler == null || _icon == null) { Log.Error("Couldn't find an expected component"); Destroy(this); return; } _originalClickHandler.enabled = false; // we'll be managing these events instead // unhook EditorPartIcon's listener from the button // this will allow us to veto any clicks _button.onClick.RemoveListener(_icon.MouseInput_SpawnPart); }
private void IconHover(EditorPartIcon icon, bool hover) { Log.Info("IconHover, ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.primary): " + ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.primary).ToString()); if (HighLogic.CurrentGame.Parameters.CustomParams <JanitorsClosetSettings>().showMod || ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.primary) || ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.secondary)) { string mod = ModFilterWindow.FindPartMod(icon.partInfo); drawTooltip = true; if (hover) { tooltip = mod; } else { tooltip = ""; } } else { tooltip = ""; } }
void Start() { GetComponent <UIButton>().AddInputDelegate(new EZInputDelegate(OnInput)); editorPaction = GetComponent <EditorPartIcon>(); }
private static void InstallReplacementHandler(EditorPartIcon icon) { icon.gameObject.AddComponent <ReplacementClickHandler>(); }
void Start() { GetComponent<UIButton>().AddInputDelegate(new EZInputDelegate(OnInput)); editorPaction = GetComponent<EditorPartIcon>(); }
/// <summary>Registers click handlers on the editor's category icon.</summary> void Start() { // Getting components is not a cheap operation so, cache anything we can. partIcon = GetComponent<EditorPartIcon>(); }