protected override void initPaymentMenu(PlayerController customer) { int pay = Merchant.getAmountPayment(); Skip = false; if (pay == 0) { Skip = true; return; } string[] captions = new string[3]; captions[0] = "代金は合わせて"; captions[1] = WindowConfigure.setColorTag(string.Format("{0,6}", pay), Color.yellow) + " Gに"; captions[2] = "にゃりますがよろしいですかにゃ?"; var submit = new YesNoMenu(customer, captions); submit.YesAct = delegate () { if (pay > customer.Parameter.Inventory.Wallet) { Message.setMessage("お金が足りませんにゃ。"); } else { customer.Parameter.Inventory.subMoney(pay); customer.Parameter.Inventory.payment(false); Merchant.getCommoditiesOutSideShop().ForEach(item => item.Object.payment(false)); Message.setMessage("お買い上げありがとうございますにゃ。"); GameController.DungeonInformation.ListOfUnpaidCommodityWhichNotExistOnFiled.Clear(); } //customer.Parameter.Inventory.remove(items); //MenuContoller.doDisableAllMenu(); submit.close(); MenuContoller.doEnableMenu(Message); Payment = true; }; submit.NoAct = delegate () { //MenuContoller.doDisableMenu(); Message.setMessage("それは残念ですにゃ。"); MenuContoller.doEnableMenu(Message); submit.cancelclose(); Payment = true; }; MenuContoller.doEnableMenu(submit); }
protected override void initPaymentMenu(PlayerController customer) { int pay = 0; int itemcount = Items.Length; foreach (ItemBasis item in Items) { pay += item.SellingPrice; if (item is IHasInventoryItem) { itemcount += (item as IHasInventoryItem).getInventory().ItemCount; pay += (item as IHasInventoryItem).getInventory().sumSellingPrice(); } } string[] captions = new string[3]; captions[0] = string.Format("全部で{0}個のアイテムを、", itemcount); captions[1] = WindowConfigure.setColorTag(string.Format("{0,6}", pay), Color.yellow) + " Gで、"; captions[2] = "売りますかにゃ?"; var submit = new YesNoMenu(customer, captions); submit.YesAct = delegate () { //customer.Parameter.Inventory.remove(items); customer.Parameter.Inventory.addMoney(pay); Message.setMessage("代金をお渡ししますにゃ。"); foreach (ItemBasis item in Items) { item.payment(true); } //MenuContoller.doDisableAllMenu(); submit.close(); MenuContoller.doEnableMenu(Message); Payment = true; }; submit.NoAct = delegate () { //MenuContoller.doDisableMenu(); Message.setMessage("それは残念ですにゃ。"); submit.cancelclose(); MenuContoller.doEnableMenu(Message); Payment = true; }; MenuContoller.doEnableMenu(submit); }
private void initOtherMenu() { List<string> strs = new List<string>(); strs.Add(StopGame); strs.Add(EagleEye); strs.Add(Configure); if (GameController.CurrentFieldMode == GameController.FieldMode.DUNGEON) strs.Add(Retire); Vector2 pos = WindowConfigure.createScreenPoint(0.4f,0.4f); Vector2 size = WindowConfigure.createFontScaleForVector(8,strs.Count+1.5f); othermenu = new MultiChoicesMenu(WindowOwner,strs.ToArray(),pos,size,othermenuaction); string firstsubmit = "今回の冒険をあきらめて脱出しますか?"; Vector2 submitpos = othermenu.Window.WindowPosition + WindowConfigure.createFontScaleForVector(0.5f, 1); Vector2 submitsize =WindowConfigure.getTextAreaSize(1f, 1f, firstsubmit); firstsubmitretire = new YesNoMenu(WindowOwner,submitpos,submitsize,firstsubmit); string[] secondsubmit = {"あきらめた場合倒れた扱いになります。","本当にあきらめますか?" }; submitpos += WindowConfigure.createFontScaleForVector(0.5f,0); submitsize = WindowConfigure.getTextAreaSize(1f,1f,secondsubmit); secondsubmitretire = new YesNoMenu(WindowOwner,submitpos,submitsize,secondsubmit); firstsubmitretire.YesAct = delegate { firstsubmitretire.close(); secondsubmitretire.open(); }; firstsubmitretire.NoAct = delegate { firstsubmitretire.cancelclose(); }; secondsubmitretire.YesAct = delegate { MenuContoller.doDisableAllMenu(); GameController.GameActionEvent.dungeonRitire(WindowOwner, GameController.DungeonInformation); }; secondsubmitretire.NoAct = delegate { secondsubmitretire.cancelclose();}; }
protected override void initTalkAction() { base.initTalkAction(); var message = TalkActionController.createPlayMessage(Controller, "いらっしゃいませにゃ。何か買っていくかにゃ?"); //var openmessage = (message.First.Value as OpenMenu); //openmessage.IsOperationExit = delegate { return openmessage.Menu.Opend; }; var last = message.Last; var openshop = new OpenShopMenu(Commodities); //openshop.Skip = true; //YesNoMenu yesno = new YesNoMenu(GameController.MainPlayer, new ViewOnlyWindow(Vector2.zero,Vector2.zero)); YesNoMenu yesno = new YesNoMenu(null, new ViewOnlyWindow(new Vector2(Screen.width / 3, Screen.height / 3), Vector2.zero)); yesno.PlayNoSound = false; yesno.PlayYesSound = false; yesno.YesAct = delegate () { openshop.Skip = false; openshop.PlayerSellMode = false; openshop.doneOpen = true; yesno.close(false); }; yesno.NoAct = delegate () { openshop.Skip = false; openshop.PlayerSellMode = true; openshop.doneOpen = true; yesno.close(false); //MenuContoller.doDisableAllMenu(); }; yesno.changeNoLabel("売る"); yesno.changeYesLabel("買う"); var openyesno = new OpenMenu(yesno, false, false); openyesno.doneOpen = true; ShopMenuOpen = openshop; TalkAction = new TalkActionController(); message.AddBefore(last, openyesno); message.AddLast(openshop); message.AddLast(new IdleTime(0.02f)); TalkAction.setTalkActions(message); TalkAction.PreOperation = preoperation; }