//-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- public void OnShow() { m_GraphicEnum.RegisterDelegate(OnGraphicChanged); m_AutoDetectButton.RegisterReleaseDelegate(OnDetectGraphicButton); m_ShowHintsSwitch.RegisterDelegate(OnShowHintChanged); m_LanguageEnum.RegisterDelegate(OnLanguageChanged); }
protected override void OnViewShow() { base.OnViewShow(); m_SliderSoundVolume.RegisterChangeValueDelegate(OnSoundVolumeChanged); m_SliderMusicVolume.RegisterChangeValueDelegate(OnMusicVolumeChanged); m_SwitchMusic.RegisterDelegate(OnMusicToggled); }
protected GUIBase_Switch PrepareSwitch(GUIBase_Layout inLayout, string inName, GUIBase_Switch.SwitchDelegate inSwitchDlgt) { GUIBase_Switch _switch = GetWidget(inLayout, inName).GetComponent <GUIBase_Switch>(); if (_switch == null) { throw new MFScreenInitException("Widget [ " + inName + " } dosn't have switch component"); } _switch.RegisterDelegate(inSwitchDlgt); return(_switch); }
//--------------------------------------------------------- public static GUIBase_Switch RegisterSwitchDelegate(GUIBase_Layout layout, string switchName, GUIBase_Switch.SwitchDelegate d) { GUIBase_Switch control = GetControl <GUIBase_Switch>(layout, switchName); if (control != null) { control.RegisterDelegate(d); } else { Debug.LogError("Can't find switch '" + switchName + "'"); } return(control); }
//-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- public void OnShow() { m_GraphicEnum.RegisterDelegate(OnGraphicChanged); m_AutoDetectButton.RegisterReleaseDelegate(OnDetectGraphicButton); m_ShowHintsSwitch.RegisterDelegate(OnShowHintChanged); m_LanguageEnum.RegisterDelegate(OnLanguageChanged); m_FullscreenSwitch.RegisterDelegate(OnFullscreenToggled); m_ResolutionEnum.RegisterDelegate(OnResolutionChanged); m_ApplyButton.RegisterReleaseDelegate(OnApplyButton); if (GuiOptions.fullScreenResolution.width <= 0 || GuiOptions.fullScreenResolution.height <= 0) { GuiOptions.fullScreenResolution = Screen.resolutions[Screen.resolutions.Length - 1]; } m_FullscreenSwitch.SetValue(Screen.fullScreen); m_ResolutionEnumSelection = -1; m_ResolutionMax = Screen.resolutions.Length - 1; m_CurrentResolution.width = Screen.width; m_CurrentResolution.height = Screen.height; m_ResolutionLabels[m_ResolutionEnum.Selection].SetNewText(m_CurrentResolution.width + "x" + m_CurrentResolution.height); for (int i = 0; i < Screen.resolutions.Length; i++) { if (Screen.resolutions[i].width == m_CurrentResolution.width && Screen.resolutions[i].height == m_CurrentResolution.height) { m_ResolutionEnumSelection = i; break; } } SetApplyButton(); }
// PRIVATE METHODS void BindControls(bool state) { // bind callbacks #if MADFINGER_KEYBOARD_MOUSE m_KeyboardButton.RegisterReleaseDelegate(state ? OnKeyboardPressed : (GUIBase_Button.ReleaseDelegate)null); #else if (!GamepadInputManager.Instance.IsNvidiaShield()) { m_ControlSchemeEnum.RegisterDelegate(state ? OnControlSchemeChanged : (GUIBase_Enum.ChangeValueDelegate)null); m_FireButtonSize.RegisterChangeValueDelegate(state ? OnFireButtonSize : (GUIBase_Slider.ChangeValueDelegate)null); m_SwitchLefthanded.RegisterDelegate(state ? OnLefthandedToggled : (GUIBase_Switch.SwitchDelegate)null); m_CustomizeButton.RegisterReleaseDelegate(state ? OnCustomizePressed : (GUIBase_Button.ReleaseDelegate)null); m_MogaHelpButton.RegisterReleaseDelegate(state ? OnMogaHelpPressed : (GUIBase_Button.ReleaseDelegate)null); // enable/disable controls m_CustomizeButton.SetDisabled(m_CustomizeControls != null ? false : true); m_CustomizeButton.Widget.Show((m_CustomizeControls != null), true); } #endif m_SliderSensitivity.RegisterChangeValueDelegate(state ? OnSensitivityChanged : (GUIBase_Slider.ChangeValueDelegate)null); m_SwitchYAxis.RegisterDelegate(state ? OnInvertYToggled : (GUIBase_Switch.SwitchDelegate)null); m_GamepadButton.RegisterReleaseDelegate(state ? OnGamepadPressed : (GUIBase_Button.ReleaseDelegate)null); }
// PRIVATE METHODS void BindControls(bool state) { // bind callbacks m_SwitchFloatingFire.RegisterDelegate(state ? OnSwitchFloatingFire : (GUIBase_Switch.SwitchDelegate)null); }