private void btnSaveClose_Click(object sender, EventArgs e) { LoadSave.UpdateLibraryFile(); DialogResult dialog = MessageBox.Show("Library file updated! Press ok to close."); Close(); }
//----------------------- private async void registra_clicked(object sender, EventArgs e) { if (CheckRegistrazione()) { var ws = new WebService.WebService(); var email = DependencyService.Get <ICrypto>().Encrypt(emailUtente.Text, CostantiCrypaggioDati.key, CostantiCrypaggioDati.IV); var password = DependencyService.Get <ICrypto>().Encrypt(passUtente.Text, CostantiCrypaggioDati.key, CostantiCrypaggioDati.IV); var tel = DependencyService.Get <ICrypto>().Encrypt(numberTel.Text, CostantiCrypaggioDati.key, CostantiCrypaggioDati.IV); var nome = DependencyService.Get <ICrypto>().Encrypt(nomeUtente.Text, CostantiCrypaggioDati.key, CostantiCrypaggioDati.IV); var ris = await ws.Registrazione(email, password, nome, tel); if (ris[0].msg != "") { DependencyService.Get <IToast>().Show(ris[0].msg); //------------------------- UserData.Utente = nomeUtente.Text; UserData.Telefono = numberTel.Text; UserData.Email = emailUtente.Text; UserData.password = passUtente.Text; //------------------------------------ var save = new LoadSave(); save.WriteXML(); //await DisplayAlert("FishOnLine - App", "Salvato", "OK"); } else { DependencyService.Get <IToast>().Show("Errore di registrazione"); } } }
// Main form public FrmMainMenu() { InitializeComponent(); _music = Music.Init(); _sound = SfxSound.Init(); // load settings LoadSave ls = LoadSave.Init(); ls.LoadSettings(); // Intro // set bullets pBoxes array _bullets = new PictureBox[10]; _bullets[0] = this.pBoxBullet1; _bullets[1] = this.pBoxBullet2; _bullets[2] = this.pBoxBullet3; _bullets[3] = this.pBoxBullet4; _bullets[4] = this.pBoxBullet5; _bullets[5] = this.pBoxBullet6; _bullets[6] = this.pBoxBullet7; _bullets[7] = this.pBoxBullet8; _bullets[8] = this.pBoxBullet9; _bullets[9] = this.pBoxBullet10; _counter = 0; _introActive = true; }
public static void OnSave(object sender, OnSaveEvent saveEvent) { foreach (IDModEvent _event in events) { LoadSave.SaveDataGeneric("insaneDifficultyMod", _event.saveID, Newtonsoft.Json.JsonConvert.SerializeObject(_event.OnSave())); } }
// Start is called before the first frame update void Start() { _anim = GetComponent <Animator>(); LoadSave.AddActionToScenesLoad(OnSceneLoad); //AssignListener(); ResetPlayerUI(); }
/// <summary> /// Call when clicked on buy button. /// </summary> public void BuyButton() { for (int i = 0; i != 3; i++) { // Find an animal GameObject anAnimal = GameObject.Find("CanvasClassic").transform.Find("WindowShop"). Find("SectionAnimals").Find(i.ToString()).gameObject; // Check witch an animal costumer want to buy if (anAnimal.GetComponent <Toggle>().isOn) { DataplayerManager.Instance.Data.Coins -= animals.CostAnimals[i]; // Add animal to bought animal list DataplayerManager.Instance.Data.BoughtAnimals.Add(i); // Add to current animal DataplayerManager.Instance.Data.CurrentAnimal = i; // Save data LoadSave.Save(DataplayerManager.Instance.Data); //, //DataplayerManager.Instance.NameFile, //true); // Update menu values BackgroundMenu.SetValuesInStart(animals); GameObject.Find("CanvasClassic").transform.Find("WindowShop"). Find("SectionAnimals").Find("BuyButton").gameObject.SetActive(false); } } }
public void OnLoaded(object sender, OnLoadedEvent loadedEvent) { try{ foreach (Vector3 vector in District.PlayerAddedColors.ToArray()) { Color color = ColorConversions.ConvertVector3ToColor(vector); Swatch swatch = District.Swatches.Find(i => i.color == color); if (swatch != null) { District.Swatches.Remove(swatch); Destroy(swatch.gameObject); } } }catch (Exception err) { Mod.helper.Log(err.ToString()); } string json = LoadSave.ReadDataGeneric("DistrictModV2", "DistrictModV2Identifier"); if (json != null) { var savedObject = Newtonsoft.Json.JsonConvert.DeserializeObject <DistrictSave>(json); District.DistrictBuildingData = savedObject.DistrictBuildingData; District.PlayerAddedColors = ColorConversions.ConvertArrayToList(savedObject.PlayerAddedColors); } else { Mod.helper.Log("JSON IS NULL"); } LoadSwatches(); LoadBuildingColors(); }
public static void OnSave(object sender, OnSaveEvent saveEvent) { foreach (ModEvent _event in events) { LoadSave.SaveDataGeneric(Mod.modID, _event.saveID, Newtonsoft.Json.JsonConvert.SerializeObject(_event.OnSave())); } }
/// <summary> /// Call when user choosed animal to play with it /// on profile window (choose from bought animals). /// </summary> /// <param name="i">Id of animal</param> public void ToggleAnimalInProfile(int i) { // Find an animal in canvas classic GameObject anAnimal = GameObject.Find("CanvasClassic").transform.Find("WindowProfile"). Find("SectionAnimals").Find(i.ToString()).gameObject; // Get toggle component of animal Toggle toggle = anAnimal.GetComponent <Toggle>(); if (toggle.isOn) { // Set for user unclickable on current animal (he choosed it). toggle.interactable = false; // Show vi on animal that choosed anAnimal.transform.Find("Vi").gameObject.SetActive(true); // Set new current animal DataplayerManager.Instance.Data.CurrentAnimal = i; // Save data. LoadSave.Save(DataplayerManager.Instance.Data); //, //DataplayerManager.Instance.NameFile, //true); } else { // Hide vi from animal that didnt choosed. anAnimal.transform.Find("Vi").gameObject.SetActive(false); // Set for user clickable on animal that didnt choosed. toggle.interactable = true; } }
/// <summary> /// Call when click on quest button in menu /// </summary> public void ClickQuestsButton() { // Get button video rewarded GameObject buttonRewardVideo = GameObject.Find("CanvasClassic").transform. Find("WindowQuests").Find("ButtonRewardVideo").gameObject; if (QuestsManager.Instance.Data.DateQuest != DateTime.Today) { QuestsManager.Instance.Data.SetDefoultData(); LoadSave.Save(QuestsManager.Instance.Data, QuestsManager.Instance.NameFile); } if (QuestsManager.Instance.Data.WasTodayRewardVideo) { buttonRewardVideo.SetActive(false); // Show text that there are not rewarded GameObject.Find("CanvasClassic").transform. Find("WindowQuests").Find("NoGiftsText").gameObject.SetActive(true); } else { buttonRewardVideo.SetActive(true); } GameObject.Find("CanvasClassic").transform.Find("WindowQuests").gameObject.SetActive(true); }
private void OnDestroy() { Scene.ActiveMB = null; Scene.GameStats = null; Scene.SceneTracker = null; Scene.MutantControler = null; Scene.MutantSpawnManager = null; Scene.Yacht = null; Scene.PlaneCrash = null; Scene.PlaneCrashAnimGO = null; Scene.TriggerCutScene = null; Scene.RainFollowGO = null; Scene.RainTypes = null; Scene.WeatherSystem = null; Scene.HudGui = null; Scene.Cams = null; Scene.Clock = null; Scene.Atmosphere = null; Scene.WorkScheduler = null; Scene.LoadSave = null; Scene.PlaneGreebles = null; Scene.OceanFlat = null; Scene.OceanCeto = null; Scene.ShoreMask = null; Scene.SinkHoleCenter = null; Scene.CaveGrounds = null; }
private void Awake() { Scene.ActiveMB = this; Scene.GameStats = this._gameStats; Scene.SceneTracker = this._sceneTracker; Scene.MutantControler = this._mutantControler; Scene.MutantSpawnManager = this._mutantSpawnManager; Scene.Yacht = this._yacht; Scene.PlaneCrash = this._plane; Scene.PlaneCrashAnimGO = this._planeCrashAnimGO; Scene.TriggerCutScene = this._triggerCutScene; Scene.RainFollowGO = this._rainFollowGO; Scene.RainTypes = this._rainTypes; Scene.WeatherSystem = this._weatherSystem; Scene.HudGui = this._hudGui; Scene.Cams = this._cams; Scene.Clock = this._clock; Scene.Atmosphere = this._atmos; Scene.WorkScheduler = this._workScheduler; Scene.LoadSave = this._loadSave; Scene.PlaneGreebles = this._planeGreebles; Scene.OceanFlat = this._oceanFlat; Scene.OceanCeto = this._oceanCeto; Scene.ShoreMask = this._shoreMask; Scene.SinkHoleCenter = this._sinkHoleCenter; Scene.CaveGrounds = this._caveGrounds; }
/// <summary> /// Call when user finished watch video ad for get reward. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void VideoAd_OnAdRewarded(object sender, Reward e) { if (SceneManager.GetActiveScene().name == "MainMenu") { GameObject.Find("CanvasClassic").transform.Find("WindowQuests"). Find("PanelBlack").gameObject.SetActive(false); Instance._isDestroyedVideoAd = true; QuestsManager.Instance.Data.WasTodayRewardVideo = true; LoadSave.Save(QuestsManager.Instance.Data, QuestsManager.Instance.NameFile); DataplayerManager.Instance.Data.Coins += (int)e.Amount; LoadSave.Save(DataplayerManager.Instance.Data); //, //DataplayerManager.Instance.NameFile, //true); // Update menu Animals animals = new Animals(); BackgroundMenu.SetValuesInStart(animals); } throw new NotImplementedException(); }
public Location LoadGameMenu() { Location returnData; LocationAction locationAction; returnData = new Location(); returnData.Name = "Game Menu"; returnData.Description = "Please choose an initial starting action."; List <LocationAction> locationActions = new List <LocationAction>(); locationAction = new CreateNewCharacterAction(); locationActions.Add(locationAction); if (LoadSave.SavedGameExists()) { locationAction = new LoadSavedGameAction(); locationActions.Add(locationAction); } locationAction = new ExitGame(); locationActions.Add(locationAction); returnData.Actions = locationActions; return(returnData); }
private void btnSave_Click(object sender, EventArgs e) { if (place != null) { LoadSave.Save(Globals.ProjectFile, place); } }
static void Main() { LoadSave.InitialStream(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
private void LoadProject(string selectedPath) { Globals.ProjectDir = selectedPath; Globals.NavigatorPlace = LoadSave.Load(Globals.ProjectFile); // Settings control settingsCtrl1.LoadControl(); // Shops control listingContainerCtrl1.LoadControl(); // Ads configuration control adConfigContainerCtrl1.LoadControl(); // Image editor control imageEditorCtrl1.ProjectImagePath = Globals.ImagesDir; imageEditorCtrl1.CurrentPlace = Globals.NavigatorPlace; imageEditorCtrl1.CurrentPath = imageEditorCtrl1.CurrentPlace.Paths[0]; imageEditorCtrl1.CurrentPoint = imageEditorCtrl1.CurrentPlace.Paths[0].Points[0]; imageEditorCtrl1.CurrentAngle = 0; imageEditorCtrl1.StartRealView(); // Hotspots control hotSpotContainerCtrl1.LoadControl(); }
// Update is called once per frame void Update() { if (Input.GetKeyUp(KeyCode.O)) { stats.sceneNo = Application.loadedLevel; stats.pHealth = 100; stats.pOil = 100; stats.pPos = transform.position; LoadSave.Save(); print("GameSaved"); stats.pPos.x = 0; stats.pPos.y = 0; stats.pPos.z = 0; } if (Input.GetKeyUp(KeyCode.P)) { LoadSave.Load(); print("GameLoaded"); //transform.position = pPos; if (Application.loadedLevel != stats.sceneNo) { Application.LoadLevel(stats.sceneNo); } } if (gameloaded) { transform.position = current.stats.pPos; gameloaded = false; } }
/// <summary> /// Добавить /// </summary> /// <returns></returns> public static void Add(KeyValuePair <long?, string> url, bool load = false) { if (!LChoise.ContainsKey(url.Key)) { LChoise.Add(url.Key, url.Value); } else { LChoise.Remove(url.Key); LChoise.Add(url.Key, url.Value); if (LChoise.Count > 1) { Dictionary <long?, string> urls = new Dictionary <long?, string>() { { LChoise.ElementAt(LChoise.Count - 1).Key, LChoise.ElementAt(LChoise.Count - 1).Value } }; for (int i = 0; i < LChoise.Count - 1; i++) { urls.Add(LChoise.ElementAt(i).Key, LChoise.ElementAt(i).Value); } LChoise = urls; } } if (!load) { LoadSave.WriteData(); } }
static void Postfix() { World.inst.ForEachTile(0, 0, World.inst.GridWidth, World.inst.GridHeight, (World.EvaluateCell)((x, z, cell) => { foreach (Building building in cell.OccupyingStructure) { if (building.transform.GetChild(0).childCount > 0) { string rotationString = LoadSave.ReadDataBuilding(modName, building); if (rotationString != null) { string[] rotationStringSplit = rotationString.Split(splitChar); if (rotationStringSplit.Length == 4) { List <float> rotationList = new List <float>(); foreach (string rotation in rotationStringSplit) { float parsedFloat = 0; if (float.TryParse(rotation, out parsedFloat)) { rotationList.Add(parsedFloat); } } if (rotationList.Count == 4) { SerializableQuaternion serializableQuaternion = new SerializableQuaternion(rotationList[0], rotationList[1], rotationList[2], rotationList[3]); building.transform.GetChild(0).GetChild(0).rotation = (Quaternion)serializableQuaternion; } } } } } })); }
public void TestFilenameExistsExist() { CreateProject.CreateFolder(@"Model\exist"); LoadSave.ZipFolderRenameToDCIP(@"Model\exist"); Assert.True(ValidateInput.FileNameExists("exist", @"Model\")); LoadSave.DeleteOriginalFolder(@"Model\exist"); System.IO.File.Delete(@"Model\exist.dcip"); }
private void LoadHard() { Car2DData[] loadedRacers = LoadSave.LoadRacers("Hard"); for (int i = 0; i < racers.Length - humanRacers; i++) { racers[i].GetComponent <Car2DDummy>().LoadData(loadedRacers[Random.Range(0, loadedRacers.Length)]); } }
/// <summary> /// Save new data /// </summary> public void SaveNewData() { // Save data. LoadSave.Save(_temporaryDataPlayer); //, DataplayerManager.Instance.NameFile,true); // Clone data to static class of data. DataplayerManager.Instance.Data = (DataPlayer)_temporaryDataPlayer.Clone(); }
public void MoreMoney() { DataplayerManager.Instance.Data.Coins += 1000; //LoadSavePlayer.Save(BackgroundMenu.dataPlayer); LoadSave.Save(DataplayerManager.Instance.Data); //, DataplayerManager.Instance.NameFile,true); //update menu BackgroundMenu.SetValuesInStart(animals); }
public void TestZipFolderRenameToDCIPOK() { Assert.False(File.Exists(@"Model\TestZipFolderRenameToDCIPOK.dcip")); CreateProject.CreateFolder(@"Model\TestZipFolderRenameToDCIPOK"); LoadSave.ZipFolderRenameToDCIP(@"Model\TestZipFolderRenameToDCIPOK"); Assert.True(File.Exists(@"Model\TestZipFolderRenameToDCIPOK.dcip")); Directory.Delete(@"Model\TestZipFolderRenameToDCIPOK"); File.Delete(@"Model\TestZipFolderRenameToDCIPOK.dcip"); }
/// <summary> /// Gets called when a .dcip needs to be loaded into memory. /// </summary> public static void Load() { // Configure open file dialog box System.Windows.Forms.OpenFileDialog fileDialog = new System.Windows.Forms.OpenFileDialog(); fileDialog.Filter = "DCIP Files|*.dcip"; fileDialog.Title = "Choose project to open: "; System.Windows.Forms.DialogResult result = fileDialog.ShowDialog(); //Save user filename if (result == System.Windows.Forms.DialogResult.OK) { destfile = fileDialog.FileName; BinaryFormatter formatter = new BinaryFormatter(); StreamReader framesOpen = null, stateOpen = null; FramesContainer container = null; ProjectState projectState = null; string destfilenoext = destfile.Substring(0, destfile.Length - 5); try { LoadSave.UnZipFolder(destfilenoext); framesOpen = new StreamReader(destfilenoext + @"\data.frames"); stateOpen = new StreamReader(destfilenoext + @"\data.state"); container = (FramesContainer)formatter.Deserialize(framesOpen.BaseStream); projectState = (ProjectState)formatter.Deserialize(stateOpen.BaseStream); stateOpen.Close(); framesOpen.Close(); LoadSave.DeleteOriginalFolder(destfilenoext); } catch (SerializationException e) { Prompt("Application error", e.Message); return; } //Event to fire back StateEventArgs stateeventargs = new StateEventArgs(); stateeventargs.Framescontainer = container; stateeventargs.Projectstate = projectState; //Return values to caller // Check if there are any Subscribers if (LoadSaveEvent != null) { LoadSaveEvent(null, stateeventargs); } } }
public void OnSave(object sender, OnSaveEvent saveEvent) { var saveObject = new DistrictSave() { DistrictBuildingData = District.DistrictBuildingData, PlayerAddedColors = District.PlayerAddedColors.ToArray() }; LoadSave.SaveDataGeneric("DistrictModV2", "DistrictModV2Identifier", Newtonsoft.Json.JsonConvert.SerializeObject(saveObject)); }
private void Awake() { maxLevel = 1; maxLevel = LoadSave.Load(); if (maxLevel == 0) { maxLevel = 1; } }
private void button3_Click(object sender, EventArgs e) { KMLRoot kml = CreateKmlFeat(); LoadSave ls = new LoadSave("kml"); string fpath = ls.GetSavePath(); if (fpath != null) { kml.Save(fpath); } }
private async void appearing(object sender, EventArgs e) { if (CostantiApp.isstarting == false) { var load = new LoadSave(); await load.LoadXML(); CostantiApp.isstarting = true; } await Caricamento(); }