Пример #1
0
        private void AddSelect_Item(SHItemAddRemoveType nItemAddRemoveType)
        {
            if (tvDialogDetail.SelectedNode == null || tvDialogDetail.SelectedNode.Tag == null)
            {
                return;
            }

            Type nodeType = tvDialogDetail.SelectedNode.Tag.GetType();

            if (nodeType == typeof(SHDialogSelect))
            {
                SHDialogSelect      dialogSelect = (SHDialogSelect)tvDialogDetail.SelectedNode.Tag;
                SHItemAddRemoveBase newItem      = SHItemAddRemove.NewItem(nItemAddRemoveType);

                newItem.id     = 0;
                newItem.amount = 0;

                if (dialogSelect.Item == null)
                {
                    dialogSelect.Item = new SHItemAddRemove();
                }
                dialogSelect.Item.dataList.Add(newItem);

                TreeNode newNode = ProcessItem(tvDialogDetail.SelectedNode, newItem);

                tvDialogDetail.SelectedNode = newNode;
            }

            Global._VelixianForms.FindForm("DIALOG").Touch();
        }
Пример #2
0
                public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e)
                {
                    base.OnValueChanged(sender, e);

                    SHQuest quest = (SHQuest)sender.Grid.Tag;

                    if (quest == null)
                    {
                        return;
                    }

                    int selectedRow = sender.Position.Row;

                    SourceGrid.Grid grid = (sender.Grid as SourceGrid.Grid);

                    SHItemAddRemoveBase item = (SHItemAddRemoveBase)(grid.Rows[selectedRow].Tag);

                    if (sender.Position.Column == 0)
                    {
                        SHItemAddRemoveBase newItem = SHItemAddRemove.NewItem((SHItemAddRemoveType)sender.Value);
                        newItem.id     = item.id;
                        newItem.amount = item.amount;

                        quest.Items.dataList[selectedRow - 1] = newItem;
                    }
                    else if (sender.Position.Column == 1)
                    {
                        item.id = (int)sender.Value;
                    }
                    else if (sender.Position.Column == 2)
                    {
                        item.amount = (int)sender.Value;
                    }

                    m_GridController.RefreshPropertyGrid(selectedRow);

                    Global._VelixianForms.FindForm("QUEST").Touch();
                }