Esempio n. 1
0
        public void AddSaveModifier(string saveShortName, int modifier)
        {
            if (Saves.Count == 0)
            {
                Saves.Add(saveShortName, modifier);
            }
            else
            {
                foreach (var save in Saves)
                {
                    if (save.Key == saveShortName)
                    {
                        if (modifier == 0)
                        {
                            Saves.Remove(saveShortName);
                            return;
                        }
                        else
                        {
                            Saves[saveShortName] = modifier;
                            return;
                        }
                    }
                }

                Saves.Add(saveShortName, modifier);
            }
        }
Esempio n. 2
0
 public void newGame()
 {
     Saves.removeFilesFromCurrentSaveFile();
     //Load into Character Creation
     PlayerPrefs.SetInt("playercreatefrom", Application.loadedLevel);
     Application.LoadLevel(1);
 }
Esempio n. 3
0
 public static void SaveWindowSettings()
 {
     if (_mainWindowSettingsSave != null)
     {
         bool ret = Saves.Save(Paths.APP_NAME, "MainWindowSettings", _mainWindowSettingsSave);//todo make async
     }
 }
Esempio n. 4
0
        /// <summary>
        /// For default initializing
        /// </summary>
        public TestSave(QuizContext context, List <SectionView> sectionViews)
        {
            _cx = context;

            Id = _GenerateId();

            foreach (var item in sectionViews)
            {
                var sectionSave = new SectionSave()
                {
                    View    = item,
                    Answers = new Dictionary <int, XmlModels.XmlBase>()
                };

                foreach (var test in item.Tests)
                {
                    var answerName = ((IAnswerName)test.Model).GetTypeName();

                    var answerInstance = (XmlBase)Activator.CreateInstance(XmlBase.GetType(answerName));

                    sectionSave.Answers.Add(test.Question.Id, answerInstance);
                }

                Saves.Add(item.Section.Id, sectionSave);
            }
        }
Esempio n. 5
0
 public IEnumerator LogicController(int lmid)
 {
     if (lmid == 0)
     {
         string[] tags = new string[] { "Player", "Enemy", "InstantDamage", "GenericInteraction",
                                        "Type 1 UI", "Logic", "MapSet", "MenuSet", "Canvas" };
         GameManager.sweeperScript.DestroyObjects(tags);
         Saves.Load();
         GameState.Current = Saves.saveStates[0];
         GameObject player1 = Instantiate(GameManager.boardScript.players[1], new Vector3(GameState.Current.Player1Serial.xPos, GameState.Current.Player1Serial.yPos), Quaternion.identity) as GameObject;
         GameObject player2 = Instantiate(GameManager.boardScript.players[2], new Vector3(GameState.Current.Player2Serial.xPos, GameState.Current.Player2Serial.yPos), Quaternion.identity) as GameObject;
         GameObject player3 = Instantiate(GameManager.boardScript.players[3], new Vector3(GameState.Current.Player3Serial.xPos, GameState.Current.Player3Serial.yPos), Quaternion.identity) as GameObject;
         GameObject player4 = Instantiate(GameManager.boardScript.players[4], new Vector3(GameState.Current.Player4Serial.xPos, GameState.Current.Player4Serial.yPos), Quaternion.identity) as GameObject;
         GameObject player5 = Instantiate(GameManager.boardScript.players[5], new Vector3(GameState.Current.Player5Serial.xPos, GameState.Current.Player5Serial.yPos), Quaternion.identity) as GameObject;
         GameObject player6 = Instantiate(GameManager.boardScript.players[6], new Vector3(GameState.Current.Player6Serial.xPos, GameState.Current.Player6Serial.yPos), Quaternion.identity) as GameObject;
         GameObject player7 = Instantiate(GameManager.boardScript.players[7], new Vector3(GameState.Current.Player7Serial.xPos, GameState.Current.Player7Serial.yPos), Quaternion.identity) as GameObject;
         GameManager.boardScript.BoardController(GameState.Current.BMID);
         yield break;
     }
     if (lmid == 1)
     {
         string[] tags = new string[] { "Player", "Enemy", "InstantDamage", "GenericInteraction",
                                        "Type 1 UI", "Logic", "MapSet", "MenuSet", "Canvas" };
         GameManager.sweeperScript.DestroyObjects(tags);
         if (File.Exists(@"C:\Users\marsh\Documents\BackGround Project\Assets\MyTutorialGame\References/savedGames.gd"))
         {
             Debug.Log("Method: LogicManager.LogicController -" + "logic reference list todo" + "(" + lmid + ")" + " - Deleting Current Save File");
             File.Delete(@"C:\Users\marsh\Documents\BackGround Project\Assets\MyTutorialGame\References/savedGames.gd");
         }
         Debug.Log("Method: LogicManager.LogicController -" + "logic reference list todo" + "(" + lmid + ")" + " - Creating New Save File");
         GameObject player1 = Instantiate(GameManager.boardScript.players[1], new Vector3(0, 0), Quaternion.identity) as GameObject;
         GameObject player2 = Instantiate(GameManager.boardScript.players[2], new Vector3(-20, -20), Quaternion.identity) as GameObject;
         GameObject player3 = Instantiate(GameManager.boardScript.players[3], new Vector3(-20, -20), Quaternion.identity) as GameObject;
         GameObject player4 = Instantiate(GameManager.boardScript.players[4], new Vector3(-20, -20), Quaternion.identity) as GameObject;
         GameObject player5 = Instantiate(GameManager.boardScript.players[5], new Vector3(-20, -20), Quaternion.identity) as GameObject;
         GameObject player6 = Instantiate(GameManager.boardScript.players[6], new Vector3(-20, -20), Quaternion.identity) as GameObject;
         GameObject player7 = Instantiate(GameManager.boardScript.players[7], new Vector3(-20, -20), Quaternion.identity) as GameObject;
         GameState.Current      = new GameState();
         GameState.Current.BMID = 1;
         GameManager.boardScript.BoardController(GameState.Current.BMID);
         Debug.Log("Method: LogicManager.LogicController -" + "logic reference list todo" + "(" + lmid + ")" + " - Complete");
         yield break;
     }
     if (lmid == 2)
     {
         GameState.Current.Player1Serial = Player1Controller.player1Serial;
         GameState.Current.Player2Serial = Player2Controller.player2Serial;
         GameState.Current.Player3Serial = Player3Controller.player3Serial;
         GameState.Current.Player4Serial = Player4Controller.player4Serial;
         GameState.Current.Player5Serial = Player5Controller.player5Serial;
         GameState.Current.Player6Serial = Player6Controller.player6Serial;
         GameState.Current.Player7Serial = Player7Controller.player7Serial;
         GameState.Current.BMID          = 1;
         GameState.Current.Location      = "Not Implemented";
         GameState.Current.DateTime      = System.DateTime.Now.ToString();
         Saves.Save();
     }
     yield break;
 }
