Beispiel #1
0
        private void Load_Click(object sender, RoutedEventArgs e)
        {
            var loadWindow = new LoadWindow();
            Decks = new List<Model.Deck>();
            loadWindow.ShowDialog();

            AddSelectedDeckToList(loadWindow);
        }
Beispiel #2
0
        private void ViewModel_LoadGameOpen(object sender, EventArgs e)
        {
            viewModel.SelectedGame = null;

            loadWindow             = new LoadWindow();
            loadWindow.DataContext = viewModel;
            loadWindow.ShowDialog();
        }
        /// <summary>
        /// Játék betöltés választó eseménykezelője.
        /// </summary>
        private void ViewModel_LoadGameOpen(object sender, System.EventArgs e)
        {
            _viewModel.SelectedGame = null;             // kezdetben nincsen kiválasztott elem

            _loadWindow             = new LoadWindow(); // létrehozzuk a játék állapot betöltő ablakot
            _loadWindow.DataContext = _viewModel;
            _loadWindow.ShowDialog();                   // megjelenítjük dialógusként
        }
Beispiel #4
0
 private void ShowLoadWindow()
 {
     _log.ShowLogFun          += _loadWindow.Message;
     _loadWindow.TopMost       = true;
     _loadWindow.StartPosition = FormStartPosition.CenterParent;
     _loadWindow.ShowDialog();
     //_loadingThread = new Thread(() => { _loadWindow.ShowDialog(); });
     //_loadingThread.Start();
 }
        public bool ShowLoadWindow()
        {
            LoadWindow window = new LoadWindow();

            window.Owner = owner;
            if (window.ShowDialog() == true)
            {
                return(true);
            }
            SessionName = (window.DataContext as LoadViewModel).SelectedSession;
            IsConfirmed = (window.DataContext as LoadViewModel).IsConfirmed;
            return(false);
        }
Beispiel #6
0
        /// <summary>
        /// Játék betöltésének eseménykezelője.
        /// </summary>
        private async void ViewModel_LoadGame(object sender, System.EventArgs e)
        {
            //if (_openFileDialog == null) {
            //    _openFileDialog = new OpenFileDialog();
            //    _openFileDialog.Title = "Tic-Tac-Toe - Load Game";
            //    //_openFileDialog.Filter = "Szövegfájlok|*.txt";
            //}

            //// nyithatunk új nézetet
            //if (_openFileDialog.ShowDialog() == true) {
            //    try {
            //    _model.LoadGame(_openFileDialog.FileName); // játék betöltése
            //    } catch (Exception) {
            //        MessageBox.Show("An error occured during loading", "Tic-Tac-Toe", MessageBoxButton.OK, MessageBoxImage.Error);
            //    }
            //}
            _loadWindow = new LoadWindow(_dataAccess.GetList());
            _loadWindow.ShowDialog();
            if (_loadWindow.DialogResult.GetValueOrDefault(true))
            {
                _model.LoadGame(_loadWindow.saveName);
            }
        }
