private void btnProperty_Click(object sender, EventArgs e) { if (this.lvwProcess.SelectedItems.Count >= 1) { int num = 0; while (num < this.lstProcess.Count) { if (((CLState)this.lstProcess[num]).OprKey == this.lvwProcess.SelectedItems[0].Text) { break; } num++; } CLState state = null; if (num < this.lstProcess.Count) { DlgProcessProperty property; state = this.lstProcess[num] as CLState; try { property = new DlgProcessProperty(state); } catch (Exception exception) { MessageBox.Show(exception.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (property.ShowDialog() == DialogResult.OK) { this.lstProcess[num] = property.State; this.FillListViewItem(this.lvwProcess.SelectedItems[0], state); } } } }
private ListViewItem FillListViewItem(ListViewItem item, CLState state) { item.SubItems.Clear(); item.Text = state.OprKey; item.SubItems.Add(state.CellSign); item.SubItems.Add(state.EleSignature ? "是" : "否"); item.SubItems.Add(state.EleSignature ? state.SgnSizeMode : ""); return(item); }
public DlgProcessProperty(ArrayList lstProcess) { this.InitializeComponent(); this.state = new CLState(); this.cmbSizeModel.Items.Add("自动"); this.cmbSizeModel.Items.Add("拉伸"); this.cmbSizeModel.Items.Add("简单居中"); this.cmbSizeModel.Items.Add("居中"); this.cmbSizeModel.Text = this.state.SgnSizeMode; this.cmbSign.SelectedIndex = 0; }
private ListViewItem FillListViewItem(CLState state) { return(new ListViewItem(state.OprKey) { SubItems = { state.CellSign, state.EleSignature ? "是" : "否", state.EleSignature ? state.SgnSizeMode : "" } }); }
public DlgProcessProperty(CLState state) { this.InitializeComponent(); if (state == null) { throw new Exception("该状态属性不完整。"); } this.state = state; this.cmbProcess.Text = state.OprKey; this.cmbSizeModel.Items.Add("自动"); this.cmbSizeModel.Items.Add("拉伸"); this.cmbSizeModel.Items.Add("简单居中"); this.cmbSizeModel.Items.Add("居中"); this.cmbSizeModel.Text = state.SgnSizeMode; this.cmbSign.Text = state.EleSignature ? "是" : "否"; this.txtCell.Text = state.CellSign.ToUpper(); this.txtCellDate.Text = state.CellDate.ToUpper(); this.chkTime.Checked = state.DateIncludeTime; this.textBox1.Text = state.CellDateFormat; }
// MoveTo tells the card to interpolate to a new position and rotation public void MoveTo(Vector3 ePos, Quaternion eRot) { // Make new interpolation lists for the card. // Position and Rotation will each have only two points. bezierPts = new List <Vector3>(); bezierPts.Add(transform.localPosition); // Current position bezierPts.Add(ePos); // Current rotation bezierRots = new List <Quaternion>(); bezierRots.Add(transform.rotation); // New position bezierRots.Add(eRot); // New rotation if (timeStart == 0) { timeStart = Time.time; } // timeDuration always starts the same but can be overwritten later timeDuration = MOVE_DURATION; state = CLState.to; }
private void InitializeProcess() { this.lstProcess = new ArrayList(); OWC.Range after = this.GetRange(1, 1); Label_0014: after = this.Find("<流程记录>", after); if (after == null) { return; } CLState state = new CLState { CellSign = after.Address }; try { PPCardCompiler.ExplainXml(after.Text.ToString(), state); } catch { goto Label_0014; } this.lstProcess.Add(state); goto Label_0014; }
private void Update() { switch (state) { case CLState.toHand: case CLState.toTarget: case CLState.toDrawpile: case CLState.toPirate: case CLState.toMerchant: case CLState.to: float u = (Time.time - timeStart) / timeDuration; float uC = Easing.Ease(u, MOVE_EASING); if (u < 0) { transform.localPosition = bezierPts[0]; transform.rotation = bezierRots[0]; return; } else if (u >= 1) { uC = 1; // Move from the to... state to the proper next state if (state == CLState.toHand) { state = CLState.hand; } if (state == CLState.toTarget) { state = CLState.target; } if (state == CLState.toDrawpile) { state = CLState.drawpile; } if (state == CLState.toPirate) { state = CLState.pirate; } if (state == CLState.toMerchant) { state = CLState.merchant; } if (state == CLState.to) { state = CLState.idle; } // Move to the final position transform.localPosition = bezierPts[bezierPts.Count - 1]; transform.rotation = bezierRots[bezierPts.Count - 1]; // Reset timeStart to 0 so it gets overwritten next time timeStart = 0; if (reportFinishTo != null) { reportFinishTo.SendMessage("CLCallback", this); reportFinishTo = null; } else if (callbackPlayer != null) { // If there's a callback Player // Call CLCallback directly on the Player callbackPlayer.CLCallback(this); callbackPlayer = null; } else { // If there is nothing to callback // Just let it stay still. } } else { // Normal interpolation behavior (0 <= u < 1) Vector3 pos = Utils.Bezier(uC, bezierPts); transform.localPosition = pos; Quaternion rotQ = Utils.Bezier(uC, bezierRots); transform.rotation = rotQ; if (u > 0.5f) { SpriteRenderer sRend = spriteRenderers[0]; if (sRend.sortingOrder != eventualSortOrder) { // Jump to the proper sort order SetSortOrder(eventualSortOrder); } if (sRend.sortingLayerName != eventualSortLayer) { // Jump to the proper sort layer SetSortingLayerName(eventualSortLayer); } } } break; } }