Esempio n. 6
0
 public void SaveAsDefaults()
 {
     Saves.InstantSave(DefaultPath, keys);
     if (Saves.Exists(NormalPath))
     {
         Save();
     }
 }
Esempio n. 7
0
 private void InitialiseSavesMenus()
 {
     Saves.SaveData[] saves = Saves.GetSaveDatas();
     for (int i = 0; i < saves.Length; ++i)
     {
         InitialiseSaveCell(AddContent(saveMenuPrefab, savesContent).GetComponent <SaveCell>(), saves[i]);
     }
 }
Esempio n. 8
0
 public void saveCharacter()
 {
     if (characterId == null)
     {
         return;
     }
     Saves.saveCharacter(characterId, getCharacterString());
 }
Esempio n. 9
0
 public void deleteCharacter()
 {
     if (characterId == null)
     {
         return;
     }
     Saves.deleteCharacter(characterId);
 }
Esempio n. 10
0
 public void Save()
 {
     Saves.SaveData saveData = Saves.GetCurrentDataToSave();
     Saves.DeleteSaveFile(selectedSaveDateTime);
     Saves.CreateSaveFile(saveData);
     InitialiseSaveCell(selectedSaveCell, saveData);
     selectedSaveDateTime = saveData.saveDateTime;
 }
Esempio n. 11
0
 public void LoadSave()
 {
     StaticSettings.ReInitialize();
     Saves.LoadSaveFile(selectedSaveDateTime);
     MenusOpener.ClosesMenusEvent();
     GameMenu.CloseMenuEvent();
     SceneController.LoadSave();
 }
Esempio n. 12
0
    public void loadGame(GameObject textObject)
    {
        GameGUI.escapeMenuOpen = false;
        Text text = textObject.GetComponent <Text>();

        Saves.loadSave(text.text);
        Application.LoadLevel(2);
    }
Esempio n. 13
0
    //public Texture splashArt;

    /*
     * static float boxX = Screen.width/4.0f;
     * static float boxY = Screen.height/2.0f;
     * static float boxHeight = 250.0f;
     * static float boxWidth = 200.0f;
     * static float buttX = boxX = 20.0f;
     * static float buttWidth = 200.0f;
     */

    // Use this for initialization
    void Start()
    {
        // When the main level loads, check if there are any save files. If there are,
        // then enable the Load Game button, populate the list of save files in the UI,
        // and set Load Game to be the default selection instead of New Game
        saves = Saves.getSaveFiles();
        populateSaves();
        enableLoadButton();
    }
