public void InitControls() { activeFilter = Item.Categories.Weapons; closeButton = (Godot.Button)Menu.Button(text: "Close", onClick: Close); AddChild(closeButton); itemList = new ItemList(); AddChild(itemList); itemList.AllowRmbSelect = true; itemList.Connect("item_selected", this, nameof(SelectItem)); itemList.Connect("item_activated", this, nameof(UseItem)); itemList.Connect("item_rmb_selected", this, nameof(DropItem)); itemInfo = (Godot.TextEdit)Menu.TextBox(""); itemInfo.Readonly = true; itemInfo.Hide(); AddChild(itemInfo); useButton = (Godot.Button)Menu.Button(text: "Use", onClick: UseItemAdapter); AddChild(useButton); useButton.Hide(); dropButton = (Godot.Button)Menu.Button(text: "Drop", onClick: DropItemAdapter); AddChild(dropButton); dropButton.Hide(); stashButton = (Godot.Button)Menu.Button(text: "Stash", onClick: StashItem); AddChild(stashButton); RefreshStashItemInfo(); weaponsButton = (Godot.Button)Menu.Button(text: "Weapons", onClick: FilterWeapons); AddChild(weaponsButton); apparelButton = (Godot.Button)Menu.Button(text: "Apparel", onClick: FilterApparel); AddChild(apparelButton); aidButton = (Godot.Button)Menu.Button(text: "Aid", onClick: FilterAid); AddChild(aidButton); miscButton = (Godot.Button)Menu.Button(text: "Misc", onClick: FilterMisc); AddChild(miscButton); ammoButton = (Godot.Button)Menu.Button(text: "Ammo", onClick: FilterAmmo); AddChild(ammoButton); weightInfo = (Godot.TextEdit)Menu.TextBox("WeightInfo"); weightInfo.Readonly = true; AddChild(weightInfo); }
public void InitControls() { savesList = new ItemList(); AddChild(savesList); savesList.AllowRmbSelect = true; savesList.Connect("item_selected", this, nameof(SelectSave)); savesList.Connect("item_activated", this, nameof(LoadSave)); foreach (string save in SettingsDb.GetAllSaves("adventure")) { savesList.AddItem(save); } backButton = Menu.Button("back", Back); AddChild(backButton); loadButton = Menu.Button("load", Load); AddChild(loadButton); }