static void Main(string[] args) { StateWindow window = new StateWindow(1000, 800, "Test", OpenTK.GameWindowFlags.Default); window.PushState(new TestState()); window.Run(60.0); window.Dispose(); }
static void Main(string[] args) { Genus2D.GameData.Preloader.PreLoadData(); StateWindow window = new StateWindow(1200, 800, "RPG Game", OpenTK.GameWindowFlags.FixedWindow); window.PushState(new States.LoginState()); window.Run(60.0); window.Dispose(); }
void AddStateWindow(FiniteState state) { StateWindow wnd = new StateWindow(); state.WindowRect.width = Mathf.Clamp(state.WindowRect.width,150,Mathf.Infinity); state.WindowRect.height = Mathf.Clamp(state.WindowRect.height,100,Mathf.Infinity); wnd.state = state; StateWindowMap.Add(state,wnd); StateWindows.Add(wnd); }
public EventPenjualan(StateWindow state, FSRESTAURANT.EVENT_PENJUALANRow epr) { dataep = new FSRESTAURANT.EVENT_PENJUALANDataTable(); InitializeComponent(); this.state = state; eprow = epr; data = new FSRESTAURANT.EVENT_PENJUALAN_DETAILDataTable(); temp = new FSRESTAURANT.EVENT_PENJUALAN_DETAILDataTable(); lblUp.Text = uppayment.ToString("N2"); }
private void Start() { characters = new List <Character>(); stateWindow = stateWindowObj.GetComponent <StateWindow>(); for (int i = 0; i < slot.Count; i++) { ObjectPool.Instance.MakeObj(transform, slot[i].gameObject, 1); ObjectPool.Instance.Deque(slot[i].name, new Vector2(SpawnPosX[i], transform.position.y)); characters.Add(transform.GetChild(i).GetComponent <Character>()); CharactersStateBarSetting(i); StartCoroutine(characters[i].ApplyHPRecovery()); } }
private void reverseState() { if (state == StateWindow.insert) { state = StateWindow.update; } else { state = StateWindow.insert; } btnDelete.Enabled = btnUpdate.Enabled = btnBook.Enabled = true; btnInsert.Enabled = cbCustomer.Enabled = cbEvent.Enabled = false; }
public EventInsert(StateWindow state, FSRESTAURANT.EVENT_HEADERRow header) { this.state = state; eheader = header; InitializeComponent(); //fill data from menu and fill the listbox MainForm.adapterMgr.MENU_HEADERTableAdapter.Fill(menudt); lbMenu.DisplayMember = "MENU_NAME"; lbMenu.ValueMember = "MENU_ID"; dv = menudt.AsDataView(); lbMenu.DataSource = dv; dv.Sort = "MENU_ID"; switch (state) { case StateWindow.insert: btnUpdate.Enabled = false; btnDelete.Enabled = false; break; case StateWindow.update: btnInsert.Enabled = false; tbNama.Text = header.EVENT_NAME; dtStart.Value = header.EVENT_START; dtStop.Value = header.EVENT_STOP; tbDescription.Text = header.DESCRIPTION; nmCapacity.Value = header.EVENT_HEAD_LIMIT; evdetail = new FSRESTAURANT.EVENT_DETAILDataTable(); foreach (FSRESTAURANT.EVENT_DETAILRow item in eheader.GetEVENT_DETAILRows()) { evdetail.ImportRow(item); } break; default: break; } evdetail.EVENT_IDColumn.AllowDBNull = true; DataColumn dc = new DataColumn("NAMA MENU", typeof(string)); evdetail.Columns.Add(dc); dvdetail = evdetail.AsDataView(); dgEventDetail.DataSource = evdetail; }
private void Button_Click(object sender, RoutedEventArgs e) { var source = e.Source as FrameworkElement; Debug.Assert(source != null, "Button_Click - source != null"); switch (source.Name) { case "Button0": { var window = new ParentChild.ParentWindow { Owner = this }; window.Show(); } break; case "Button1": { var window = new ActivateWindow { Owner = this, ShowActivated = false }; window.Show(); } break; case "Button2": { var window = new ClosingWindow { Owner = this }; window.Show(); } break; case "Button3": { var window1 = new LocationWindowCenterOwner { Owner = this }; window1.Show(); var window2 = new LocationWindowCenterScreen { Owner = this }; window2.Show(); var window3 = new LocationWindowManual { Owner = this }; window3.Show(); } break; case "Button4": { var window1 = new ZOrderWindowTopmost { Owner = this }; window1.Show(); var window2 = new ZOrderWindow { Owner = this }; window2.Show(); } break; case "Button5": { var window = new StateWindow { Owner = this }; window.Show(); } break; case "Button6": { var window = new DarstellungWindow { Owner = this }; window.Show(); } break; } }
/// <summary> /// 打开多波形界面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void OnBtnShowStateWindow(object sender, RoutedEventArgs e) { StateWindow win = new StateWindow(); win.ShowDialog(); }
// Select a window at the passed screen position public void SelectWindow(Vector2 position) { NodeWindow lastActiveWin = ActiveWindow; ActiveWindow = null; // Loop backwards through all the windows for ( int i = m_Windows.Count-1; i >=0; i-- ) { NodeWindow nodeWin = m_Windows[i]; // If the position is in the window if (ActiveWindow == null && nodeWin.IsInWindow(position)) { nodeWin.Active = true; ActiveWindow = nodeWin; StateWindow sWin = nodeWin as StateWindow; if (sWin == null) { // If the node is not a state node (no transition drawing), then we are now dragging the window Dragging = true; } else { if (!m_drawingNewTransition) { // If we are in the state window's dragging area and not in the transition drawing area, start dragging if (sWin.IsInDraggingArea(position)) { Dragging = true; } else { // Start drawing a new transition m_drawingNewTransition = true; m_newTransitionStart = position; m_fromStateWindow = sWin; } } else { // Finish drawing transition and create a new one m_drawingNewTransition = false; AT_StateTransition trans = CreateNewTransition( m_fromStateWindow, sWin ); ActiveWindow = GetCorrespondingWindow(trans); } } } else { nodeWin.Active = false; } } if (ActiveWindow != null) { Selection.activeGameObject = ActiveWindow.GetTreeNode().gameObject; // Put the selected window at the back of the window list so it is drawn on top of other windows m_Windows.Remove(ActiveWindow); m_Windows.Add(ActiveWindow); ActiveWindow.Active = true; RefreshVariablesWindow(); } else { } DateTime newClickTime = DateTime.Now; // If we clicked on the same window again if (lastActiveWin == ActiveWindow) { float timeDiff = (float)(DateTime.Now.Subtract(m_lastTimeWindowSelected).TotalSeconds); if (timeDiff < 1) { // Double-clicked on same window if (ActiveWindow != null) { AT_ContainerNode cont = ActiveWindow.GetTreeNode() as AT_ContainerNode; if (cont != null) { if (cont.Expandable) { // Select a child so that we draw all the children of this container if (cont.Children.Count > 0) { Selection.activeGameObject = cont.Children[0].gameObject; } else { if (cont.transform.childCount > 0) { Selection.activeGameObject = cont.transform.GetChild(0).gameObject; } } } } } else // Double-clicked in open space { // Move up to the next container node in the tree AT_ContainerNode cont = null; if (m_activeContainer != null && m_activeContainer.Parent != null) { cont = FindNextContainerNode(m_activeContainer.Parent.gameObject); } else { cont = FindNextContainerNode(Selection.activeGameObject.transform.parent.gameObject); } // If we can move up, do so if (cont != null) { if (cont.gameObject != m_selectedAnimationTree.Root.gameObject) { Selection.activeGameObject = cont.transform.GetChild(0).gameObject; } else { Selection.activeGameObject = cont.gameObject; } } } // Store the min clicked time to reset double click calculation newClickTime = DateTime.MinValue; } } m_lastTimeWindowSelected = newClickTime; // Check if we clicked the control variables window if (m_controlVarsWindow != null && m_controlVarsWindow.IsInWindow(position)) { ActiveWindow = m_controlVarsWindow; } }
// Add a new transition between the passed states to the current state-machine AT_StateTransition CreateNewTransition(StateWindow fromStateWin, StateWindow toStateWin) { if (fromStateWin == toStateWin) { return null; } AT_StateMachine sm = m_activeContainer as AT_StateMachine; AT_StateTransition trans = sm.AddTransition(fromStateWin.GetTreeNode() as AT_State, toStateWin.GetTreeNode() as AT_State); // Set these as dirty so Unity knows they need to be saved sm.SetDirty(); trans.SetDirty(); RebuildTreeGraph(); Selection.activeGameObject = trans.gameObject; return trans; }