public void OpenPackageCreature(int index) { if (package == null) { package = Instantiate(packagePrefab); package.transform.parent = gameObject.transform; package.transform.localScale = Vector3.one; package.GetComponent <RectTransform>().position = new Vector3(Screen.width * 3 / 2, 0, 0); } CreatureFightData roomData = GameRoot.GetInstance().gameDataManager.GetInRoomConstructure(currRoomId); PackageUI packageUI = package.GetComponentInChildren <PackageUI>(); if (roomData == null) { return; } switch (roomData.con_type) { case 0: packageUI.Init(PackageType.IdleCreature, 1); package.transform.DOMoveX(Screen.width / 2, 0.3f); currIndex = index; packageUI.SelectAction += ChangeCreature; break; case 2: packageUI.Init(PackageType.IdlePartTool, 1); package.transform.DOMoveX(Screen.width / 2, 0.3f); currIndex = index; packageUI.SelectAction += ChangeCreature; break; } }
public override void OnUpdate(float timeStep) { if (updateResourcesTimeout.Update(timeStep, true)) { PackageUI.UpdateResourceDisplay(Level.HumanPlayer.Resources); } if (!Level.EditorMode) { bool endLevel = true; foreach (var player in Level.Players) { if (player.TeamID != Level.HumanPlayer.TeamID && player.TeamID != Level.NeutralPlayer.TeamID) { endLevel = false; } } if (endLevel) { Level.Input.EndLevelToEndScreen(true); } } }
// dungeon ui function public void OpenPackageConstructue() { PackageUI packageUI = package.GetComponentInChildren <PackageUI>(); packageUI.Init(PackageType.IdleConstructure, 1); package.transform.DOMoveX(Screen.width / 2, 0.3f); packageUI.SelectAction += ChangeStructure; }
public override void Initialize() { foreach (var player in Level.Players) { player.ChangeResourceAmount(myType.Wood, 10); player.ChangeResourceAmount(myType.Gold, 10); } PackageUI = new PackageUI(Level.UIManager, Level, !Level.EditorMode); }
internal void Cellcliick() { var value = WarGrid1.SelectedCells[0].Value.ToString(); var referencetype = Convert.ToInt32(WarGrid1.Rows[WarGrid1.SelectedCells[0].RowIndex].Cells[1].Value.ToString()); if (WarGrid1.SelectedCells[0].ColumnIndex == 0) { BookingInfoUI bk = new BookingInfoUI(long.Parse(value)); bk.ShowDialog(); } else if (WarGrid1.SelectedCells[0].ColumnIndex == 1) { } else if (WarGrid1.SelectedCells[0].ColumnIndex == 2) { if (referencetype == 1) { CustomerUI bk = new CustomerUI(long.Parse(value)); bk.ShowDialog(); } else if (referencetype == 2) { AgentUI bk = new AgentUI(long.Parse(value)); bk.ShowDialog(); } //BookingInfoUI b = new BookingInfoUI(long.Parse(value)); //b.ShowDialog(); } else if (WarGrid1.SelectedCells[0].ColumnIndex == 3) { } else if (WarGrid1.SelectedCells[0].ColumnIndex == 4) { PackageUI bk = new PackageUI(long.Parse(value)); bk.ShowDialog(); } else if (WarGrid1.SelectedCells[0].ColumnIndex == 5) { } else if (WarGrid1.SelectedCells[0].ColumnIndex == 6) { // long bookingidrec = long.Parse( WarGrid1.SelectedRows[0].Cells[0].Value.ToString()); var bookingidrec = long.Parse(WarGrid1.Rows[WarGrid1.SelectedCells[0].RowIndex].Cells[6].Value.ToString()); PrintUI bk = new PrintUI(bookingidrec); bk.ShowDialog(); } else if (WarGrid1.SelectedCells[0].ColumnIndex == 7) { } }
private void PackageCode_Link_Click(object sender, EventArgs e) { try { PackageUI p = new PackageUI(long.Parse(PackageCode_Link.Text)); p.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void TileInPackageAddNew_Click(object sender, EventArgs e) { try { PackageUI c = new PackageUI(); c.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public override void OnStart() { if (initSettings != null) { //Cold start foreach (var player in Level.Players) { player.ChangeResourceAmount(myType.Wood, 10 + initSettings.Value); player.ChangeResourceAmount(myType.Gold, 10 + initSettings.Value); initSettings.Dispose(); } } PackageUI.UpdateResourceDisplay(Level.HumanPlayer.Resources); }
public void ChangeCreature(List <int> list) { GameDataManager mng = GameRoot.GetInstance().gameDataManager; package.transform.DOMoveX(Screen.width * 3 / 2, 0.3f); int newCreature; if (list.Count > 0) { newCreature = list[0]; //data change mng.ChangeRoomSubData(currRoomId, currIndex, newCreature); } PackageUI packageUI = package.GetComponentInChildren <PackageUI>(); packageUI.SelectAction -= ChangeCreature; RefreshInfo(); }
public override void Unload() { try { SaveConfig(); // MonoModHooks.RemoveAll use mod.Name to unload the mod assembly LoadedLocalizer.File.SetField("<name>k__BackingField", "!Localizer"); LoadedLocalizer.SetField("name", "!Localizer"); PackageUI?.Close(); UIHost.Dispose(); Main.OnPostDraw -= OnPostDraw; HookEndpointManager.RemoveAllOwnedBy(this); Harmony.UnpatchAll(nameof(Localizer)); Harmony.UnpatchAll(nameof(Patches)); Kernel.Dispose(); PackageUI = null; Harmony = null; Kernel = null; _gameCultures = null; Config = null; Instance = null; } catch (Exception e) { Log.Error(e); } finally { _initiated = false; Log = null; } base.Unload(); }
public override void Dispose() { PackageUI.Dispose(); }
public override void OnStart() { PackageUI.UpdateResourceDisplay(Level.HumanPlayer.Resources); }
public override void LoadState(PluginDataWrapper fromPluginData) { PackageUI = new PackageUI(Level.UIManager, Level, !Level.EditorMode); }
public override void Initialize() { PackageUI = new PackageUI(Level.UIManager, Level, !Level.EditorMode); }
private void button7_Click(object sender, EventArgs e) { PackageUI p = new PackageUI(); p.ShowDialog(); }