Example #1
0
        private void EnterAShrineToEditBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }

            _shrineToEdit = enterAShrineToEditBox.Text;

            if (_shrineNames.Contains(_shrineToEdit))
            {
                for (int i = 0; i < _shrineNames.Count; i++)
                {
                    if (_shrineToEdit == _shrineNames[i])
                    {
                        _shrineIndex = i;
                    }
                }
                DisplayData.ShowShrineInfo(_shrineToEdit, _allShrines, editDetailBox);
                DisplayDefaultEditControls();
                dataToEditDropDown.SelectedIndex = -1;
            }
            else
            {
                MessageBox.Show("That's not a valid shrine name. Try again.");
            }
        }
Example #2
0
        private void Submit_Click(object sender, EventArgs e)
        {
            switch (completionTypeDropDown.Items.Count)
            {
            case 3:
                switch (completionTypeDropDown.SelectedIndex)
                {
                case 0:
                    _newType = "Blessing";
                    break;

                case 1:
                    _newType = "Combat";
                    break;

                default:
                    _newType = "Puzzle";
                    break;
                }

                EditData.ChangeType(_newType, ref _allShrines, _shrineIndex);
                break;

            case 2:
                _newCompletion = completionTypeDropDown.SelectedIndex == 0;
                EditData.ChangeCompletion(_newCompletion, ref _allShrines, _shrineIndex);
                break;
            }

            switch (dataToEditDropDown.SelectedIndex)
            {
            case 0:
                _updatedDetails = editDetailsBox.Text;
                EditData.ChangeDescription(_updatedDetails, ref _allShrines, _shrineIndex);
                break;

            case 3:
                _updatedDetails = editDetailsBox.Text;
                EditData.ChangeNotes(_updatedDetails, ref _allShrines, _shrineIndex);
                break;
            }

            submit.HideControl();
            changesSaved.ShowControl();
            editDetailsBox.Clear();
            completionTypeDropDown.SelectedIndex = -1;

            DisplayData.ShowShrineInfo(_shrineToEdit, _allShrines, editDetailBox);
            Xml.SaveChanges(_allShrines);
        }
Example #3
0
        private void QueryInputTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }

            _queryInput = queryInputTextBox.Text;

            if (_shrineNames.Contains(_queryInput))
            {
                DisplayData.ShowShrineInfo(_queryInput, _allShrines, viewDetailBox);
            }
            else if (_regions.Contains(_queryInput))
            {
                DisplayData.ShowShrinesInARegion(_queryInput, _allShrines, viewDetailBox);
            }
            else
            {
                DisplayData.ShowNotes(_queryInput, _allShrines, viewDetailBox);
            }
        }