public IEnumerator FadeOut() { float t = 0; while (fade.color != Color.clear) { t += Time.deltaTime; fade.color = Color.Lerp(Color.black, Color.clear, t); yield return(new WaitForSeconds(Time.deltaTime)); } menu = MENU_MODE.MENU; }
public void OnGUI() { Event e = Event.current; if (!option_pressed) { switch (menu) { case MENU_MODE.MENU: if (GUI.Button(new Rect(0, 0, 90, 40), "Start game", menuskins.GetStyle("Box"))) { menuLoad = MENU_LOAD_MODE.START; StartCoroutine(FadeIn()); } if (SaveExist()) { if (GUI.Button(new Rect(0, 50, 90, 40), "Load game", menuskins.GetStyle("Box"))) { menuLoad = MENU_LOAD_MODE.LOAD; StartCoroutine(FadeIn()); } } if (GUI.Button(new Rect(0, 100, 90, 40), "Options", menuskins.GetStyle("Box"))) { menu = MENU_MODE.OPTIONS; } break; case MENU_MODE.OPTIONS: GUILayout.Label("Click on the buttons to change controls. Current Key to change: " + currentKeyName, menuskins.GetStyle("Box")); foreach (KeyValuePair <string, KeyCode> key in s_globals.arrowKeyConfig) { if (GUILayout.Button(key + ": " + key.Value.ToString(), menuskins.GetStyle("Box"))) { currentKeyName = key.Key; PlayerPrefs.SetInt(key.Key, (int)key.Value); } } DisplayConfigOptions(); if (currentKeyName != "none") { if (e.isKey || e.shift) { if (e.shift) { s_globals.SetButtonKeyPref(currentKeyName, KeyCode.LeftShift); } else if (e.isKey) { s_globals.SetButtonKeyPref(currentKeyName, e.keyCode); } currentKeyName = "none"; } } if (GUILayout.Button("Back", menuskins.GetStyle("Box"))) { currentKeyName = "none"; menu = MENU_MODE.MENU; } break; } } }
public void SetMenuMode(MENU_MODE mode) { switch (mode) { case MENU_MODE.MENU_MODE_FEED: UpdateMenuPanel(btnMenuFeed); viewFeed.Visibility = Visibility.Visible; viewZeptair.Visibility = Visibility.Hidden; btnReload.Visibility = Visibility.Visible; btnCheckAll.Visibility = Visibility.Visible; #if ZEPTAIR if (_wndZeptDistFolders != null) { _wndZeptDistFolders.Close(); _wndZeptDistFolders = null; } #endif break; case MENU_MODE.MENU_MODE_ZEPTAIR: UpdateMenuPanel(btnMenuZeptair); viewFeed.Visibility = Visibility.Hidden; viewZeptair.Visibility = Visibility.Visible; btnReload.Visibility = Visibility.Hidden; btnCheckAll.Visibility = Visibility.Hidden; if (_wndWing != null) { _wndWing.Close(); _wndWing = null; } #if ZEPTAIR if (stpZeptair.Children.Count <= 0) { System.Resources.ResourceManager rm = new System.Resources.ResourceManager( "ThetisCoreNavi", System.Reflection.Assembly.GetExecutingAssembly()); MenuItemPanel[] panels = new MenuItemPanel[] { // new MenuItemPanel(Properties.Resources.MENUITEM_ZEPT_HISTORY, new MouseButtonEventHandler(menuItemZeptDistFolders_Click)), new MenuItemPanel(Properties.Resources.MENUITEM_ZEPT_DIST_FOLDERS, new MouseButtonEventHandler(menuItemZeptDistFolders_Click)) }; foreach (MenuItemPanel panel in panels) { panel.Width = stpZeptair.Width; stpZeptair.Children.Add(panel); } } #endif /* * BrowserConfig browserConfig = BrowserConfig.Load(); * if (browserConfig.Url == null || browserConfig.Url.Length <= 0) || { || System.Windows.Forms.MessageBox.Show( || Properties.Resources.ERR_ZEPTMENU_URL_NOT_SET, || @"ERROR", || MessageBoxButtons.OK, || MessageBoxIcon.Error || ); || break; || } || RssTargetEntry targetEntry = new RssTargetEntry(); || targetEntry.Url = browserConfig.Url.Split('?')[0].Replace(@"/rss/rss", @"/rss/zeptmenu"); || if (browserConfig.UserName != null || && browserConfig.UserName.Length > 0) || { || targetEntry.SetAuth(browserConfig.UserName, browserConfig.Password); || } || ZeptMenuAgent.GetMenu(targetEntry); */ break; default: break; } }