Esempio n. 14
0
        public void Update(SectionView view)
        {
            if (Saves.Keys.Contains(view.SectionId))
            {
                Saves.Remove(view.SectionId);
            }

            Saves.Add(view.SectionId, new SectionSave(view, _cx));
        }
Esempio n. 15
0
    public void CreateSave()
    {
        Saves.SaveData saveData = Saves.GetCurrentDataToSave();
        GameObject     g        = AddContent(saveMenuPrefab, savesContent);

        g.transform.SetAsFirstSibling();
        InitialiseSaveCell(g.GetComponent <SaveCell>(), saveData);
        Saves.CreateSaveFile(saveData);
    }
Esempio n. 16
0
        public static void LoadFiles()
        {
            binfile = new Saves();
            binfile.LoadSave(raw_binfile.FullName);
            VoxelUtils.ChunkSize = binfile.ChunkSize;

            xmlfile = new XmlDocument();
            xmlfile.Load(raw_xmlfile.FullName);
        }
Esempio n. 17
0
 private List <MenuItem> getFirstList()
 {
     Instance.BestTimeText.gameObject.SetActive(false);
     _inHs = false;
     Instance.LockIcon.SetActive(false);
     return(new List <MenuItem>
     {
         new MenuItem("PLAY", () =>
         {
             SwitchItems(getSecondList());
         }),
         new MenuItem("HIGH SCORES", () =>
         {
             _inHs = true;
             WebUtils.FetchScores();
             var item0 = new MenuItem(HighScores.GetString(0), () => SwitchItems(getFirstList()), p0, 0.5f, false);
             var item1 = new MenuItem(HighScores.GetString(1), () => SwitchItems(getFirstList()), p1, 0.5f, false);
             var item2 = new MenuItem(HighScores.GetString(2), () => SwitchItems(getFirstList()), p2, 0.5f, false);
             var item3 = new MenuItem(HighScores.GetString(3), () => SwitchItems(getFirstList()), p3, 0.5f, false);
             var item4 = new MenuItem(HighScores.GetString(4), () => SwitchItems(getFirstList()), p4, 0.5f, false);
             var item5 = new MenuItem(HighScores.GetString(5), () => SwitchItems(getFirstList()), p5, 0.5f, false);
             var item6 = new MenuItem(HighScores.GetString(6), () => SwitchItems(getFirstList()), p6, 0.5f, false);
             HighScores.WhenFetched[0] = () => item0.Text.text = HighScores.GetString(0);
             HighScores.WhenFetched[1] = () => item1.Text.text = HighScores.GetString(1);
             HighScores.WhenFetched[2] = () => item2.Text.text = HighScores.GetString(2);
             HighScores.WhenFetched[3] = () => item3.Text.text = HighScores.GetString(3);
             HighScores.WhenFetched[4] = () => item4.Text.text = HighScores.GetString(4);
             HighScores.WhenFetched[5] = () => item5.Text.text = HighScores.GetString(5);
             HighScores.WhenFetched[6] = () => item6.Text.text = HighScores.GetString(6);
             SwitchItems(new List <MenuItem>
             {
                 item0,
                 item1,
                 item2,
                 item3,
                 item4,
                 item5,
                 item6,
             });
         }),
         new MenuItem("RESET", () =>
         {
             PlayerData.Instance = new PlayerData();
             var pd = PlayerData.Instance;
             for (var i = 0; i < pd.Scores.Length; i++)
             {
                 PlayerPrefs.SetString("score" + i, "0");
             }
             UnitedTint.Tint = Color.white;
             Saves.Save();
             SceneManager.LoadScene(0);
             Time.timeScale = 1;
         }),
         new MenuItem("QUIT", Application.Quit)
     });
 }
Esempio n. 18
0
 public static void Initialize()
 {
     if (!isCreated)
     {
         isCreated = true;
         Saves.Initialise();
         EducationStatistics.Initialise();
         SceneController.Initialise();
         GameObject G = Instantiate(Resources.Load <GameObject>(GameManagerPath));
         DontDestroyOnLoad(G);
     }
 }
 public void LoadSave()
 {
     if (!PlayerPrefs.HasKey("Save"))
     {
         Debug.Log("SAVE is deleted");
     }
     else
     {
         Debug.Log("SAVE is here");
         saves = JsonUtility.FromJson <Saves>(PlayerPrefs.GetString("Save"));
     }
 }
Esempio n. 20
0
 public void Load()
 {
     if (PlayerPrefs.HasKey("Amount"))
     {
         saves = JsonUtility.FromJson <Saves>(PlayerPrefs.GetString("Amount"));
     }
     else
     {
         JsonUtility.ToJson(saves = new Saves());
     }
     saves.Save();
 }