Beispiel #7
0
 private void LoadAdditional_Click(object sender, RoutedEventArgs e)
 {
     var loadWindow = new LoadWindow();
     loadWindow.ShowDialog();
     AddSelectedDeckToList(loadWindow);
 }
        private void Loadbutton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var c = new LoadWindow();

            c.Owner = this;
            c.ShowDialog();
            if (c.Choice == "")
            {
                return;
            }
            if (c.Choice != "DatLoad")
            {
                Microsoft.Win32.OpenFileDialog dig = new Microsoft.Win32.OpenFileDialog();
                //      dig.InitialDirectory = SaveSettings.Default.ProfileDirectory;
                dig.Filter     = "Concept Matrix Appearance File(*.cma;*.json)|*.cma;*.json";
                dig.DefaultExt = ".cma";
                if (dig.ShowDialog() == true)
                {
                    bool IsOld = File.ReadAllText(dig.FileName).Contains("\"value\":") ? true : false;
                    if (!IsOld)
                    {
                        CharSaves load1 = JsonConvert.DeserializeObject <CharSaves>(File.ReadAllText(dig.FileName));
                        if (c.Choice == "All" || c.Choice == "Appearance")
                        {
                            #region Actor Appearance
                            ((ByteArrayAddress)BaseModel.AddressList["ActorData"]).WriteMemory(Extensions.StringToByteArray(load1.CharacterBytes));
                            ((ByteAddress)BaseModel.AddressList["ActorVoice"]).WriteMemory(load1.characterDetails.Voices);
                            ((FloatAddress)BaseModel.AddressList["BustX"]).WriteMemory(load1.characterDetails.BustX);
                            ((FloatAddress)BaseModel.AddressList["BustY"]).WriteMemory(load1.characterDetails.BustY);
                            ((FloatAddress)BaseModel.AddressList["BustZ"]).WriteMemory(load1.characterDetails.BustZ);
                            ((FloatAddress)BaseModel.AddressList["MuscleTone"]).WriteMemory(load1.characterDetails.MuscleTone);
                            ((FloatAddress)BaseModel.AddressList["SkinRed"]).WriteMemory(load1.characterDetails.SkinRedPigment);
                            ((FloatAddress)BaseModel.AddressList["SkinGreen"]).WriteMemory(load1.characterDetails.SkinGreenPigment);
                            ((FloatAddress)BaseModel.AddressList["SkinBlue"]).WriteMemory(load1.characterDetails.SkinBluePigment);
                            ((FloatAddress)BaseModel.AddressList["SkinRedGloss"]).WriteMemory(load1.characterDetails.SkinRedGloss);
                            ((FloatAddress)BaseModel.AddressList["SkinGreenGloss"]).WriteMemory(load1.characterDetails.SkinGreenGloss);
                            ((FloatAddress)BaseModel.AddressList["SkinBlueGloss"]).WriteMemory(load1.characterDetails.SkinBlueGloss);
                            ((FloatAddress)BaseModel.AddressList["HairRed"]).WriteMemory(load1.characterDetails.HairRedPigment);
                            ((FloatAddress)BaseModel.AddressList["HairGreen"]).WriteMemory(load1.characterDetails.HairGreenPigment);
                            ((FloatAddress)BaseModel.AddressList["HairBlue"]).WriteMemory(load1.characterDetails.HairBluePigment);
                            ((FloatAddress)BaseModel.AddressList["HairRedGloss"]).WriteMemory(load1.characterDetails.HairGlowRed);
                            ((FloatAddress)BaseModel.AddressList["HairGreenGloss"]).WriteMemory(load1.characterDetails.HairGlowGreen);
                            ((FloatAddress)BaseModel.AddressList["HairBlueGloss"]).WriteMemory(load1.characterDetails.HairGlowBlue);
                            ((FloatAddress)BaseModel.AddressList["HiglightRed"]).WriteMemory(load1.characterDetails.HighlightRedPigment);
                            ((FloatAddress)BaseModel.AddressList["HiglightGreen"]).WriteMemory(load1.characterDetails.HighlightGreenPigment);
                            ((FloatAddress)BaseModel.AddressList["HiglightBlue"]).WriteMemory(load1.characterDetails.HighlightBluePigment);
                            ((FloatAddress)BaseModel.AddressList["LeftEyeRed"]).WriteMemory(load1.characterDetails.LeftEyeRed);
                            ((FloatAddress)BaseModel.AddressList["LeftEyeGreen"]).WriteMemory(load1.characterDetails.LeftEyeGreen);
                            ((FloatAddress)BaseModel.AddressList["LeftEyeBlue"]).WriteMemory(load1.characterDetails.LeftEyeBlue);
                            ((FloatAddress)BaseModel.AddressList["RightEyeRed"]).WriteMemory(load1.characterDetails.RightEyeRed);
                            ((FloatAddress)BaseModel.AddressList["RightEyeGreen"]).WriteMemory(load1.characterDetails.RightEyeGreen);
                            ((FloatAddress)BaseModel.AddressList["RightEyeBlue"]).WriteMemory(load1.characterDetails.RightEyeBlue);
                            ((FloatAddress)BaseModel.AddressList["MouthRed"]).WriteMemory(load1.characterDetails.LipsR);
                            ((FloatAddress)BaseModel.AddressList["MouthGreen"]).WriteMemory(load1.characterDetails.LipsG);
                            ((FloatAddress)BaseModel.AddressList["MouthBlue"]).WriteMemory(load1.characterDetails.LipsB);
                            ((FloatAddress)BaseModel.AddressList["MouthGloss"]).WriteMemory(load1.characterDetails.LipsBrightness);
                            ((FloatAddress)BaseModel.AddressList["LimbalRed"]).WriteMemory(load1.characterDetails.LimbalR);
                            ((FloatAddress)BaseModel.AddressList["LimbalGreen"]).WriteMemory(load1.characterDetails.LimbalG);
                            ((FloatAddress)BaseModel.AddressList["LimbalBlue"]).WriteMemory(load1.characterDetails.LimbalB);
                            #endregion
                        }
                        if (c.Choice == "All" || c.Choice == "Equipment")
                        {
                            #region Equipment
                            ushort[] ints  = new ushort[] { load1.MainHand.Item1, load1.MainHand.Item2, load1.MainHand.Item3, load1.MainHand.Item4 };
                            byte[]   bytes = ints.SelectMany(BitConverter.GetBytes).ToArray();
                            ((WeaponArray)BaseModel.AddressList["Mainhand"]).WriteMemoryX(bytes);

                            ints  = new ushort[] { load1.OffHand.Item1, load1.OffHand.Item2, load1.OffHand.Item3, load1.OffHand.Item4 };
                            bytes = ints.SelectMany(BitConverter.GetBytes).ToArray();
                            ((WeaponArray)BaseModel.AddressList["Offhand"]).WriteMemoryX(bytes);
                            byte[] EquipmentArray = Extensions.StringToByteArray(load1.EquipmentBytes);
                            //     GameProcess.WriteBytes(BaseModel.ActorData + BaseModel.Offsets.ActorEquipment, Extensions.StringToByteArray(load1.EquipmentBytes));
                            ((EquipmentArray)BaseModel.AddressList["Head"]).WriteMemoryX(EquipmentArray[0], EquipmentArray[1], EquipmentArray[2], EquipmentArray[3]);
                            ((EquipmentArray)BaseModel.AddressList["Body"]).WriteMemoryX(EquipmentArray[4], EquipmentArray[5], EquipmentArray[6], EquipmentArray[7]);
                            ((EquipmentArray)BaseModel.AddressList["Hands"]).WriteMemoryX(EquipmentArray[8], EquipmentArray[9], EquipmentArray[10], EquipmentArray[11]);
                            ((EquipmentArray)BaseModel.AddressList["Legs"]).WriteMemoryX(EquipmentArray[12], EquipmentArray[13], EquipmentArray[14], EquipmentArray[15]);
                            ((EquipmentArray)BaseModel.AddressList["Feet"]).WriteMemoryX(EquipmentArray[16], EquipmentArray[17], EquipmentArray[18], EquipmentArray[19]);
                            ((EquipmentArray)BaseModel.AddressList["Ears"]).WriteMemoryX(EquipmentArray[20], EquipmentArray[21], EquipmentArray[22], 0);
                            ((EquipmentArray)BaseModel.AddressList["Neck"]).WriteMemoryX(EquipmentArray[24], EquipmentArray[25], EquipmentArray[26], 0);
                            ((EquipmentArray)BaseModel.AddressList["Wrist"]).WriteMemoryX(EquipmentArray[28], EquipmentArray[29], EquipmentArray[30], 0);
                            ((EquipmentArray)BaseModel.AddressList["RRing"]).WriteMemoryX(EquipmentArray[32], EquipmentArray[33], EquipmentArray[34], 0);
                            ((EquipmentArray)BaseModel.AddressList["LRing"]).WriteMemoryX(EquipmentArray[36], EquipmentArray[37], EquipmentArray[38], 0);

                            ((FloatAddress)BaseModel.AddressList["WeaponX"]).WriteMemory(load1.characterDetails.WeaponX);
                            ((FloatAddress)BaseModel.AddressList["WeaponY"]).WriteMemory(load1.characterDetails.WeaponY);
                            ((FloatAddress)BaseModel.AddressList["WeaponZ"]).WriteMemory(load1.characterDetails.WeaponZ);
                            ((FloatAddress)BaseModel.AddressList["OffhandX"]).WriteMemory(load1.characterDetails.OffhandX);
                            ((FloatAddress)BaseModel.AddressList["OffhandY"]).WriteMemory(load1.characterDetails.OffhandY);
                            ((FloatAddress)BaseModel.AddressList["OffhandZ"]).WriteMemory(load1.characterDetails.OffhandZ);
                            ((FloatAddress)BaseModel.AddressList["OffhandRed"]).WriteMemory(load1.characterDetails.OffhandRed);
                            ((FloatAddress)BaseModel.AddressList["OffhandGreen"]).WriteMemory(load1.characterDetails.OffhandGreen);
                            ((FloatAddress)BaseModel.AddressList["OffhandBlue"]).WriteMemory(load1.characterDetails.OffhandBlue);
                            ((FloatAddress)BaseModel.AddressList["WeaponRed"]).WriteMemory(load1.characterDetails.WeaponRed);
                            ((FloatAddress)BaseModel.AddressList["WeaponGreen"]).WriteMemory(load1.characterDetails.WeaponGreen);
                            ((FloatAddress)BaseModel.AddressList["WeaponBlue"]).WriteMemory(load1.characterDetails.WeaponBlue);
                            #endregion
                        }
                    }
                    else
                    {
                        OldCharSaves load1 = JsonConvert.DeserializeObject <OldCharSaves>(File.ReadAllText(dig.FileName));
                        if (c.Choice == "All" || c.Choice == "Appearance")
                        {
                            #region Actor Appearance
                            ((ByteArrayAddress)BaseModel.AddressList["ActorData"]).WriteMemory(Extensions.StringToByteArray(load1.CharacterBytes));
                            ((ByteAddress)BaseModel.AddressList["ActorVoice"]).WriteMemory(load1.characterDetails.Voices.value);
                            ((FloatAddress)BaseModel.AddressList["BustX"]).WriteMemory(load1.characterDetails.BustX.value);
                            ((FloatAddress)BaseModel.AddressList["BustY"]).WriteMemory(load1.characterDetails.BustY.value);
                            ((FloatAddress)BaseModel.AddressList["BustZ"]).WriteMemory(load1.characterDetails.BustZ.value);
                            ((FloatAddress)BaseModel.AddressList["MuscleTone"]).WriteMemory(load1.characterDetails.MuscleTone.value);
                            ((FloatAddress)BaseModel.AddressList["SkinRed"]).WriteMemory(load1.characterDetails.SkinRedPigment.value);
                            ((FloatAddress)BaseModel.AddressList["SkinGreen"]).WriteMemory(load1.characterDetails.SkinGreenPigment.value);
                            ((FloatAddress)BaseModel.AddressList["SkinBlue"]).WriteMemory(load1.characterDetails.SkinBluePigment.value);
                            ((FloatAddress)BaseModel.AddressList["SkinRedGloss"]).WriteMemory(load1.characterDetails.SkinRedGloss.value);
                            ((FloatAddress)BaseModel.AddressList["SkinGreenGloss"]).WriteMemory(load1.characterDetails.SkinGreenGloss.value);
                            ((FloatAddress)BaseModel.AddressList["SkinBlueGloss"]).WriteMemory(load1.characterDetails.SkinBlueGloss.value);
                            ((FloatAddress)BaseModel.AddressList["HairRed"]).WriteMemory(load1.characterDetails.HairRedPigment.value);
                            ((FloatAddress)BaseModel.AddressList["HairGreen"]).WriteMemory(load1.characterDetails.HairGreenPigment.value);
                            ((FloatAddress)BaseModel.AddressList["HairBlue"]).WriteMemory(load1.characterDetails.HairBluePigment.value);
                            ((FloatAddress)BaseModel.AddressList["HairRedGloss"]).WriteMemory(load1.characterDetails.HairGlowRed.value);
                            ((FloatAddress)BaseModel.AddressList["HairGreenGloss"]).WriteMemory(load1.characterDetails.HairGlowGreen.value);
                            ((FloatAddress)BaseModel.AddressList["HairBlueGloss"]).WriteMemory(load1.characterDetails.HairGlowBlue.value);
                            ((FloatAddress)BaseModel.AddressList["HiglightRed"]).WriteMemory(load1.characterDetails.HighlightRedPigment.value);
                            ((FloatAddress)BaseModel.AddressList["HiglightGreen"]).WriteMemory(load1.characterDetails.HighlightGreenPigment.value);
                            ((FloatAddress)BaseModel.AddressList["HiglightBlue"]).WriteMemory(load1.characterDetails.HighlightBluePigment.value);
                            ((FloatAddress)BaseModel.AddressList["LeftEyeRed"]).WriteMemory(load1.characterDetails.LeftEyeRed.value);
                            ((FloatAddress)BaseModel.AddressList["LeftEyeGreen"]).WriteMemory(load1.characterDetails.LeftEyeGreen.value);
                            ((FloatAddress)BaseModel.AddressList["LeftEyeBlue"]).WriteMemory(load1.characterDetails.LeftEyeBlue.value);
                            ((FloatAddress)BaseModel.AddressList["RightEyeRed"]).WriteMemory(load1.characterDetails.RightEyeRed.value);
                            ((FloatAddress)BaseModel.AddressList["RightEyeGreen"]).WriteMemory(load1.characterDetails.RightEyeGreen.value);
                            ((FloatAddress)BaseModel.AddressList["RightEyeBlue"]).WriteMemory(load1.characterDetails.RightEyeBlue.value);
                            ((FloatAddress)BaseModel.AddressList["MouthRed"]).WriteMemory(load1.characterDetails.LipsR.value);
                            ((FloatAddress)BaseModel.AddressList["MouthGreen"]).WriteMemory(load1.characterDetails.LipsG.value);
                            ((FloatAddress)BaseModel.AddressList["MouthBlue"]).WriteMemory(load1.characterDetails.LipsB.value);
                            ((FloatAddress)BaseModel.AddressList["MouthGloss"]).WriteMemory(load1.characterDetails.LipsBrightness.value);
                            ((FloatAddress)BaseModel.AddressList["LimbalRed"]).WriteMemory(load1.characterDetails.LimbalR.value);
                            ((FloatAddress)BaseModel.AddressList["LimbalGreen"]).WriteMemory(load1.characterDetails.LimbalG.value);
                            ((FloatAddress)BaseModel.AddressList["LimbalBlue"]).WriteMemory(load1.characterDetails.LimbalB.value);
                            #endregion
                        }
                        if (c.Choice == "All" || c.Choice == "Equipment")
                        {
                            #region Equipment
                            ushort[] ints  = new ushort[] { load1.MainHand.Item1, load1.MainHand.Item2, load1.MainHand.Item3, load1.MainHand.Item4 };
                            byte[]   bytes = ints.SelectMany(BitConverter.GetBytes).ToArray();
                            ((WeaponArray)BaseModel.AddressList["Mainhand"]).WriteMemoryX(bytes);

                            ints  = new ushort[] { load1.OffHand.Item1, load1.OffHand.Item2, load1.OffHand.Item3, load1.OffHand.Item4 };
                            bytes = ints.SelectMany(BitConverter.GetBytes).ToArray();
                            ((WeaponArray)BaseModel.AddressList["Offhand"]).WriteMemoryX(bytes);
                            byte[] EquipmentArray = Extensions.StringToByteArray(load1.EquipmentBytes);
                            //     GameProcess.WriteBytes(BaseModel.ActorData + BaseModel.Offsets.ActorEquipment, Extensions.StringToByteArray(load1.EquipmentBytes));
                            ((EquipmentArray)BaseModel.AddressList["Head"]).WriteMemoryX(EquipmentArray[0], EquipmentArray[1], EquipmentArray[2], EquipmentArray[3]);
                            ((EquipmentArray)BaseModel.AddressList["Body"]).WriteMemoryX(EquipmentArray[4], EquipmentArray[5], EquipmentArray[6], EquipmentArray[7]);
                            ((EquipmentArray)BaseModel.AddressList["Hands"]).WriteMemoryX(EquipmentArray[8], EquipmentArray[9], EquipmentArray[10], EquipmentArray[11]);
                            ((EquipmentArray)BaseModel.AddressList["Legs"]).WriteMemoryX(EquipmentArray[12], EquipmentArray[13], EquipmentArray[14], EquipmentArray[15]);
                            ((EquipmentArray)BaseModel.AddressList["Feet"]).WriteMemoryX(EquipmentArray[16], EquipmentArray[17], EquipmentArray[18], EquipmentArray[19]);
                            ((EquipmentArray)BaseModel.AddressList["Ears"]).WriteMemoryX(EquipmentArray[20], EquipmentArray[21], EquipmentArray[22], 0);
                            ((EquipmentArray)BaseModel.AddressList["Neck"]).WriteMemoryX(EquipmentArray[24], EquipmentArray[25], EquipmentArray[26], 0);
                            ((EquipmentArray)BaseModel.AddressList["Wrist"]).WriteMemoryX(EquipmentArray[28], EquipmentArray[29], EquipmentArray[30], 0);
                            ((EquipmentArray)BaseModel.AddressList["RRing"]).WriteMemoryX(EquipmentArray[32], EquipmentArray[33], EquipmentArray[34], 0);
                            ((EquipmentArray)BaseModel.AddressList["LRing"]).WriteMemoryX(EquipmentArray[36], EquipmentArray[37], EquipmentArray[38], 0);

                            ((FloatAddress)BaseModel.AddressList["WeaponX"]).WriteMemory(load1.characterDetails.WeaponX.value);
                            ((FloatAddress)BaseModel.AddressList["WeaponY"]).WriteMemory(load1.characterDetails.WeaponY.value);
                            ((FloatAddress)BaseModel.AddressList["WeaponZ"]).WriteMemory(load1.characterDetails.WeaponZ.value);
                            ((FloatAddress)BaseModel.AddressList["OffhandX"]).WriteMemory(load1.characterDetails.OffhandX.value);
                            ((FloatAddress)BaseModel.AddressList["OffhandY"]).WriteMemory(load1.characterDetails.OffhandY.value);
                            ((FloatAddress)BaseModel.AddressList["OffhandZ"]).WriteMemory(load1.characterDetails.OffhandZ.value);
                            ((FloatAddress)BaseModel.AddressList["OffhandRed"]).WriteMemory(load1.characterDetails.OffhandRed.value);
                            ((FloatAddress)BaseModel.AddressList["OffhandGreen"]).WriteMemory(load1.characterDetails.OffhandGreen.value);
                            ((FloatAddress)BaseModel.AddressList["OffhandBlue"]).WriteMemory(load1.characterDetails.OffhandBlue.value);
                            ((FloatAddress)BaseModel.AddressList["WeaponRed"]).WriteMemory(load1.characterDetails.WeaponRed.value);
                            ((FloatAddress)BaseModel.AddressList["WeaponGreen"]).WriteMemory(load1.characterDetails.WeaponGreen.value);
                            ((FloatAddress)BaseModel.AddressList["WeaponBlue"]).WriteMemory(load1.characterDetails.WeaponBlue.value);
                            #endregion
                        }
                    }
                }
                else
                {
                    return;
                }
            }
            else
            {
                CharacterSaveWindow SaveWindow = new CharacterSaveWindow();
                SaveWindow.Owner = this;
                SaveWindow.ShowDialog();
                if (SaveWindow.Choice != null)
                {
                    ((ByteArrayAddress)BaseModel.AddressList["ActorData"]).WriteMemory(SaveWindow.Choice);
                }
                else
                {
                    return;
                }
            }
        }