public void RenewRanking(int finisherPower) { bool bRankChanged = false; if (GameDatas.INT_SAVED_SCORES[0] < finisherPower) { GameDatas.INT_SAVED_SCORES[2] = GameDatas.INT_SAVED_SCORES[1]; GameDatas.INT_SAVED_SCORES[1] = GameDatas.INT_SAVED_SCORES[0]; GameDatas.INT_SAVED_SCORES[0] = finisherPower; bRankChanged = true; } else if (GameDatas.INT_SAVED_SCORES[1] < finisherPower) { GameDatas.INT_SAVED_SCORES[2] = GameDatas.INT_SAVED_SCORES[1]; GameDatas.INT_SAVED_SCORES[1] = finisherPower; bRankChanged = true; } else if (GameDatas.INT_SAVED_SCORES[2] < finisherPower) { GameDatas.INT_SAVED_SCORES[2] = finisherPower; bRankChanged = true; } if (bRankChanged) { TransText rankedText = finisherScoreText.transform.FindChild("Got Rank Text").GetComponent <TransText>(); rankedText.text.text = GameDatas.STRING_SCORE_RANKED; rankedText.ChangeScale(0.25f, 1.00f); } }
public bool Initialization() { bool bNoError = true; if (mainScene == null) { mainScene = GameObject.Find("Main Game").GetComponent <MainScene>(); } if (mainScene == null) { bNoError &= false; } mainScene.HideAllUI(); mainScene.ShowUI(0); uiInsertCoin = mainScene.uiGrp[0].transform.FindChild("Insert Coin Image").FindChild("Insert Coin Text").GetComponent <TransText>(); uiInsertCoinOutline = uiInsertCoin.gameObject.GetComponent <Outline>(); uiRanking = mainScene.uiGrp[0].transform.FindChild("Ranking Image").GetComponent <TransImage>(); uiRanking.SetPosition(new Vector3(0.00f, 32.00f, 0.00f), 1000.0f); uiRanking.GetComponent <Ranking>().RenewRankingScore(); uiMainTitle = mainScene.uiGrp[0].transform.FindChild("Main Title Image").GetComponent <TransImage>(); uiMainTitle.ChangeAlpha(1.00f, 1.00f); fDemoAnimPlayTime = Random.Range(GameDatas.FLOAT_DEMO_ANIMPLAY_DELAY_MIN, GameDatas.FLOAT_DEMO_ANIMPLAY_DELAY_MAX); bNextState = false; return(bNoError); }
public bool Initialization() { bool bNoError = true; if (mainScene == null) { mainScene = GameObject.Find("Main Game").GetComponent <MainScene>(); } if (mainScene == null) { bNoError &= false; } mainScene.HideAllUI(); mainScene.ShowUI(3); iLastScoreIndex = 0; bFinisherScoreShown = false; fScoreDelay = GameDatas.FLOAT_SCOREBOARD_DELAY_TIMER; scoreGrp = new TransText[mainScene.uiScoreTextGrp.Length]; for (int i = 0; i < mainScene.uiScoreTextGrp.Length; ++i) { scoreGrp[i] = mainScene.uiScoreTextGrp[i]; mainScene.uiScoreTextGrp[i].ChangeScale(0.00f, 0.00f); } scoreHead = mainScene.uiScoreTextGrp[0]; scoreUpperR = mainScene.uiScoreTextGrp[1]; scoreUpperL = mainScene.uiScoreTextGrp[2]; scoreLowerR = mainScene.uiScoreTextGrp[3]; scoreLowerL = mainScene.uiScoreTextGrp[4]; finisherScoreImg = mainScene.uiGrp[3].transform.FindChild("Finisher Score Image").GetComponent <TransImage>(); finisherScoreImg.ChangeAlpha(0.00f, 0.00f); finisherScoreImg.ChangeScale(0.00f, 0.00f); finisherScoreText = finisherScoreImg.transform.FindChild("Finisher Score Text").GetComponent <TransText>(); punchToMainText = mainScene.uiGrp[3].transform.FindChild("Punch to Main Text").GetComponent <TransText>(); blackFadeoutImg = mainScene.uiGrp[3].transform.FindChild("Black Fadeout Image").GetComponent <TransImage>(); return(bNoError); }
public EjFreeText(TransText pTransText) { this.transText = pTransText; this.LineType = (int)EjLineType.FREE_TEXT; }
public override void Engage(int keyValue) { switch (this.States().PeekState()) { case PROMPT_ENTER_TEXT: this.PromptText = PosContext.Instance.Parameters.getParam("PromptExtendedText"); PosContext.Instance.Operprompt.Update(this); //this.transType = (int)TotalType..PAID_IN; PosContext.Instance.ClearInput(); this.States().PopState(); this.States().PushState(GET_TEXT); break; case GET_TEXT: this.PopState(); string inputText = PosContext.Instance.InputLine; if (string.IsNullOrEmpty(inputText.Trim())) { this.States().Clear(); PosContext.Instance.ClearInput(); PosEventStack.Instance.NextEvent(); return; } transText = new TransText(); transText.Organization_no = PosSettings.Default.Organization; transText.Pos_no = PosSettings.Default.Station; transText.Store_no = PosSettings.Default.Store; transText.Extended_text = inputText; transText.Text_line_no = PosContext.Instance.CurrentEj.LineNo; //PosContext.Instance.CurrentEjItem.Text_line_no; transText.Trans_no = PosContext.Instance.TrxNo; transText.Line_no = PosContext.Instance.CurrentEj.LineNo; PosContext.Instance.CurrentEj.EjAdd(this); transText.Seq_no = PosContext.Instance.CurrentEj.SeqNo; transText.Add(); PosContext.Instance.Receipt.Update(this); PosContext.Instance.ClearInput(); this.States().PushState(GET_TEXT); PosContext.Instance.Operprompt.Update(this); //PosContext.Instance.HomeGUI(); // PosEventStack.Instance.NextEvent(); break; default: break; } }
public static Ej GetSuspendedEj(Transaction trans) { Ej transRecords = new Ej(); transRecords.LineNo = 0; transRecords.SeqNo = 0; //Do not load if not suspended if (trans.State == (int)Transaction.Status.SUSPEND) { trans.State = (int)(Transaction.Status.IN_PROGRESS); trans.UpdateState(); } //Create a header EjHeader ejHeader = new EjHeader(trans); transRecords.EjAddReload(ejHeader); //Get items TransItem item = new TransItem(); item.Trans_no = trans.Trans_no; item.Organization_no = trans.Organization_no; item.Store_no = trans.Store_no; item.Pos_no = trans.Pos_no; DataSet data = item.LoadByTransno(); DataTable dt = data.Tables[0]; foreach (DataRow dr in dt.Rows) { TransItem transItem = new TransItem(dr); if (transItem.State == (int)EjLineStates.PRICE_OVERRIDE) { continue; } if (transItem.State == (int)EjLineStates.VOID_ITEM) { continue; } if (transItem.State == (int)EjLineStates.VOID_SALE) { continue; } if (transItem.Line_no > transRecords.LineNo) { transRecords.LineNo = transItem.Line_no; } if (transItem.Seq_no > transRecords.SeqNo) { transRecords.SeqNo = transItem.Seq_no; } if (transItem.State == (int)EjLineStates.SUSPEND) { transItem.State = (int)EjLineStates.IN_PROGRESS; transItem.UpdateState(); } if (transItem.Reason_code == (int)EjItemReasonCodes.NORMAL_ITEM) { EjItem ejItem = new EjItem(transItem); transRecords.EjAddReload(ejItem); } if (transItem.Reason_code == (int)EjItemReasonCodes.SURCHARGE) { EjSurcharge ejSurcharge = new EjSurcharge(transItem); transRecords.EjAddReload(ejSurcharge); } } //Get promotions try { TransPromotion promo = new TransPromotion(); promo.Trans_no = trans.Trans_no; promo.Organization_no = trans.Organization_no; promo.Store_no = trans.Store_no; promo.Pos_no = trans.Pos_no; DataSet data1 = promo.LoadAllByTransId(); DataTable dt1 = data1.Tables[0]; foreach (DataRow dr1 in dt1.Rows) { TransPromotion transPromotion = new TransPromotion(dr1); if (transPromotion.Line_no > transRecords.LineNo) { transRecords.LineNo = transPromotion.Line_no; } if (transPromotion.Seq_no > transRecords.SeqNo) { transRecords.SeqNo = transPromotion.Seq_no; } if (transPromotion.State != (int)EjLineStates.VOID_ITEM) { transPromotion.State = (int)EjLineStates.IN_PROGRESS; transPromotion.UpdateState(); } EjPromotion ejPromotion = new EjPromotion(transPromotion); transRecords.EjAddReload(ejPromotion); } } catch { } //Get Tax try { TransTax ttax = new TransTax(); ttax.Trans_no = trans.Trans_no; ttax.Organization_no = trans.Organization_no; ttax.Store_no = trans.Store_no; ttax.Pos_no = trans.Pos_no; DataSet data2 = ttax.LoadByTransid(); DataTable dt2 = data2.Tables[0]; foreach (DataRow dr2 in dt2.Rows) { TransTax transTax = new TransTax(dr2); EjTax ejTax = new EjTax(transTax); transRecords.EjAddReload(ejTax); if (transTax.Line_no > transRecords.LineNo) { transRecords.LineNo = transTax.Line_no; } } } catch { } //Get Free Text try { TransText ttext = new TransText(); ttext.Trans_no = trans.Trans_no; ttext.Organization_no = trans.Organization_no; ttext.Store_no = trans.Store_no; ttext.Pos_no = trans.Pos_no; DataSet data3 = ttext.LoadByTransNo(); DataTable dt3 = data3.Tables[0]; foreach (DataRow dr3 in dt3.Rows) { if (ttext.Line_no > transRecords.LineNo) { transRecords.LineNo = ttext.Line_no; } if (ttext.Seq_no > transRecords.SeqNo) { transRecords.SeqNo = ttext.Seq_no; } TransText transText = new TransText(dr3); EjFreeText ejText = new EjFreeText(transText); transRecords.EjAddReload(ejText); } } catch { } try { //Get Sales person TransSalesPerson salesPerson = new TransSalesPerson(); salesPerson.Organization_no = trans.Organization_no; salesPerson.Trans_no = trans.Trans_no; salesPerson.Store_no = trans.Store_no; salesPerson.Pos_no = trans.Pos_no; DataSet dataSalP = salesPerson.LoadByTransNo(); DataTable dtSalP = dataSalP.Tables[0]; foreach (DataRow drSalP in dtSalP.Rows) { TransSalesPerson transSp = new TransSalesPerson(drSalP); EjSalesPerson ejSalP = new EjSalesPerson(transSp); transRecords.EjAddReload(ejSalP); } } catch { } //Get Bank EJ try { //Get Sales person TransBank transBank = new TransBank(); transBank.Organization_no = trans.Organization_no; transBank.Pos_no = trans.Pos_no; transBank.Store_no = trans.Store_no; transBank.Trans_no = trans.Trans_no; DataSet dataTBank = transBank.LoadByTransid(); DataTable dtTBank = dataTBank.Tables[0]; foreach (DataRow drTBank in dtTBank.Rows) { TransBank tb = new TransBank(drTBank); EjBank ejBank = new EjBank(tb); transRecords.EjAddReload(ejBank); } } catch { } //Get Payments made try { TransTender tender = new TransTender(); tender.Trans_no = trans.Trans_no; tender.Organization_no = trans.Organization_no; tender.Store_no = trans.Store_no; tender.Pos_no = trans.Pos_no; DataSet data1 = tender.LoadByTransid(); DataTable dt1 = data1.Tables[0]; foreach (DataRow dr1 in dt1.Rows) { TransTender transTender = new TransTender(dr1); EjTender ejTender = new EjTender(transTender); transRecords.EjAddReload(ejTender); } } catch { } transRecords.EjArrayList.Sort(new Ej()); return(transRecords); }