private KeyCode ResolveKeyBoardKeyCode(ActionControl action) { switch (action) { case ActionControl.MoveFwd: return(KeyCode.Z); case ActionControl.MoveBck: return(KeyCode.S); case ActionControl.StraffRight: return(KeyCode.D); case ActionControl.StraffLeft: return(KeyCode.Q); case ActionControl.Fire: return(KeyCode.Mouse0); case ActionControl.Reload: return(KeyCode.R); case ActionControl.Action: return(KeyCode.A); case ActionControl.Run: return(KeyCode.LeftShift); case ActionControl.Pause: return(KeyCode.Escape); } return(KeyCode.None); }
private void btnSiparisKoduOlustur_Click(object sender, EventArgs e) { try { sqlCmd = new SqlCommand("SELECT TOP 1 SIPARIS_INCKEY FROM SIPARIS ORDER BY SIPARIS_INCKEY DESC", Program.connection); SqlDataReader sqlReader = sqlCmd.ExecuteReader(); if (sqlReader.HasRows) { ActionControl.ActionAllControls(this, "clear"); siparisListesiGridView.Rows.Clear(); siparisListesiGridView.Refresh(); txtSiparisTarih.Text = DateTime.Now.ToString("dd.MM.yyyy"); txtSiparisTeslimTarih.Text = DateTime.Now.ToString("dd.MM.yyyy"); sqlReader.Read(); txtSiparisKodu.Text = "SP" + (int.Parse(sqlReader["SIPARIS_INCKEY"].ToString()) + 1).ToString("D10"); siparisKod = txtSiparisKodu.Text; sqlReader.Close(); } else { txtSiparisKodu.Text = "SP0000000001"; } } catch (Exception ex) { Notification.messageBoxError(ex.Message); } }
private KeyCode ResolveKeyCode(int playerId, KeyMapping keyMap, ActionControl action) { KeyCode keyCode = KeyCode.None; switch (keyMap) { case KeyMapping.KeyBoard: keyCode = ResolveKeyBoardKeyCode(action); break; case KeyMapping.LogitechDualAction: keyCode = ResolveLogitechDualActionKeyCode(playerId, action); break; case KeyMapping.LogitechF310: keyCode = ResolveLogitechF310KeyCode(playerId, action); break; case KeyMapping.XBox360: keyCode = ResolveXBox360KeyCode(playerId, action); break; case KeyMapping.PS3: keyCode = ResolvePS3KeyCode(playerId, action); break; } return(keyCode); }
private void OnUpdate(object sender, GameTimerEventArgs e) { if (isClose) { return; } if (process != null) { process.Load(); process.Calls(); elapsedTime = e.ElapsedTime.Ticks / 10000L; process.InputUpdate(elapsedTime); ActionControl.Update(elapsedTime); timerContext.millisSleepTime = sleepTime; timerContext.timeSinceLastUpdate = elapsedTime; process.RunTimer(timerContext); process.Unload(); } if (useXNAListener) { sl_listener.Update(GamePage, e); } }
protected override void Update(GameTime gameTime) { if (isClose) { return; } if (process != null) { process.Load(); process.Calls(); elapsedTime = gameTime.ElapsedGameTime.Ticks / 10000L; process.InputUpdate(elapsedTime); ActionControl.Update(elapsedTime); timerContext.millisSleepTime = sleepTime; timerContext.timeSinceLastUpdate = elapsedTime; process.RunTimer(timerContext); process.Unload(); } if (useXNAListener) { xna_listener.Update(this, gameTime); } if (UseXNA) { base.Update(gameTime); } }
/// <summary> /// Create a control from an <c>OptionDefinition</c>, optionally providing <paramref name="categoryPrefix" /> to remove /// the category name from the start of the control. /// </summary> /// <param name="from"></param> /// <param name="categoryPrefix"></param> /// <returns></returns> public static OptionsControlBase CreateControl(OptionDefinition from, string categoryPrefix = null) { if (_dataControlPrefabs == null) { _dataControlPrefabs = Resources.LoadAll <DataBoundControl>(SRDebugPaths.DataControlsResourcesPath); } if (_actionControlPrefab == null) { _actionControlPrefab = Resources.LoadAll <ActionControl>(SRDebugPaths.DataControlsResourcesPath).FirstOrDefault(); } if (_actionControlPrefab == null) { Debug.LogError("[SRDebugger.Options] Cannot find ActionControl prefab."); } if (from.Property != null) { return(CreateDataControl(from, categoryPrefix)); } if (from.Method != null) { return(CreateActionControl(from, categoryPrefix)); } throw new Exception("OptionDefinition did not contain property or method."); }
private void excelButton_Click(object sender, EventArgs e) { if (OperatorRaporuGridView.Rows.Count > 0) { string defaultFileName = DateTime.Now.ToString("ddMMyyyy") + "_OperatorRaporu.xlsx"; ActionControl.ExportExcel(defaultFileName, operatorRaporTable); } }
private void CleanForm() { ActionControl.ClearTextBoxes(txtName); cbSchedule.SelectedIndex = 0; cbStatus.SelectedIndex = 0; numericUpDown1.Value = 0; mTxtIdentification.Text = null; }
private void excelButton_Click(object sender, EventArgs e) { if (makineRaporu.Rows.Count > 0) { string defaultFileName = DateTime.Now.ToString("ddMMyyyy") + "_MakineRaporu.xlsx"; ActionControl.ExportExcel(defaultFileName, makineRaporu); } }
public bool RemoveKey(ActionControl control, ActionKeyCode key) { if (actionMapping[control].Remove(key)) { usedKeys.Remove(key); return(true); } return(false); }
private void ManageSubModulePanel(object btn, Panel panel = null) { ActionControl.HighLigthBtn(btn, sideBar); HideSubModulePanel(); if (panel != null) { panel.Visible = !panel.Visible; } }
public override void UpdateModule() { m_LastMousePosition = m_MousePosition; m_MousePosition = Input.mousePosition; horizontal = InputMaster.GetAxis(m_Horizontal); vertical = InputMaster.GetAxis(m_Vertical); submit = InputMaster.GetAction(m_Submit); cancel = InputMaster.GetAction(m_Cancel); }
public bool GetKey(int playerId, KeyMapping keyMap, ActionControl action) { KeyCode keyCode = ResolveKeyCode(playerId, keyMap, action); if (keyCode != KeyCode.None) { return(Input.GetKey(keyCode)); } return(false); }
//public Button CustomerMemorableWord { get; private set; } private void Initialize() { // page element control CustomerSearch = new Inbox(TextElement); KeyEnter = new ActionControl(); ResultList = new Label(Result); DesireResult = new Button(); CustomerDetailsSummary = new Label(SummaryDetails); //CustomerMemorableWord = new Button(); }
void Update() { if (localPlayer == null) { localPlayer = GameObject.Find("local player"); if (controlPanel.activeSelf) { controlPanel.SetActive(false); } } else { if (animator == null || networkAnimator == null || actionControl == null) { animator = localPlayer.GetComponent <Animator>(); networkAnimator = localPlayer.GetComponent <NetworkAnimator>(); actionControl = localPlayer.GetComponent <ActionControl>(); localId = actionControl.netId.ToString(); } if (!controlPanel.activeSelf && !disableControl) { ResetControl(); } if (disableControl && controlPanel.activeSelf) { controlPanel.SetActive(false); } } if (oponent == null) { if (isSet) { isSet = false; } oponent = GameObject.Find("oponent"); } else { if (!isSet) { shootAnimator.SetTrigger("Shoot"); RefreshEverything(); actionControl.SetOwnRatio(localPlayer.GetComponent <NetworkIdentity>().netId.ToString(), localPlayer.GetComponent <Player>().ratio); isSet = true; } } if (localPlayer == null && oponent == null && !isRefresed) { RefreshEverything(); } GetKeyInput(); }
public override void BeHited(Actor srcActor, bool isBack, bool isFly, float animGauge) { base.BeHited(srcActor, isBack, isFly, animGauge); { SpasticityAction action = ActionControl.AddAction(ActorAction.ENType.enSpasticityAction) as SpasticityAction; if (null != action) { action.LastTime = 0.50f; } } }
private void addAction(ActionControl action) { if (usedActionPoints - action.actionStats.ActionPoints >= 0) { selectedActions.Add(action); usedActionPoints -= action.actionStats.ActionPoints; updateTexts(); } else if (addActionError != null) { addActionError(action); } }
public static ActionControl GetInstance() { if (instanceAction != null) { return(instanceAction); } lock (typeof(ActionControl)) { if (instanceAction == null) { instanceAction = new ActionControl(); } return(instanceAction); } }
//初始化同伴的位置 public void InitPartnerPosition() { if (IsDead) { return; } Vector3 pos = ActorManager.Singleton.MainActor.MainPos + ActorManager.Singleton.MainActor.MainObj.transform.forward * -1; if (SM.RandomRoomLevel.Singleton.QuickFindPath(pos, ActorManager.Singleton.MainActor.MainPos)) { ForceMoveToPosition(pos); ActionControl.AddAction(ActorAction.ENType.enStandAction); } }
public bool GetKey(ActionControl control) { bool isKeyDown = false; foreach (ActionKeyCode key in keyBinding.GetActionKeyCodes(control)) { isKeyDown = gamepad.GetButton(key); if (isKeyDown) { return(true); } } return(false); }
private void CleanForm() { ActionControl.ClearTextBoxes(txtDescription); cbStatus.SelectedIndex = 0; if (cbBrand.Items.Count > 0) { cbBrand.SelectedIndex = 0; } if (cbType.Items.Count > 0) { cbType.SelectedIndex = 0; } }
public void ActorEnter(Vector3 pos, Vector3 forward, int targetID, Vector3 targetPos, bool isAttack) { IsActorExit = false; //隐藏collider EnableCollider(false); //设置位置 UnhideMe(pos); //设置朝向 MainObj.transform.forward = forward; IsMoveAfterSwitch = false; if (targetPos != Vector3.zero) {//move IsMoveAfterSwitch = true; CurrentCmd = new Player.Cmd(targetPos); } else if (isAttack) {//attack FireNormalSkill(); } //初始化技能UI OnInitSkillBag(true); //通知headUI NotifyChanged((int)Actor.ENPropertyChanged.enMainHead, EnMainHeadType.enHpChanged); NotifyChanged((int)Actor.ENPropertyChanged.enMainHead, EnMainHeadType.enSwitchActor); //target TargetManager.CurrentTarget = ActorManager.Singleton.Lookup(targetID); //入场action ActionControl.AddAction(ActorAction.ENType.enActorEnterAction); //remove buff if (CurrentTableInfo.SwitchBuffIDList.Count != 0) { List <float> paramList = new List <float>(1 + CurrentTableInfo.SwitchBuffIDList.Count); paramList.Add((float)ResultRemoveBuff.ENRemoveBuffType.enBuffID); paramList.AddRange(CurrentTableInfo.SwitchBuffIDList); IResult r = BattleFactory.Singleton.CreateResult(ENResult.RemoveBuff, ID, ID, 0, 0, paramList.ToArray()); if (r != null) { r.ResultExpr(paramList.ToArray()); BattleFactory.Singleton.DispatchResult(r); } } //camera MainGame.Singleton.MainCamera.MoveAtOnce(this); }
private void Start() { camera = Camera.main.gameObject; cameraController = transform.parent.gameObject; playerController = cameraController.transform.parent.gameObject; Model = playerController.GetComponent <ActionControl>().playerModel; _action = playerController.GetComponent <ActionControl>(); if (!IsAi) { //游戏开始时让鼠标游标消失 Cursor.lockState = CursorLockMode.Locked; } }
private void CleanForm() { TextBox[] controls = { txtDescription, txtChassis, txtLicense, txtMotor }; ActionControl.ClearTextBoxes(controls); cbStatus.SelectedIndex = 0; if (cbModel.Items.Count > 0) { cbModel.SelectedIndex = 0; } if (cbFuel.Items.Count > 0) { cbFuel.SelectedIndex = 0; } }
private void toolStripButton1_Click(object sender, EventArgs e) { ActionControl.ActionAllControls(groupBox1, "clear"); ActionControl.ActionAllControls(groupBox2, "clear"); ActionControl.ActionAllControls(groupBox3, "clear"); ActionControl.ActionAllControls(groupBox4, "clear"); cbStokDepo.Items.Clear(); siparisListesiGridView.Rows.Clear(); siparisStokList.Clear(); siparisTipi.SelectedIndex = 0; txtSiparisTarih.Text = DateTime.Now.ToString("dd.MM.yyyy"); txtSiparisTeslimTarih.Text = DateTime.Now.ToString("dd.MM.yyyy"); }
private void CleanForm() { ActionControl.ClearTextBoxes(txtDescription); ActionControl.ClearTextBoxes(txtChassis); ActionControl.ClearTextBoxes(txtLicense); ActionControl.ClearTextBoxes(txtMotor); cbStatus.SelectedIndex = 0; if (cbModel.Items.Count > 0) { cbModel.SelectedIndex = 0; } if (cbFuel.Items.Count > 0) { cbFuel.SelectedIndex = 0; } }
public bool SwitchActorEnter(Vector3 pos, Vector3 forward) { ActorAction action = ActionControl.AddAction(ActorAction.ENType.enActorEnterAction); if (action != null) { action.IsSyncPosition = true; action.SyncPosition = pos; //隐藏collider EnableCollider(false); //设置朝向 MainObj.transform.forward = forward; IsActorExit = false; return(true); } return(false); }
private KeyCode ResolvePS3KeyCode(int playerId, ActionControl action) { switch (action) { case ActionControl.Fire: switch (playerId) { case 0: return(KeyCode.Joystick1Button5); case 1: return(KeyCode.Joystick2Button5); case 2: return(KeyCode.Joystick3Button5); case 3: return(KeyCode.Joystick4Button5); default: return(KeyCode.None); } case ActionControl.Reload: switch (playerId) { case 0: return(KeyCode.Joystick1Button4); case 1: return(KeyCode.Joystick2Button4); case 2: return(KeyCode.Joystick3Button4); case 3: return(KeyCode.Joystick4Button4); default: return(KeyCode.None); } } return(KeyCode.None); }
public float GetAxis(int playerId, KeyMapping keyMap, ActionControl action) { if (keyMap == KeyMapping.KeyBoard) { bool isAction = GetKey(playerId, keyMap, action); if (isAction) { switch (action) { case ActionControl.MoveFwd: return(1); case ActionControl.MoveBck: return(-1); case ActionControl.StraffRight: return(-1); case ActionControl.StraffLeft: return(1); } } else { switch (action) { case ActionControl.AimRight: case ActionControl.AimLeft: return(-Input.GetAxis("Mouse X")); case ActionControl.AimUp: case ActionControl.AimDown: return(Input.GetAxis("Mouse Y")); } } } else { String axisName = ResolveAxis(playerId, keyMap, action); return(-Input.GetAxis(axisName)); } return(0); }
public override bool CreateNeedModels() { if (MainObj != null) { return(true); } if (m_npcInfo == null) { Debug.LogError("npc CreateNeedModels fail, id=" + ID + ",tableid=" + IDInTable); return(false); } ENNpcType npcType = (ENNpcType)m_npcInfo.Type; string npcPrefab = "Model/EnemyB"; switch (npcType) { case ENNpcType.enBlockNPC: case ENNpcType.enFunctionNPC: case ENNpcType.enBoxNPC: npcPrefab = "Model/EnemyA"; break; case ENNpcType.enBOSSNPC: npcPrefab = "Model/EnemyBoss"; BaseMass = 100; break; case ENNpcType.enCommonNPC: break; } if (CanNotBeAttack()) { Load(npcPrefab, m_npcInfo.ModelId, m_npcInfo.ModelScale, WeaponType); ActionControl.AddDisableCount(ActorAction.ENType.enSpasticityAction); } else { Load(npcPrefab, m_npcInfo.ModelId, m_npcInfo.ModelScale, WeaponType); } return(true); }
public BoardGame(GameHandler gameHandler, Level level) { InitializeComponent(); m_GameHandler = gameHandler; m_Level = level; player = gameHandler.player; robot1 = gameHandler.robot1; robot2 = gameHandler.robot2; robot3 = gameHandler.robot3; m_ActionControl = new ActionControl(m_GameHandler, this); m_UpdateListBoxes = new UpdateListBoxes(m_GameHandler, this); m_NewTurnHelper = new NewTurnHelper(m_GameHandler, this); m_RobotTurns = new RobotsTurn(m_GameHandler, this, m_NewTurnHelper, m_UpdateListBoxes, m_Level); m_CalculateNextPlayer = new CalculateNextPlayer(m_RobotTurns, m_GameHandler, this, m_NewTurnHelper); FieldLabel = new Label[] { l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36, l37, l38, l39 }; FieldLabelOwner = new Label[] { WhoHaveThis0, WhoHaveThis1, WhoHaveThis2, WhoHaveThis3, WhoHaveThis4, WhoHaveThis5, WhoHaveThis6, WhoHaveThis7, WhoHaveThis8, WhoHaveThis9, WhoHaveThis10, WhoHaveThis11, WhoHaveThis12, WhoHaveThis13, WhoHaveThis14, WhoHaveThis15, WhoHaveThis16, WhoHaveThis17, WhoHaveThis18, WhoHaveThis19, WhoHaveThis20, WhoHaveThis21, WhoHaveThis22, WhoHaveThis23, WhoHaveThis24, WhoHaveThis25, WhoHaveThis26, WhoHaveThis27, WhoHaveThis28, WhoHaveThis29, WhoHaveThis30, WhoHaveThis31, WhoHaveThis32, WhoHaveThis33, WhoHaveThis34, WhoHaveThis35, WhoHaveThis36, WhoHaveThis37, WhoHaveThis38, WhoHaveThis39 }; Field = new PictureBox[] { Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13, Field14, Field15, Field16, Field17, Field18, Field19, Field20, Field21, Field22, Field23, Field24, Field25, Field26, Field27, Field28, Field29, Field30, Field31, Field32, Field33, Field34, Field35, Field36, Field37, Field38, Field39 }; PlayerBox.Text = player.Name; Robot1Box.Text = robot1.Name; Robot2Box.Text = robot2.Name; Robot3Box.Text = robot3.Name; PlayerBalance.Text = player.Balance.ToString(); Robot1Balance.Text = robot1.Balance.ToString(); Robot2Balance.Text = robot2.Balance.ToString(); Robot3Balance.Text = robot3.Balance.ToString(); ButtonTip.SetToolTip(Exit, "Kilépés a menübe"); ButtonTip.SetToolTip(ThrowWithTheCubes, "Dobás a kockákkal"); ButtonTip.SetToolTip(DrawTheCard, "Kártya felhúzása"); ButtonTip.SetToolTip(LetsDoIt, "Ásatás elvégzése"); ButtonTip.SetToolTip(EndTurn, "Végeztél a köröddel"); ButtonTip.SetToolTip(TradePropertyCard, "Lelet csere"); ButtonTip.SetToolTip(StealPassiveAbility, "Képesség lopás"); }
/// <summary> /// Creates an action button with the given behavior (ActionControl). The ActionControlStyle of the given actionControl will be overwritten. /// </summary> public ActionButtonSetup( string text, ActionControl actionControl ) { this.text = text; this.actionControl = actionControl; }
/// <summary> /// Creates an action button with the given behavior (ActionControl). The ActionControlStyle of the given actionControl will be overwritten. /// </summary> public ActionButtonSetup( string text, ActionControl actionControl, ActionControlIcon icon = null ) { this.text = text; this.icon = icon; this.actionControl = actionControl; }
//------------------------------------ CUSTOM METHODS ------------------------------------------// public void onActionPresssed(ActionControl action) { addAction(action); }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { ++count; ChildWindow childForm = new ChildWindow(Persons); childForm.MdiParent = this; ac += new ActionControl(childForm.Add); rf += new ActionControl(childForm.RefreshTable); childForm.Text = "Data Entry - " + count; childForm.Show(); }