private static void Menu_Options_Click(object sender, EventArgs e) { Options OptionsDialog = new Options(); var Result = OptionsDialog.ShowDialog(); if (Result == DialogResult.OK) { foreach (RepositoryUI RUI in ListOfRepositoryUI) { RUI.NotifyProxyUpdate(); } } }
private static void QuitApplication() { if (NumberOfStartedEngines > 0) { foreach (RepositoryUI RUI in ListOfRepositoryUI) { RUI.StopEngine(); //Request each SyncEngine to stop } ForceQuitTimer.Enabled = true; //Init the timer that will force the closing if (StoppingDialog.AllowClosing == false) { StoppingDialog.ShowDialog(); //Display a wait dialog that will close itself when the engine is stopped and will set ProcessingIsStopped to true ( see RM_EngineStopped() ) } } if (icn != null) { icn.Visible = false; } Application.Exit(); }
void OnSceneGUI() { if (nextPath == null) { Handles.BeginGUI(); Rect dropArea = new Rect(Screen.width - 70, 20, 50, 50); GUI.Box(dropArea, "Drop List"); EnemyDataStore data = RUI.DropArea <EnemyDataStore>(dropArea); if (data) { nextPath = new SpawnRegion.SpawnPath(); nextPath.receipt = data; Tools.current = Tool.None; points.Clear(); SceneView.currentDrawingSceneView.Repaint(); } Handles.EndGUI(); } if (nextPath != null) { int control = GUIUtility.GetControlID(new GUIContent("NEXTPATH"), FocusType.Passive); bool finished = false; Camera cam = SceneView.currentDrawingSceneView.camera; Ray r = cam.ScreenPointToRay(WindowToScreenPoint(Event.current.mousePosition)); Vector3 scenePosition = r.origin - r.direction / r.direction.z * r.origin.z; switch (Event.current.type) { case EventType.mouseUp: finished = true; GUIUtility.hotControl = 0; point = scenePosition; Event.current.Use(); SceneView.currentDrawingSceneView.Repaint(); break; case EventType.mouseDown: point = scenePosition; GUIUtility.hotControl = control; SceneView.currentDrawingSceneView.Repaint(); break; case EventType.mouseDrag: case EventType.mouseMove: point = scenePosition; Event.current.Use(); SceneView.currentDrawingSceneView.Repaint(); break; case EventType.Layout: case EventType.Repaint: Handles.CircleCap(control, point, Quaternion.identity, HandleUtility.GetHandleSize(point) * 0.2f); break; } if (finished) { points.Add(point); if (points.Count == nextPath.receipt.enemyTypes.Count) { nextPath.points = points.ToArray(); region.paths.Add(nextPath); nextPath = null; EditorUtility.SetDirty(region); } } } foreach (SpawnRegion.SpawnPath path in region.paths) { Handles.Label(path.points[0], path.receipt.name); Vector3[] points = new Vector3[path.points.Length]; for (int i = 0; i < path.points.Length; i++) { Vector2 result = Handles.FreeMoveHandle(path.points[i], Quaternion.identity, HandleUtility.GetHandleSize(path.points[i]) * 0.2f, Vector3.zero, Handles.CircleCap); if (result != path.points[i]) { path.points[i] = result; EditorUtility.SetDirty(region); } points[i] = path.points[i]; } Handles.DrawAAPolyLine(points); } }
static public void class2() { //Dxlib 前処理 { //垂直同期 DX.SetWaitVSyncFlag(DX.TRUE); {//ウィンドウモード DX.SetWindowStyleMode(9); Window_Width = 854; Window_Heigt = 480; DX.SetGraphMode(Window_Width, Window_Heigt, 32); DX.ChangeWindowMode(DX.TRUE); // window のサイズ変更の可不可 DX.SetWindowSizeChangeEnableFlag(DX.FALSE); } } //DxLib初期化 if (DX.DxLib_Init() == -1) { return; } //描写を裏画面に指定 DX.SetDrawScreen(DX.DX_SCREEN_BACK); DX.SetMouseDispFlag(DX.TRUE); int FontHandle = DX.CreateFontToHandle(null, -1, -1); int grhandle = DX.LoadGraph("Texture\\diamond_block.png"); int grhandle2 = DX.LoadGraph("Texture\\emerald_block.png"); RUI.R_UILibInit(); /* * RUI_Button Button1 = new RUI_Button(); * Button1.SetAllMode(false, true, false); * Button1.X1 = 3; * Button1.SetPoint(0, 0, 100, 100); * Button1.GrHandle = grhandle; * Button1.FontHandle = FontHandle; * Button1.SetString("おはよう"); */ RUI_Button[] buttons = new RUI_Button[10]; RUI_ButtonManager[] buttonManagers = new RUI_ButtonManager[10]; RUI_Manager rUI_Manager = new RUI_Manager(); int[] handle = new int[10]; { int i = 0; foreach (RUI_Button rUI_Button in buttons) { buttons[i] = new RUI_Button(); i++; } i = 0; foreach (RUI_Button rUI_Button in buttons) { rUI_Button.SetAllMode(false, true, true); rUI_Button.SetPoint(0 + i * 5, 0 + i * 5, 100 + i * 5, 100 + i * 5); rUI_Button.GrHandle = grhandle; rUI_Button.GrHandle2 = grhandle2; rUI_Button.FontHandle = FontHandle; rUI_Button.SetString("おはよう"); rUI_Button.SetDetectionMethod(RUI.LEFT, RUI.UP); i++; } } { int i = 0; foreach (RUI_ButtonManager rUI_ButtonManager in buttonManagers) { buttonManagers[i] = new RUI_ButtonManager(); i++; } i = 0; foreach (RUI_ButtonManager rUI_ButtonManager in buttonManagers) { rUI_ButtonManager.Add(buttons[i]); handle[i] = rUI_Manager.Add(rUI_ButtonManager); //Console.WriteLine(handle[i]); i++; } } while (DX.ScreenFlip() == 0 && DX.ProcessMessage() == 0 && DX.ClearDrawScreen() == 0) { RUI.UptadeMouseState(); foreach (RUI_Button rUI_Button in buttons) { } rUI_Manager.Detect(); rUI_Manager.Show(); { int i = 0; foreach (RUI_Button rUI_Button in buttons) { if (rUI_Button.DetectionResult == true) { rUI_Manager.Remove(handle[i]); Console.WriteLine("Detected!!!!!!!!!!!!!!!!!!"); } i++; } } /* * Button1.Show(); * if (Button1.DetectMouseClick(RUI.LEFT, RUI.UP) == true) * { * Console.WriteLine("Clicked"); * } */ } }
/// <summary> /// get icon following the TryGet* syntax /// </summary> /// <param name="name">the icon name</param> /// <param name="icon">the icon that matches the name, or the fallback if no matches were found</param> /// <returns>true if a matching icon was found, false if fallback was required</returns> public static bool tryGetIcon(string name, out RUI.Icons.Selectable.Icon icon) { if (string.IsNullOrEmpty(name)) { icon = PartCategorizer.Instance.iconLoader.iconDictionary[fallbackIcon]; return false; } if (Instance.iconDict.TryGetValue(name, out icon)) return true; if (PartCategorizer.Instance.iconLoader.iconDictionary.TryGetValue(name, out icon)) return true; icon = PartCategorizer.Instance.iconLoader.iconDictionary[fallbackIcon]; return false; }