Example #1
0
    public YesNoMenu showYesNoMenu()
    {
        m_yesNoMenu = (GameObject.Instantiate(m_yesNoMenuPrefab) as GameObject).GetComponent <YesNoMenu>();
        m_yesNoMenu.init();

        return(m_yesNoMenu);
    }
 public DungeonResultMenu()
     : base(null, pos, size, "DungeonResult")
 {
     submitrestart = new YesNoMenu(null, WindowConfigure.createScreenPoint(0.3f, 0.3f), WindowConfigure.createFontScaleForVector(caption.Length+1,2f), caption);
     submitrestart.YesAct = ()=>{
         MenuContoller.doDisableAllMenu();
         GameController.intoDungeon(GameController.DgParameterTable.CurrentIndex,false);
     };
     submitrestart.NoAct = loadNextScene;
 }
 public PlayerMainMenu(MyCharacterController owner)
     : base(owner,pos,size,"MainMenu")
 {
     WindowText[,] menus = new WindowText[2,2];
     menus[0, 0] = new WindowText(inventory, Window.TextAreaPosition+new Vector2(0,-5));
     menus[1, 0] = new WindowText(underfoot, menus[0,0].Position+new Vector2(0,WindowConfigure.fontScale(scale)));
     menus[0, 1] = new WindowText(logs, menus[0, 0].Position + new Vector2(WindowConfigure.fontScale(menus[0, 0].Text.Length+0.5f), 0));
     menus[1, 1] = new WindowText(others, menus[0, 0].Position + new Vector2(WindowConfigure.fontScale(menus[0, 0].Text.Length+0.5f), WindowConfigure.fontScale(scale)));
     Window.setText(menus);
     Window.MultiSelectMode = false;
     initParameterWindow();
     invmenu = new ItemInventoryMenu(owner);
     submitsave = new YesNoMenu(owner,new ViewOnlyWindow(WindowConfigure.ScreenCenter,WindowConfigure.createFontScaleForVector(13,2)));
     submitsave.CaptionWindow.addWindowText(new WindowText("冒険を中断しますか?",submitsave.CaptionWindow.TextAreaPosition));
     submitsave.YesAct = yesaction;
     submitsave.NoAct = noaction;
     SubWindows.Add(ParameterWindow);
 }
 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);
 }
Example #5
0
    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;
    }
 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();};
 }
