public FootCheckMenu(PlayerController owner) : base(owner, Vector2.zero, Vector2.zero, "FootCheck") { var viewpos = new Vector2(Screen.width * 0.1f, Screen.height * 0.25f); var viewsize = new Vector2(WindowConfigure.fontScale(16f), WindowConfigure.fontScale(2f)); var view = new ViewOnlyWindow(viewpos, viewsize); MainWindow = view; WindowText wt = new WindowText("",MainWindow.TextAreaPosition); //Debug.Log("Owner On:"+owner.OnObjectEntity.Entity); this.OnObject = owner.OnObjectEntity; if (OnObject is ItemEntity) { //UseMenu = new SelectedItemUseMenu(OnObject.Entity as ItemBasis, WindowOwner, MainWindow.WindowPosition + new Vector2(MainWindow.WindowSize.x, 0),SelectedItemUseMenu.InventoryMode.FIELD); wt.Text = (OnObject.Object as ItemBasis).Name; } else if (OnObject is TrapEntity) { wt.Text = (OnObject.Object as TrapBasis).Name; } else if(OnObject is GateWayEntity){ wt.Text = (OnObject.Object as GateWayBasis).Name; } view.addWindowText(wt); //UseMenu.SubWindows.Add(view); //SubWindows.Add(UseMenu.MainWindow); }
public StringBoardMenu(MyCharacterController owener, int maxlength) : base(rowsize,columnsize,owener,pos, size, "StringBoardMenu") { CurrentText = new StringBuilder(maxlength); MaxLength = maxlength; BoardText = new WindowText[rowsize, columnsize]; Vector2 textpos0 = Window.TextAreaPosition+Vector2.one*WindowConfigure.fontScale(1f); for (int r = 0; r < rowsize; r++) { Vector2 prevpos = textpos0 + new Vector2(0,r*ymargin); for (int c = 0; c < columnsize; c++) { float xmargin = c%5==0 ? WindowConfigure.fontScale(1.5f) : WindowConfigure.fontScale(1.2f); xmargin = c == 0 ? WindowConfigure.fontScale(0.5f) : xmargin; Vector2 textpos = prevpos + new Vector2(xmargin, 0); BoardText[r, c] = new WindowText( "", textpos); prevpos = textpos; } } //string[] table = createHiraKanaTable(); setHirakanaTable(); setSystemText(); Window.MultiSelectMode = false; Vector2 dispsize = new Vector2(WindowConfigure.fontScale(maxlength +6), WindowConfigure.fontScale(1.5f)); Vector2 disppos = new Vector2(Window.WindowPosition.x + (Window.WindowSize.x/2 - dispsize.x/2),(Window.WindowPosition.y - dispsize.y)); InputDisplay = new ViewOnlyWindow(disppos, dispsize); WindowText prevtext = new WindowText("",InputDisplay.TextAreaPosition + new Vector2(WindowConfigure.fontScale(2f),-WindowConfigure.fontScale(0.3f))); InputDisplay.addWindowText(prevtext); SubWindows.Add(InputDisplay); Window.SkipText.Add(""); Window.ReplaceText.Add(WhiteSpace,""); }
public static void initInputMenu(int digitnumber, Vector2 pos, int initialnumbr,string nulllabel,bool replaceofzero,string prefix, string sufix, ViewOnlyWindow caption,bool invisiblecurrentmenu = true) { Menu = new NumeralDialMenu(digitnumber, pos, initialnumbr, nulllabel, replaceofzero, prefix, sufix); Menu.SubWindows.Clear(); Menu.SubWindows.Add(caption); isInit = true; InvisivleCurrentMenu = invisiblecurrentmenu; }
public YesNoMenu(MyCharacterController owner,ViewOnlyWindow captionwindow) : base(2,1,owner,new Vector2(captionwindow.Rect.xMin,captionwindow.Rect.yMax) + new Vector2(0,10),size,"YesNoMenu") { //Debug.Log("YESNOMenu!!!!!"); this.Window.MultiSelectMode = false; CaptionWindow = captionwindow; if (captionwindow != null) this.SubWindows.Add(captionwindow); yeslabel = new WindowText("はい",this.Window.TextAreaPosition); nolabel = new WindowText("いいえ", yeslabel.Position + new Vector2(0,WindowConfigure.fontScale(1.2f))); WindowText[,] yesno = { { yeslabel}, {nolabel } }; setTexts(yesno); PlayYesSound = true; PlayNoSound = true; }
protected override void initTalkAction() { base.initTalkAction(); selectmenu.setChoicesLabels(labels); selectmenu.ChoicesAction = action; message.setMessage(firstmessage); invmenu = new ItemInventoryMenu(GameController.MainPlayer,submitact); bankdislplay = new ViewOnlyWindow(WindowConfigure.createScreenPoint(0.5f, 0.3f), WindowConfigure.createFontScaleForVector(16f, 3f)); WindowText[] wts = new WindowText[2]; wts[0] = new WindowText("", bankdislplay.TextAreaPosition); wts[1] = new WindowText("", bankdislplay.TextAreaPosition+WindowConfigure.createFontScaleForVector(0,1.5f)); bankdislplay.addWindowText(wts); TalkAction.setTalkActions(new OpenMenu(message),new OpenMenu(selectmenu)); TalkAction.PreOperation = preoperaion; }
private void initParameterWindow() { ParameterWindow = new ViewOnlyWindow(pos2,size2,"PlayerParameter"); Vector2 textpos = ParameterWindow.TextAreaPosition + new Vector2(WindowConfigure.DefaultFontSize,0); paramtexts = new WindowText[5]; paramtexts[0] = new WindowText(atk, textpos + new Vector2(5, 10)); paramtexts[1] = new WindowText(def, textpos + new Vector2(5, 10+WindowConfigure.DefaultFontSize*2)); paramtexts[2] = new WindowText(hunger, textpos + new Vector2(5 + WindowConfigure.DefaultFontSize * 10, 10)); paramtexts[4] = new WindowText(exp, textpos + new Vector2(5 + WindowConfigure.DefaultFontSize * 20, 10 + WindowConfigure.DefaultFontSize * 2)); paramtexts[3] = new WindowText(strength, textpos + new Vector2(5 + WindowConfigure.DefaultFontSize * 10, 10 + WindowConfigure.DefaultFontSize * 2)); ParameterWindow.addWindowText(paramtexts); }
public ViewOnlyMenu(MyCharacterController owner,Vector2 pos, Vector2 size, string name = "ViewOnlyMenu") : base(owner,pos,size,name) { Window = new ViewOnlyWindow(pos, size); }
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(); }
public void initHeadLabel(string text) { headlabel = new ViewOnlyWindow(new Vector2(0, WindowConfigure.fontScale(0.5f)), new Vector2(Size.x, WindowConfigure.fontScale(1.8f))); headlabelText = new WindowText(text, headlabel.TextAreaPosition + new Vector2(WindowConfigure.fontScale(0.5f), 0)); headlabel.addWindowText(headlabelText); this.SubWindows.Add(headlabel); }