public DungeonParameter init() { DungeonCompositor dgc = new DungeonCompositor(); dgc.setDgMaterials(new WoodPillar(),new WoodFlooring(),new WoodWall()); DungeonParameter dgp = dgc.createParameter(); Debug.Log(dgp); return dgp; }
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(); }