private void addButton_Click(object sender, EventArgs e) { string str = this.addList.SelectedItem.ToString(); GameData.Desc desc = GameData.getDesc(this.Item.type, str); ItemDialog itemDialog = new ItemDialog(string.Concat("选择与 ", str, " 进行关联"), this.nav.ou.gameData, desc.list, true, "", itemType.NULL_ITEM); if (itemDialog.ShowDialog() == DialogResult.OK) { foreach (GameData.Item item in itemDialog.Items) { int?nullable = null; int?nullable1 = nullable; nullable = null; int?nullable2 = nullable; nullable = null; this.Item.addReference(str, item, nullable1, nullable2, nullable); } if (itemDialog.Items.Count > 0) { this.refresh(this.Item); this.nav.refreshState(this.Item); this.nav.HasChanges = true; if (this.ChangeEvent != null) { this.ChangeEvent(this); } } } }
private void bItemReward_Click(object sender, EventArgs e) { ItemDialog dialog = new ItemDialog(this.parent, null, this, cur_locale_quest.QuestID, ITEM_LOCALIZATION_REWARD); dialog.Enabled = true; dialog.Visible = true; this.Enabled = false; }
private void ShowItemDialog(ItemDialogUsage usage) { var itemDialog = new ItemDialog(_gameState.Game); switch (usage) { case ItemDialogUsage.Drop: { itemDialog.Drop(); break; } case ItemDialogUsage.PickUp: { itemDialog.PickUp(); break; } case ItemDialogUsage.Toss: { itemDialog.Toss(); break; } case ItemDialogUsage.Use: { itemDialog.Use(); break; } default: { throw new ApplicationException("Invalid/Unhandled ItemDialogUsage"); } } itemDialog.Process(); var result = itemDialog.DialogResult; if (result == null) { return; } if (result.RequiresTargetDialog) { // This will clear the screen of anything the dialog overwrote. Draw(); var targetDialog = new TargetDialog(result.Item.type.tossAttack.Range, (target) => result.Command.SelectItem(_gameState.Game, result.Item, result.Location, result.ItemIndex, target), _gameState.Game); targetDialog.Process(); } else { result.Command.SelectItem(_gameState.Game, result.Item, result.Location, result.ItemIndex, null); } }
private void AddItem_Click(object sender, RoutedEventArgs e) { ItemDialog itemDialog = new ItemDialog(); bool? response = itemDialog.ShowDialog(); if (response == true) { this.GetItems(); } }
private void editItem_Click(object sender, RoutedEventArgs e) { Item item = (Item)itemGrid.SelectedItem; itemGrid.UnselectAll(); ItemDialog itemDialog = new ItemDialog(item); bool? response = itemDialog.ShowDialog(); if (response == true) { this.GetItems(); } }
// Use this for initialization void Start() { rb2d = GetComponent <Rigidbody2D>(); sprite = GetComponent <SpriteRenderer>(); rb2dInstances = new List <Rigidbody2D>(); projectile = Resources.Load <Rigidbody2D>("PlayerBall"); item = GameObject.Find("Canvas").GetComponent <ItemDialog>(); baseDamage = damage; defaultFireRate = fireRate; }
void Start() { player = GameObject.Find("Player"); dialog = GameObject.Find("Canvas").GetComponent <ItemDialog>(); //GameObject item = GameObject.FindGameObjectWithTag(gameObject.tag); //if(item.name != gameObject.name) //{ // gameObject.SetActive(false); //} SceneManager.sceneLoaded += OnSceneLoaded; //Item.Latch += CheckLatch; }
protected override void ButtonPressed() { PropertyGrid.PropertyGrid.Item item = this.mItem; PropertyGrid.PropertyGrid propertyGrid = this.mGrid; ItemDialog itemDialog = new ItemDialog("Referenced item", this.Source, this.TypeFilter, false, this.CustomFilter, itemType.NULL_ITEM); if (itemDialog.ShowDialog() == DialogResult.OK) { this.mItem = item; this.mGrid = propertyGrid; base.setValue(itemDialog.Items[0]); this.mItem = null; this.mGrid = null; } }
private void btnAdd_Click(object sender, EventArgs e) { var dialog = new ItemDialog(_unitOfWork, _comboView); var check = dialog.ShowDialog(); if (check.Equals(DialogResult.OK)) { MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadItemData(); this.SearchItem(); this.LoadGridItem(_selectedIndex); this.LoadModel(_model); } dialog.Dispose(); }
public void Reload() { Mysql mysql = FindObjectOfType <Mysql>(); List <Item> items = mysql.ReadItems(); for (int i = 0; i < container.transform.childCount; i++) { Transform child = container.transform.GetChild(i); if (child.transform.name != "itemsEntryTemplate") { Destroy(child.gameObject); } } float templateHeight = 20f; for (int i = 0; i < items.Count; i++) { Transform entryTransform = Instantiate(template, container); RectTransform entryRectTransform = entryTransform.GetComponent <RectTransform>(); entryRectTransform.anchoredPosition = new Vector2(0, -templateHeight * i - 10); entryTransform.gameObject.SetActive(true); int item_id = items[i].item_id; ItemDialog itemDialogScript = itemDialog.GetComponent <ItemDialog>(); entryTransform.Find("idText").GetComponent <Text>().text = items[i].item_id.ToString(); entryTransform.Find("nameText").GetComponent <Text>().text = items[i].name; entryTransform.Find("iconNameText").GetComponent <Text>().text = items[i].iconName; entryTransform.Find("itemTypeText").GetComponent <Text>().text = items[i].item_type; entryTransform.Find("attackText").GetComponent <Text>().text = items[i].attack.ToString(); entryTransform.Find("healthText").GetComponent <Text>().text = items[i].health.ToString(); entryTransform.Find("defenceText").GetComponent <Text>().text = items[i].defence.ToString(); entryTransform.Find("rotationText").GetComponent <Text>().text = items[i].rotation.ToString(); entryTransform.Find("speedText").GetComponent <Text>().text = items[i].speed.ToString(); entryTransform.Find("visibilityText").GetComponent <Text>().text = items[i].visibility.ToString(); entryTransform.Find("cannonReloadSpeedText").GetComponent <Text>().text = items[i].cannon_reload_speed.ToString(); entryTransform.Find("critChanceText").GetComponent <Text>().text = items[i].crit_chance.ToString(); Button editButton = entryTransform.Find("editButton").GetComponent <Button>(); editButton.onClick.AddListener(() => itemDialogScript.EditItem(item_id)); } }
// Use this for initialization void Start() { text = GetComponent <Text>(); dialog = GameObject.Find("Canvas").GetComponent <ItemDialog>(); }