Beispiel #1
0
        public void DeselectUnit()
        {
            lstLiving.SelectedItem = null;
            lstDead.SelectedItem   = null;
            _selectedUnit          = null;

            var message = "No unit is selected.";

            _unitViewerBlanket.SetMessage(message);
            _unitViewerBlanket.Cover();
        }
Beispiel #2
0
        private void LoadCharacter(Model.Character character)
        {
            if (character == null)
            {
                return;
            }

            var message = "";

            if (Enum.IsDefined(typeof(Enums.Character), character.CharacterID))
            {
                if (character.CorrinName != null)
                {
                    lblName.Text = character.CorrinName;
                }
                else if (Data.Database.Characters.GetByID(character.CharacterID).IsPrisoner)
                {
                    lblName.Text = Data.Database.Prisoners.GetByID(character.PrisonerID).DisplayName;
                }
                else
                {
                    lblName.Text = Data.Database.Characters.GetByID(character.CharacterID).DisplayName;
                }
            }
            else
            {
                lblName.Text = character.CharacterID.ToString();
            }

            try { classAndLevel1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Class and Level data"; }

            try { stats1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Stats data"; }

            try { unitBlockInfo1.LoadCharacter(_chapterSave, _selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Unit Block Info data"; }

            try { flags1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Flags data"; }

            try { battleData1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Battle data"; }

            try { skills1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Skills data"; }

            try { inventory1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Inventory data"; }

            try { accessories1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Accessories data"; }

            try { hairColor1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Hair Color data"; }

            try { weaponExperience1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Weapon Experience data"; }

            try { dragonVein1.LoadCharacter(_selectedCharacter); }
            catch (Exception) { message += Environment.NewLine + "Error loading Dragon Vein data"; }

            if (message.Length > 0)
            {
                message = "One or more values is invalid for this character. You can still use the hex editor, though." + Environment.NewLine + Environment.NewLine + message;
                _unitViewerBlanket.SetMessage(message);
                _unitViewerBlanket.Cover();

                btnOpenHexEditor.BringToFront();
            }
            else
            {
                _unitViewerBlanket.Uncover();
            }
        }