Esempio n. 21
0
    public IEnumerator loadSave(string saveName)
    {
        string path = Saves.getSaveDirectory(saveName);
        WWW    www  = new WWW("file://" + path);

        yield return(www);

        string text = www.text;

        string[] characterSheetArray = text.Split(';');
        //squadCharacterSheets.Add
    }
Esempio n. 22
0
 public bool Load(string Name)
 {
     if (!Saves.ContainsKey(Name))
     {
         return(false);
     }
     else
     {
         Selected = Saves[Name];
         return(true);
     }
 }
Esempio n. 23
0
    public static void GetSave(out Saves save)
    {
        Save[] saves = new Save[spacePlatforms.Count];
        int    i     = 0;

        foreach (var spacePlatform in spacePlatforms)
        {
            saves[i] = spacePlatform.save;
            ++i;
        }
        save.spacePlatforms = saves;
    }
Esempio n. 24
0
        public bool Load()
        {
            object graph = Saves.InstantLoad(NormalPath);

            if (graph == null)
            {
                return(false);
            }

            keys = (Dictionary <string, InputKey>)graph;
            return(true);
        }
Esempio n. 25
0
    void Awake()
    {
        if (inst == null)
        {
            inst = this;
        }
        else if (inst != null)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Esempio n. 26
0
 void OnTriggerEnter(Collider other)
 {
     save = GameObject.FindGameObjectWithTag("TriggerSave").GetComponent <Saves>();//тэг относится к объекту-невидимке saves
     if (save.s != true)
     {
         if (other.GetComponent <PlayerMovement>())
         {
             save.s = true;
             save.Save(save.transform.position);
             Destroy(gameObject);
         }
     }
 }
        public LoadGameScreenViewModel(IMessenger messenger)
        {
            MessengerInstance = messenger;

            DeleteSaveInViewMessage.Register(MessengerInstance, this, item => { Saves.Remove(item); });

            // disconnect the messenger of this one from the messenger of the game screen
            BoardViewModel = new BoardViewModel(new Messenger(), MockUtil.AnyGame(7, 0).State)
            {
                UnlockedPlayer = null
            };

            BackToMainMenuCommand = new RelayCommand(() => ShowMainMenuMessage.Send(MessengerInstance));
        }
Esempio n. 28
0
 private void SearchItems(string query)
 {
     if (string.IsNullOrWhiteSpace(query))
     {
         Filtered = null;
     }
     else
     {
         var filteredItems = Saves
                             .Where(bear => bear.File.FileName.IndexOf(query, System.StringComparison.OrdinalIgnoreCase) >= 0)
                             .ToList();
         Filtered = new ObservableCollection <LoadableSAV>(filteredItems);
     }
 }
Esempio n. 29
0
        public void ThreadProc()   //thread process
        {
            try {
                // start hosting node in this giant method im not going to comment
                ProcessStartInfo startInfo = new ProcessStartInfo(Saves.nodePath);
                startInfo.CreateNoWindow         = true;
                startInfo.RedirectStandardOutput = true;
                startInfo.RedirectStandardInput  = true;
                startInfo.RedirectStandardError  = true;
                startInfo.UseShellExecute        = false;

                var proc = new Process();
                proc.StartInfo           = startInfo;
                proc.EnableRaisingEvents = true;
                proc.OutputDataReceived += (sender, args) => this.Display(args.Data);
                proc.ErrorDataReceived  += (sender, args) => this.Display(args.Data);
                proc.Start();

                Saves.processID = proc.Id;
                Console.WriteLine("Process ID saved as: {0}", proc.Id);
                Saves.Save();

                char[] array = Saves.scriptPath.ToCharArray();
                string patch = ""; // adds double backslashes to fix script directory

                foreach (char letter in array)
                {
                    if (letter == '\\')
                    {
                        patch += '\\';
                    }
                    patch += letter;
                }

                var          startCommand   = String.Format("require('{0}').Start()", patch); // start the server after node has started
                StreamWriter myStreamWriter = proc.StandardInput;
                myStreamWriter.WriteLine(startCommand);
                myStreamWriter.Close();

                proc.BeginOutputReadLine();
                proc.BeginErrorReadLine();
                proc.WaitForExit();
            } catch (InvalidOperationException e) {
                Console.WriteLine("how do you even error this {0}", e);
            } catch (Win32Exception e) {
                Console.WriteLine("{0}", e);
                MessageBox.Show("Node directory is invalid. Settings > Preferences > Script settings", "Script error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 30
0
 // Use this for initialization
 void Awake()
 {
     if (control == null)
     {
         DontDestroyOnLoad(gameObject);
         control = this;
     }
     else
     {
         if (control != this)
         {
             Destroy(gameObject);
         }
     }
 }