Example #8
0
    public override void pushedDecideKey()
    {
        if (Commodities.Length == 0) return;
        int pay = 0;
        ItemBasis[] items;
        if (Window.MultiSelectedIndexList.Count == 0)
        {
            items = new ItemBasis[] {SelectedItem};
            //pay = payment(SelectedItem);
        }
        else {
            items = getMultiSelectedItemList().ToArray();
            //pay = payment(getMultiSelectedItemList().ToArray());
        }
        pay = payment(items);
        string[] captions = new string[3];
        captions[0] = string.Format("全部で{0}個のアイテムを、", items.Length);
        captions[1] = WindowConfigure.setColorTag(string.Format("{0,6}",pay),Color.yellow) + " Gで、";
        captions[2] = PlayerSellMode ? "売りますかにゃ?" : "買いますかにゃ?";
        var submit = new YesNoMenu(Customer,captions);
        submit.YesAct = delegate ()
        {

            if (!PlayerSellMode)
            {

                if (pay > Customer.Parameter.Inventory.Wallet)
                {
                    Message.setMessage("お金が足りませんにゃ。");
                }
                else
                {
                    if (Customer.Parameter.Inventory.isFreeCapasity(items.Length))
                    {
                        Customer.Parameter.Inventory.subMoney(pay);
                        foreach (var item in items) {
                            Customer.Parameter.Inventory.add(item.Clone());
                        }

                        Message.setMessage("お買い上げありがとうございますにゃ。");
                    }
                    else
                    {
                        Message.setMessage("持ちきれないほど買うのはダメですにゃ。");
                    }
                }
                MenuContoller.doDisableAllMenu();
                MenuContoller.doEnableMenu(Message);
            }
            else
            {
                Customer.Parameter.Inventory.remove(items);
                Customer.Parameter.Inventory.addMoney(pay);
                Message.setMessage("代金をお渡ししますにゃ。");
                MenuContoller.doDisableAllMenu();
                MenuContoller.doEnableMenu(Message);
            }
        };
        submit.NoAct = delegate () {
            //MenuContoller.doDisableMenu();
            submit.cancelclose();
        };
        MenuContoller.doEnableMenu(submit);

        //throw new NotImplementedException();
    }
    public DungeonCompositorMenu(PlayerController owner,CompositionLeve compositionlevel,int saveslotnumber)
        : base(rowsize,1,owner,pos,size,"DungeonCompositer")
    {
        this.PlayerInventoryItems = owner.Parameter.Inventory.FindAll(item => item is IDungeonMaterial).ToArray();
        this.PlayerWareHouseItems = owner.Parameter.WareHouseInventory.FindAll(item => item is IDungeonMaterial).ToArray();
        Window.SkipText.Add("");
        Window.WindoName = "ItemList";
        Window.HighLightVisibleWhenUnFocus = false;
        SelectedItems = new List<SelectedItemEntity>();
        init(PlayerInventoryItems);
        CurrentCompositionLevel = compositionlevel;
        SelectedItemTexts = new WindowText[(int)compositionlevel];
        CurrentInventory = SelectedInventory.PLAYER;
        resetPageText();
        CurrentFocusMenu = this.Window;
        ButtonMenu = new SelectableWindow(1, 3,pos + new Vector2(0,this.MainWindow.WindowSize.y + 40), WindowConfigure.createFontScaleForVector(12.5f,1.8f),"Button");
        ButtonMenu.HighLightVisibleWhenUnFocus = false;
        var buttons = new WindowText[3];
        var orgpos = ButtonMenu.TextAreaPosition;
        int idx = 0;
        buttons[0] = new WindowText(WareHouseLabel, orgpos);
        var posdelta = buttons[idx].Position + new Vector2(WindowConfigure.fontScale(buttons[idx].Text.Length + 1.2f), 0);
        buttons[1] = new WindowText(SubmitButton, posdelta);
        idx++;
        posdelta = buttons[idx].Position + new Vector2(WindowConfigure.fontScale(buttons[idx].Text.Length + 0.5f), 0);
        buttons[2] = new WindowText(CancelButton, posdelta);
        for (int i = 0; i < ButtonMenu.ColumnSize; i++) {
            ButtonMenu.setText(buttons[i], 0, i);
        }
        ButtonMenu.CurrentPageNum = 0;
        ButtonMenu.SelectColumnIndex = 0;
        ButtonMenu.SelectRowIndex = 0;
        ///
        Vector2 viewpos = this.Window.WindowPosition;
        viewpos.x +=  this.Window.WindowSize.x+10;
        Vector2 viewsize = new Vector2(WindowConfigure.fontScale(12),WindowConfigure.fontScale((int)compositionlevel*1.5f));
        SelectedItemWindow = new ViewOnlyWindow(viewpos, viewsize, "SelectedItem");
        orgpos = SelectedItemWindow.TextAreaPosition;
        for (int i = 0; i < SelectedItemTexts.Length; i++) {
            SelectedItemTexts[i] = new WindowText("",orgpos+new Vector2(0,WindowConfigure.fontScale(i*1.05f)));
        }
        SelectedItemWindow.addWindowText(SelectedItemTexts);
        resetSelectItemTexts();
        ///
        PreviewTexts = new WindowText[PreviewLables.Length];
        viewpos = SelectedItemWindow.WindowPosition + new Vector2(0, SelectedItemWindow.WindowSize.y + 80);
        viewsize = new Vector2(WindowConfigure.fontScale(12), WindowConfigure.fontScale(PreviewTexts.Length+1.5f));
        PreviewWindow = new ViewOnlyWindow(viewpos, viewsize, "Preview");
        orgpos = PreviewWindow.TextAreaPosition;
        ///---
        for (int i = 0; i < PreviewTexts.Length; i++) {
            PreviewTexts[i] = new WindowText(PreviewLables[i], orgpos+(new Vector2(0, WindowConfigure.fontScale(1.25f)*i)));
        }
        //PreviewTexts[0] = new WindowText(MaxRank,orgpos);
        //PreviewTexts[1] = new WindowText(MaxFloorNum, PreviewTexts[0].Position + new Vector2(0, WindowConfigure.fontScale(1.25f)));
        ///---
        PreviewWindow.addWindowText(PreviewTexts);
        ///

        Compositor = new DungeonCompositor();
        SaveSlotNumber = saveslotnumber;
        this.SubWindows.Add(PreviewWindow);
        this.SubWindows.Add(SelectedItemWindow);
        this.SubWindows.Add(ButtonMenu);

        ///
        SubmitCaption = new ViewOnlyWindow(submitpos, submitsize);
        SubmitCaption.addWindowText(new WindowText(SubmitText,SubmitCaption.TextAreaPosition));
        SubmitMenu = new YesNoMenu(owner, SubmitCaption);
        SubmitMenu.YesAct = delegate () {
            Debug.Log("Yes");
            MenuContoller.doDisableMenu(SubmitMenu);
            StringInputSystem.initInputMenu(owner, 12);
            StringInputSystem.menuOpen((text,iscancel) => {
                if (iscancel) return;
                var dgparam = Compositor.createParameter(text);
                GameController.DgParameterTable[SaveSlotNumber] = dgparam;
                for (int i = 0; i < GameController.DgParameterTable.TableSize; i++) {
                    var param = GameController.DgParameterTable[i];
                    string name;
                    if (param == null) {
                        name = "NULL";
                    }
                    else
                    {
                        name = param.DungeonName;
                    }
                    Debug.LogFormat("[{0}]:{1}", i, name);
                }
                MenuContoller.doDisableAllMenu();
            });
        };
        SubmitMenu.NoAct = delegate () {
            Debug.Log("No");
            SubmitMenu.cancelclose();
            changeFocus(WindowFocus.BUTTON);
        };

        ///
        if (PlayerInventoryItems.Length != 0)
        {
            changeFocus(WindowFocus.ITEM);
        }
        else
        {
            changeFocus(WindowFocus.BUTTON);
        }
        setOnePageTexts();
        updatePreview();
    }
Example #10
0
 void Awake()
 {
     S = this;
 }
Example #11
0
 void setSelecterLabels()
 {
     StringBuilder stb;
     string[] labels = new string[DataSaveSystem.MaxFileCount];
     for (uint i = 0; i < labels.Length; i++) {
         var headder = DataSaveSystem.getSaveDataHeadder(i);
         stb = new StringBuilder();
         int minutes = (int)headder.TotalPlayingTime.TotalMinutes;
         stb.AppendLine(string.Format("{0}: {1}  {2,3}:{3,2:00}",i,headder.PlayerName,minutes/60,minutes%60));
         stb.AppendLine(string.Format("{0,4}",headder.TimeStamp));
         labels[i] = stb.ToString();
     }
     fileselecter.setChoicesLabels(labels);
     fileselecter.setLabelsNewPosition(fileselecter.Window.TextAreaPosition,0,3f);
     submitcaption.addWindowText(new WindowText("このファイルではじめますか?",submitcaption.TextAreaPosition));
     submit = new YesNoMenu(null, submitcaption);
     submit.YesAct = yesact;
     submit.NoAct = noact;
 }