Exemplo n.º 1
0
 private void saveListBox_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     var index = saveListBox.IndexFromPoint(e.Location);
     if (index == ListBox.NoMatches) return;
     SelectedSaveFile = (SaveFile)saveListBox.Items[index];
     Close();
 }
Exemplo n.º 2
0
        bool SaveContent(SaveFile fileSave)
        {
            StaticExample.testowawartosc = 5;

            FirstClass first = new FirstClass();
            FirstClass dsaFirstClass = new FirstClass();
            FirstClass fdsghdsf = new FirstClass();

               first.Przykladdzialania();

            first.ilosc = 8;

            dsaFirstClass.Przykladdzialania();

            dsaFirstClass.ilosc = 9;

            first.Przykladdzialania();

            // informacja pobrana z contenera do tworzenia ogromnej ilosci textu
            //fileSave.Save("test", "c:/tdsayfuad.docx");

            //StaticExample example = new StaticExample();

            return true;
        }
Exemplo n.º 3
0
 public static string getWallpaper(SaveFile SAV, int index)
 {
     index++;
     string s = "box_wp" + index.ToString("00");
     switch (SAV.Generation)
     {
         case 7: s += "xy";
             break;
         case 6: s += SAV.ORAS && index > 16 ? "ao" : "xy";
             break;
         case 5: s += SAV.B2W2 && index > 16 ? "b2w2" : "bw";
             break;
         case 4:
             if (SAV.Pt && index > 16)
                 s += "pt";
             else if (SAV.HGSS && index > 16)
                 s += "hgss";
             else
                 s += "dp";
             break;
         case 3:
             if (SAV.E)
                 s += "e";
             else if (SAV.FRLG && index > 12)
                 s += "frlg";
             else
                 s += "rs";
             break;
     }
     return s;
 }
Exemplo n.º 4
0
 public static SaveFile load()
 {
     if (File.Exists (savePath)) {
         BinaryFormatter bf = new BinaryFormatter ();
         FileStream file = File.Open (savePath, FileMode.Open);
         currentSave = (SaveFile)bf.Deserialize (file);
         file.Close ();
         return currentSave;
     }
     return null;
 }
Exemplo n.º 5
0
    void Awake()
    {
        if (instance != null && instance != this) {
            isSetToDestroy = true;
            Destroy(gameObject);
        } else {
            instance = this;
        }

        eventRegistery = GetComponentInChildren<EventRegistery>();
        saveFile = GetComponentInChildren<SaveFile>();
        systemFile = GetComponentInChildren<SystemFile>();
        dataFile = GetComponentInChildren<DataFile>();
        transitionery = GetComponentInChildren<TransitionManager>();
        view = GetComponentInChildren<GlobalView>();
    }
Exemplo n.º 6
0
    /// <summary>
    /// Loads a single save file as the current save
    /// </summary>
    /// <param name="fileName">The current save</param>
    /// <returns></returns>
    public static SaveFile Load(string fileName)
    {
        if (File.Exists(Application.persistentDataPath + "/" + fileName + SAVE_FILE_EXTENSION))
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream file = File.Open(Application.persistentDataPath + "/" + fileName + SAVE_FILE_EXTENSION, FileMode.Open);
            currentSave = (SaveFile)bf.Deserialize(file);
            file.Close();
        }

        // In case the NPC map isn't initialized
        if (currentSave.alteredObjectsMap == null)
        {
            currentSave.alteredObjectsMap = new Hashtable();
        }

        return currentSave;
    }
Exemplo n.º 7
0
        public static bool ResizeAndSaveImage(SaveFile sf)
        {
            try
            {
                var file = resizeImage(sf.FilePath);

                using (FileStream fs = new FileStream(sf.SavePath, FileMode.Create, FileAccess.Write))
                {
                    file.Save(fs, ImageFormat.Png);
                    fs.Flush();
                    fs.Close();
                }

                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
Exemplo n.º 8
0
	// Will not work for web, but all other platforms
	public void save( )
		{
		print ("Saving...");

		// Setup our File and Binary Formatter
		BinaryFormatter my_bf = new BinaryFormatter();
		FileStream my_file = File.Create( Application.persistentDataPath + "/saveFile.dat" );

		// Gain access to our World and Player objects
		World my_world = _world.GetComponent<World>();
		GameObject player = GameObject.FindGameObjectWithTag("Player");

		// Create our new SaveFile object
		SaveFile save = new SaveFile (my_world.getChunkInfos (), player.transform.position);

		// Write our SaveFile object to disk
		my_bf.Serialize( my_file, save );
		my_file.Close();

		print ("Saved.");
		}
Exemplo n.º 9
0
    public static void save(Checkpoint cp)
    {
        // Update active checkpoint
        if (checkpoint != null && checkpoint != cp) {
            checkpoint.reset ();
        }
        checkpoint = cp;

        // Update SaveFile
        if (currentSave == null) {
            currentSave = new SaveFile ();
        }
        currentSave.save (Application.loadedLevel, cp.getPos ());

        // We're cool with loading, now.
        newGame = false;

        // Actually save the data to a file.
        BinaryFormatter bf = new BinaryFormatter ();
        FileStream file = File.Create (savePath);
        bf.Serialize (file, currentSave);
        file.Close ();
    }
Exemplo n.º 10
0
        private void openFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var osff = new OpenSaveFileForm();
            osff.ShowDialog();

            SaveFile = osff.SelectedSaveFile;
        }
Exemplo n.º 11
0
        private string GetParentFolderName(SaveFile first)
        {
            var parent = Paths.Find(z => first.FileFolder.StartsWith(z.Path));

            return(parent?.DisplayText ?? "???");
        }
Exemplo n.º 12
0
 public void SaveButtonClicked()
 {
     Debug.Log("Saving...");
     SaveFile s = new SaveFile();
     s.Save();
 }
Exemplo n.º 13
0
 public bool InitializeFromSAV(SaveFile sav) => InitializeGrid();
    public void Save()
    {
        //Time.timeScale = 0f;
        try
        {
            BinaryFormatter formatter = new BinaryFormatter();
            string          path      = Application.persistentDataPath + "/MRDsave.bin";
            FileStream      stream    = new FileStream(path, FileMode.Create);

            // 골드 정보
            int gold = Database.Instance.gold;

            // 유닛과 적군들 정보
            UnitData fish = new UnitData(Heart.Instance.character);

            List <UnitData> units   = new List <UnitData>();
            List <UnitData> enemies = new List <UnitData>();

            foreach (var character in UnitPool.Instance.GetActiveCharacters())
            {
                if (character.characterInfo.unitName != UnitName.unit_fish && character.characterInfo.currentHP > 0)
                {
                    units.Add(new UnitData(character));
                }
            }

            foreach (var character in EnemyPool.Instance.GetActiveCharacters())
            {
                if (character.characterInfo.currentHP > 0)
                {
                    enemies.Add(new UnitData(character));
                }
            }

            // 토템배치 쿨타임 정보
            float pastTotemCoolTime = TotemManager.Instance.pastTime;

            // 배치된 토템들 정보
            List <TotemData> totems = new List <TotemData>();
            var placementedTotems   = TotemManager.Instance.totems;
            foreach (var totem in placementedTotems)
            {
                if (totem.gameObject.activeInHierarchy)
                {
                    totems.Add(new TotemData(totem.totemDataset.totemName,
                                             totem.totemDataset.pastingTime, totem.transform.position,
                                             totem.totemDataset.buff.amount));
                }
            }

            // 유물 정보들
            List <ArtifactData> artifacts = new List <ArtifactData>();
            var havingArtifacts           = ArtifactManager.Instance.artifactList;
            foreach (var artifact in havingArtifacts)
            {
                artifacts.Add(new ArtifactData(artifact.type, artifact.name));
            }

            // 인벤토리 정보
            List <InventoryData> inventoryDatas = new List <InventoryData>();
            var havingInventoryItem             = Slot.Instance.viewList.Keys;
            foreach (var item in havingInventoryItem)
            {
                inventoryDatas.Add(new InventoryData(item));
            }

            // 스테이지 정보
            StageData stageData = new StageData();
            stageData.stage             = EnemySpawnManager.Instance.stage;
            stageData.currentSpawnCount = EnemySpawnManager.Instance.currentSpawnCount;
            stageData.currentWaveCount  = EnemySpawnManager.Instance.currentWaveCount;

            // 퀘스트정보
            List <QuestData> questDatas = new List <QuestData>();
            foreach (var quest in QuestEventManager.Instance.quests)
            {
                questDatas.Add(new QuestData(quest));
            }

            // 유물 선택중인지 저장
            var artifactSelectingData = new ArtifactSelectData(ArtifactSelect.Instance.isSelecting, ArtifactSelect.Instance.artifact);

            SaveFile saveFile = new SaveFile(gold, fish, units, enemies, totems, pastTotemCoolTime, artifacts, inventoryDatas, stageData, questDatas, artifactSelectingData);

            formatter.Serialize(stream, saveFile);
            stream.Close();
        }
        catch (Exception e)
        {
            Debug.Log(e.Message);
        }
    }
        private void ExportQRCodes(object sender, EventArgs e)
        {
            SaveFile SAV     = C_SAV.SAV;
            var      boxdata = SAV.BoxData;

            if (boxdata == null)
            {
                WinFormsUtil.Alert("Box Data is null");
            }
            int ctr = 0;
            Dictionary <string, Image> qrcodes = new Dictionary <string, Image>();

            foreach (PKM pk in boxdata)
            {
                if (pk.Species == 0 || !pk.Valid || (pk.Box - 1) != C_SAV.Box.CurrentBox)
                {
                    continue;
                }
                ctr++;
                Image qr;
                switch (pk.Format)
                {
                case 7:
                    qr = QR.GenerateQRCode7((PK7)pk);
                    break;

                default:
                    if (pk.Format == 6 && !QR6Notified)     // users should not be using QR6 injection
                    {
                        WinFormsUtil.Alert(MsgQRDeprecated, MsgQRAlternative);
                        QR6Notified = true;
                    }
                    qr = QR.GetQRImage(pk.EncryptedBoxData, QR.GetQRServer(pk.Format));
                    break;
                }
                if (qr == null)
                {
                    continue;
                }
                var sprite = dragout.Image;
                var la     = new LegalityAnalysis(pk, C_SAV.SAV.Personal);
                if (la.Parsed && pk.Species != 0)
                {
                    var img = la.Valid ? Resources.valid : Resources.warn;
                    sprite = ImageUtil.LayerImage(sprite, img, 24, 0, 1);
                }
                string[] r     = pk.QRText;
                string   refer = "PKHeX Auto Legality Mod";
                qrcodes.Add(Util.CleanFileName(pk.FileName), RefreshImage(qr, sprite, r[0], r[1], r[2], $"{refer} ({pk.GetType().Name})"));
            }
            if (!Directory.Exists(Path.Combine(WorkingDirectory, "qrcodes")))
            {
                Directory.CreateDirectory(Path.Combine(WorkingDirectory, "qrcodes"));
            }
            int counter = 0;

            foreach (KeyValuePair <string, Image> qrcode in qrcodes)
            {
                Console.WriteLine(counter);
                counter++;
                qrcode.Value.Save(Path.Combine(WorkingDirectory, "qrcodes", qrcode.Key + ".png"));
            }
        }
Exemplo n.º 16
0
 protected MyItem(SaveFile SAV) : base(SAV)
 {
 }
Exemplo n.º 17
0
 public WriteBlockedMessage CanWriteTo(SaveFile sav, PKM pkm) => WriteBlockedMessage.InvalidDestination;
Exemplo n.º 18
0
 public PKM Read(SaveFile sav)
 {
     return(PartyFormat ? sav.GetPartySlot(Offset) : sav.GetStoredSlot(Offset));
 }
Exemplo n.º 19
0
 public static Image WallpaperImage(this SaveFile sav, int box) => GetWallpaper(sav, box);
Exemplo n.º 20
0
 public bool CanWriteTo(SaveFile sav) => false;
Exemplo n.º 21
0
    private static Image GetWallpaper(SaveFile sav, int box)
    {
        string s = GetWallpaperResourceName(sav.Version, sav.GetBoxWallpaper(box));

        return((Bitmap?)Resources.ResourceManager.GetObject(s) ?? Resources.box_wp16xy);
    }
Exemplo n.º 22
0
        public SAV_MysteryGiftDB(PKMEditor tabs, SAVEditor sav)
        {
            InitializeComponent();

            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);

            SAV       = sav.SAV;
            BoxView   = sav;
            PKME_Tabs = tabs;

            // Preset Filters to only show PKM available for loaded save
            CB_FormatComparator.SelectedIndex = 3; // <=

            var grid        = MysteryPokeGrid;
            var smallWidth  = grid.Width;
            var smallHeight = grid.Height;

            grid.InitializeGrid(6, 11, SpriteUtil.Spriter);
            grid.SetBackground(Resources.box_wp_clean);
            var newWidth  = grid.Width;
            var newHeight = grid.Height;
            var wdelta    = newWidth - smallWidth;

            if (wdelta != 0)
            {
                Width += wdelta;
            }
            var hdelta = newHeight - smallHeight;

            if (hdelta != 0)
            {
                Height += hdelta;
            }

            PKXBOXES = grid.Entries.ToArray();

            // Enable Scrolling when hovered over
            foreach (var slot in PKXBOXES)
            {
                // Enable Click
                slot.MouseClick += (sender, e) =>
                {
                    if (ModifierKeys == Keys.Control)
                    {
                        ClickView(sender, e);
                    }
                };

                slot.ContextMenuStrip = mnu;
            }

            Counter              = L_Count.Text;
            Viewed               = L_Viewed.Text;
            L_Viewed.Text        = string.Empty; // invis for now
            L_Viewed.MouseEnter += (sender, e) => hover.SetToolTip(L_Viewed, L_Viewed.Text);

            // Load Data
            B_Search.Enabled = false;
            L_Count.Text     = "Loading...";
            new Task(LoadDatabase).Start();

            CB_Format.Items[0] = MsgAny;
            CenterToParent();
        }
Exemplo n.º 23
0
        private void DiffSaves()
        {
            if (!File.Exists(TB_OldSAV.Text))
            {
                WinFormsUtil.Alert("Save 1 path invalid."); return;
            }
            if (!File.Exists(TB_NewSAV.Text))
            {
                WinFormsUtil.Alert("Save 2 path invalid."); return;
            }
            if (new FileInfo(TB_OldSAV.Text).Length > 0x100000)
            {
                WinFormsUtil.Alert("Save 1 file invalid."); return;
            }
            if (new FileInfo(TB_NewSAV.Text).Length > 0x100000)
            {
                WinFormsUtil.Alert("Save 2 file invalid."); return;
            }

            SaveFile s1 = SaveUtil.GetVariantSAV(File.ReadAllBytes(TB_OldSAV.Text));
            SaveFile s2 = SaveUtil.GetVariantSAV(File.ReadAllBytes(TB_NewSAV.Text));

            if (s1 == null)
            {
                WinFormsUtil.Alert("Save 1 file invalid."); return;
            }
            if (s2 == null)
            {
                WinFormsUtil.Alert("Save 2 file invalid."); return;
            }

            if (s1.GetType() != s2.GetType())
            {
                WinFormsUtil.Alert("Save types are different.", $"S1: {s1.GetType().Name}", $"S2: {s2.GetType().Name}"); return;
            }
            if (s1.Version != s2.Version)
            {
                WinFormsUtil.Alert("Save versions are different.", $"S1: {s1.Version}", $"S2: {s2.Version}"); return;
            }

            string tbIsSet = "";
            string tbUnSet = "";

            try
            {
                bool[] oldBits = s1.EventFlags;
                bool[] newBits = s2.EventFlags;
                if (oldBits.Length != newBits.Length)
                {
                    WinFormsUtil.Alert("Event flag lengths for games are different.", $"S1: {(GameVersion)s1.Game}", $"S2: {(GameVersion)s2.Game}"); return;
                }

                for (int i = 0; i < oldBits.Length; i++)
                {
                    if (oldBits[i] == newBits[i])
                    {
                        continue;
                    }
                    if (newBits[i])
                    {
                        tbIsSet += $"{i:0000},";
                    }
                    else
                    {
                        tbUnSet += $"{i:0000},";
                    }
                }
            }
            catch (Exception e)
            {
                WinFormsUtil.Error("An unexpected error has occurred.", e);
                Debug.WriteLine(e);
            }
            TB_IsSet.Text = tbIsSet;
            TB_UnSet.Text = tbUnSet;

            string r = "";

            try
            {
                ushort[] oldConst = s1.EventConsts;
                ushort[] newConst = s2.EventConsts;
                if (oldConst.Length != newConst.Length)
                {
                    WinFormsUtil.Alert("Event flag lengths for games are different.", $"S1: {(GameVersion)s1.Game}", $"S2: {(GameVersion)s2.Game}"); return;
                }

                for (int i = 0; i < newConst.Length; i++)
                {
                    if (oldConst[i] != newConst[i])
                    {
                        r += $"{i}: {oldConst[i]}->{newConst[i]}{Environment.NewLine}";
                    }
                }
            }
            catch (Exception e)
            {
                WinFormsUtil.Error("An unexpected error has occurred.", e);
                Debug.WriteLine(e);
            }

            if (string.IsNullOrEmpty(r))
            {
                WinFormsUtil.Alert("No Event Constant diff found.");
                return;
            }

            if (DialogResult.Yes != WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Copy Event Constant diff to clipboard?"))
            {
                return;
            }
            Clipboard.SetText(r);
        }
Exemplo n.º 24
0
        private void SaveData_FileOpened(Object sender, FileOpenedArgs e)
        {
            saveData = e.saveFile;
            BindProperties();

            tabstripTopLevelGroup.Visible = (saveData != null);
            saveFileLoaded = true;
        }
Exemplo n.º 25
0
 public void SetVisibility(SaveFile s) => Item.Visible = Manip.Usable?.Invoke(s) ?? true;
Exemplo n.º 26
0
 protected ZukanBase(SaveFile sav, int dex)
 {
     SAV     = sav;
     PokeDex = dex;
 }
Exemplo n.º 27
0
 /// <summary>
 /// Loads the Settingsfile
 /// </summary>
 public static void Load()
 {
     file = new SaveFile(Location);
 }
Exemplo n.º 28
0
 public MyItem5BW(SaveFile SAV, int offset) : base(SAV) => Offset = offset;
Exemplo n.º 29
0
        private void SetTrainerData(SaveFile sav)
        {
            // Check and set trainerdata based on ISaveBlock interfaces
            byte[] dest;
            int    startofs = 0;

            //byte[] config;
            //int configstart = 0;

            Func <PokeSysBotMini, byte[]?> tdata;

            switch (sav)
            {
            case ISaveBlock8SWSH s8:
                dest     = s8.MyStatus.Data;
                startofs = s8.MyStatus.Offset;
                tdata    = LPBasic.GetTrainerData;
                break;

            case ISaveBlock7Main s7:
                dest     = s7.MyStatus.Data;
                startofs = s7.MyStatus.Offset;
                tdata    = LPBasic.GetTrainerData;
                break;

            case ISaveBlock6Main s6:
                dest     = s6.Status.Data;
                startofs = s6.Status.Offset;
                tdata    = LPBasic.GetTrainerData;
                break;

            case SAV7b slgpe:
                dest     = slgpe.Blocks.Status.Data;
                startofs = slgpe.Blocks.Status.Offset;
                tdata    = LPLGPE.GetTrainerData;
                break;

            case SAV8BS sbdsp:
                dest     = sbdsp.MyStatus.Data;
                startofs = sbdsp.MyStatus.Offset;
                tdata    = LPBDSP.GetTrainerData;

                //configstart = sbdsp.Config.Offset;
                //config = sbdsp.Config.Data;
                break;

            case SAV8LA sbla:
                dest     = sbla.MyStatus.Data;
                startofs = sbla.MyStatus.Offset;
                tdata    = LPPLA.GetTrainerData;
                break;

            default:
                dest  = Array.Empty <byte>();
                tdata = LPBasic.GetTrainerData;
                break;
            }

            if (dest.Length == 0)
            {
                return;
            }

            var data = tdata(Remote.Bot);

            if (data == null)
            {
                return;
            }
            data.CopyTo(dest, startofs);
        }
Exemplo n.º 30
0
 public SavePreview(SaveFile sav, string parent)
 {
     Save   = sav;
     Folder = parent;
 }
Exemplo n.º 31
0
        public SAV_Trainer(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = (SAV6)(Origin = sav).Clone();
            if (Main.Unicode)
            {
                try
                {
                    TB_OTName.Font = FontUtil.GetPKXFont(11);
                    if (SAV.XY)
                    {
                        TB_TRNick.Font = TB_OTName.Font;
                    }
                }
                catch (Exception e) { WinFormsUtil.Alert("Font loading failed...", e.ToString()); }
            }

            B_MaxCash.Click += (sender, e) => MT_Money.Text = "9,999,999";

            CB_Gender.Items.Clear();
            CB_Gender.Items.AddRange(Main.GenderSymbols.Take(2).ToArray()); // m/f depending on unicode selection

            TrainerStats.LoadRecords(SAV, Records.RecordList_6);
            TrainerStats.GetToolTipText = UpdateTip;

            MaisonRecords = new[]
            {
                TB_MCSN, TB_MCSS, TB_MBSN, TB_MBSS,
                TB_MCDN, TB_MCDS, TB_MBDN, TB_MBDS,
                TB_MCTN, TB_MCTS, TB_MBTN, TB_MBTS,
                TB_MCRN, TB_MCRS, TB_MBRN, TB_MBRS,
                TB_MCMN, TB_MCMS, TB_MBMN, TB_MBMS,
            };
            cba = new[] { CHK_Badge1, CHK_Badge2, CHK_Badge3, CHK_Badge4, CHK_Badge5, CHK_Badge6, CHK_Badge7, CHK_Badge8, };
            pba = new [] { PB_Badge1, PB_Badge2, PB_Badge3, PB_Badge4, PB_Badge5, PB_Badge6, PB_Badge7, PB_Badge8, };

            L_MultiplayerSprite.Enabled = CB_MultiplayerSprite.Enabled = SAV.ORAS;
            L_MultiplayerSprite.Visible = CB_MultiplayerSprite.Visible = SAV.ORAS;
            PB_Sprite.Visible           = CHK_MegaRayquazaUnlocked.Visible = SAV.ORAS;

            L_Style.Visible = TB_Style.Visible = SAV.XY;
            if (!SAV.XY)
            {
                TC_Editor.TabPages.Remove(Tab_Appearance);
            }
            if (SAV.ORASDEMO)
            {
                TC_Editor.TabPages.Remove(Tab_Multiplayer);
            }
            if (SAV.MaisonStats < 0)
            {
                TC_Editor.TabPages.Remove(Tab_Maison);
            }

            GetComboBoxes();
            GetTextBoxes();
            GetBadges();
            editing = false;

            CHK_MegaUnlocked.Checked         = SAV.IsMegaEvolutionUnlocked;
            CHK_MegaRayquazaUnlocked.Checked = SAV.IsMegaRayquazaUnlocked;
        }
Exemplo n.º 32
0
        public SAV_FestivalPlaza(SaveFile sav)
        {
            InitializeComponent();
            SAV               = (SAV7)(Origin = sav).Clone();
            editing           = true;
            typeMAX           = SAV is SAV7USUM ? 0x7F : 0x7C;
            TB_PlazaName.Text = SAV.Festa.FestivalPlazaName;

            if (SAV is SAV7USUM)
            {
                PBs          = new[] { ppkx1, ppkx2, ppkx3 };
                NUD_Trainers = new[] { NUD_Trainer1, NUD_Trainer2, NUD_Trainer3 };
                LoadBattleAgency();
            }
            else
            {
                TC_Editor.TabPages.Remove(Tab_BattleAgency);
            }

            if (Main.Unicode)
            {
                TB_OTName.Font = FontUtil.GetPKXFont();
            }

            var cc = SAV.Festa.FestaCoins;
            var cu = SAV.GetRecord(038);

            NUD_FC_Current.Value = Math.Min(cc, NUD_FC_Current.Maximum);
            NUD_FC_Used.Value    = Math.Min(cu, NUD_FC_Used.Maximum);
            L_FC_CollectedV.Text = (cc + cu).ToString();
            string[] res;
            switch (Main.CurrentLanguage)
            {
            case "ja":
                res = new[] {
                    "おじさんの きんのたま だからね!", "かがくの ちからって すげー", "1 2の …… ポカン!", "おーす! みらいの チャンピオン!", "おお! あんたか!", "みんな げんきに なりましたよ!", "とっても 幸せそう!", "なんでも ないです", "いあいぎりで きりますか?", "レポートを かきこんでいます",
                    "…… ぼくも もう いかなきゃ!", "ボンジュール!", "バイビー!", "ばか はずれです……", "やけどなおしの よういは いいか!", "ウー! ハーッ!", "ポケモンは たたかわせるものさ", "ヤドランは そっぽを むいた!", "マサラは まっしろ はじまりのいろ", "10000こうねん はやいんだよ!", "おーい! まてー! まつんじゃあ!", "こんちわ! ぼく ポケモン……!", "っだと こらあ!", "ぐ ぐーッ! そんな ばかなーッ!", "みゅう!", "タチサレ…… タチサレ……",
                    "カイリュー はかいこうせん", "どっちか 遊んでくれないか?", "ぬいぐるみ かっておいたわよ", "ひとのこと じろじろ みてんなよ", "なんのことだか わかんない", "みんな ポケモン やってるやん", "きょうから 24時間 とっくんだ!", "あたいが ホンモノ!", "でんげきで いちころ……", "スイクンを おいかけて 10ねん", "かんどうが よみがえるよ!", "われわれ ついに やりましたよー!", "ヤドンのシッポを うるなんて……", "ショオーッ!!", "ギャーアアス!!", "だいいっぽを ふみだした!",
                    "いちばん つよくて すごいんだよね", "にくらしいほど エレガント!", "そうぞうりょくが たりないよ", "キミは ビッグウェーブ!", "おまえさんには しびれた わい", "なに いってんだろ…… てへへ……", "ぬいぐるみ なんか かってないよ", "ここで ゆっくり して おいき!", "はじけろ! ポケモン トレーナー!", "はいが はいに はいった……", "…できる!", "ぶつかった かいすう 5かい!", "たすけて おくれーっ!!", "マボロシじま みえんのう……", "ひゅああーん!", "しゅわーん!",
                    "あつい きもち つたわってくる!", "こいつが! おれの きりふだ!", "ひとりじめとか そういうの ダメよ!", "ワーオ! ぶんせきどーり!", "ぱるぱるぅ!!!", "グギュグバァッ!!!", "ばっきん 100まんえん な!", "オレ つよくなる……", "ながれる 時間は とめられない!", "ぜったいに お願いだからね", "きみたちから はどうを かんじる!", "あたしのポケモンに なにすんのさ!", "リングは おれの うみ~♪", "オレの おおごえの ひとりごとを", "そう コードネームは ハンサム!", "……わたしが まけるかも だと!?",
                    "やめたげてよぉ!", "ブラボー! スーパー ブラボー!", "ボクは チャンピオンを こえる", "オレは いまから いかるぜッ!", "ライモンで ポケモン つよいもん", "キミ むしポケモン つかいなよ", "ストップ!", "ひとよんで メダルおやじ!", "トレーナーさんも がんばれよ!", "おもうぞんぶん きそおーぜ!", "プラズマズイ!", "ワタクシを とめることは できない!", "けいさんずみ ですとも!", "ババリバリッシュ!", "ンバーニンガガッ!", "ヒュラララ!",
                    "お友達に なっちゃお♪", "じゃあ みんな またねえ!", "このひとたち ムチャクチャです……", "トレーナーとは なにか しりたい", "スマートに くずれおちるぜ", "いのち ばくはつッ!!", "いいんじゃない いいんじゃないの!", "あれだよ あれ おみごとだよ!", "ぜんりょくでいけー! ってことよ!", "おまちなさいな!", "つまり グッド ポイント なわけ!", "ざんねん ですが さようなら", "にくすぎて むしろ 好きよ", "この しれもの が!", "イクシャア!!", "イガレッカ!!",
                    "フェスサークル ランク 100!",
                };
                break;

            default:
                const string musical8note = "♪";
                const string linedP       = "₽"; //currency Ruble
                res = new[] {                    //source:UltraMoon
                    /* (SM)Pokémon House */ "There's nothing funny about Nuggets.", "The Power of science is awesome.", "1, 2, and... Ta-da!", "How's the future Champ today?", "Why, you!", "There! All happy and healthy!", "Your Pokémon seems to be very happy!", "No thanks!", "Would you like to use Cut?", "Saving...",
                    /* (SM)Kanto Tent */ "Well, I better get going!", "Bonjour!", "Smell ya later!", "Sorry! Bad call!", "You better have Burn Heal!", "Hoo hah!", "Pokémon are for battling!", "Slowbro took a snooze...", "Shades of your journey await!", "You're 10,000 light-years from facing Brock!", "Hey! Wait! Don't go out!", "Hiya! I'm a Pokémon...", "What do you want?", "WHAT! This can't be!", "Mew!", "Be gone... Intruders...",
                    /* (SM)Joht Tent */ "Dragonite, Hymer Beam.", "Spread the fun around.", "I bought an adorable doll with your money.", "What are you staring at?", "I just don't understand.", "Everyone is into Pokémon.", "I'm going to train 24 hours a day!", "I'm the real deal!", "With a jolt of electricity...", "For 10 years I chased Suicune.", "I am just so deeply moved!", "We have finally made it!", "...But selling Slowpoke Tails?", "Shaoooh!", "Gyaaas!", "you've taken your first step!",
                    /* (SM)Hoenn Tent */ "I'm just the strongest there is right now.", "And confoundedly elegant!", "You guys need some imagination.", "You made a much bigger splash!", "You ended up giving me a thrill!", "So what am I talking about...", "I'm not buying any Dolls.", "Take your time and rest up!", "Have a blast, Pokémon Trainers!", "I got ashes in my eyelashes!", "You're sharp!", "Number of collisions: 5 times!", "Please! Help me out!", "I can't see Mirage Island today...", "Hyahhn!", "Shwahhn!",
                    /* (SM)Sinnoh Tent */ "Your will is overwhelming me!", "This is it! My trump card!", "Trying to monopolize Pokémon just isn't...", "See? Just as analyzed.", "Gagyagyaah!", "Gugyugubah!", "It's a " + linedP + "10 million fine if you're late!", "I'm going to get tougher...", "You'll never be able to stem the flow of time!", "Please come!", "Your team! I sense your strong aura!", "What do you think you're doing?!", "The ring is my rolling sea. " + musical8note, "I was just thinking out loud.", "My code name, it is Looker.", "It's not possible that I lose!",
                    /* (SM)Unova Tent */ "Knock it off!", "Bravo! Excellent!!", "I'll defeat the Champion.", "You're about to feel my rage!", "Nimbasa's Pokémon can dance a nimble bossa!", "Use Bug-type Pokémon!", "Stop!", "People call me Mr. Medal!", "Trainer, do your best, too!", "See who's stronger!", "Plasbad, for short!", "I won't allow anyone to stop me!", "I was expecting exactly that kind of move!", "Bazzazzazzash!", "Preeeeaah!", "Haaahraaan!",
                    /* (SM)Kalos Tent */ "We'll become friends. " + musical8note, "I'll see you all later!", "These people have a few screws loose...", "I want to know what a \"Trainer\" is.", "When I lose, I go out in style!", "Let's give it all we've got!", "Fantastic! Just fantastic!", "Outstanding!", "Try as hard as possible!", "Stop right there!", "That really hit me right here...", "But this is adieu to you all.", "You're just too much, you know?", "Fool! You silly, unseeing child!", "Xsaaaaaah!", "Yvaaaaaar!",
                    "I reached Festival Plaza Rank 100!",
                };
                break;
            }
            CLB_Phrases.Items.Clear();
            CLB_Phrases.Items.Add(res.Last(), SAV.Festa.GetFestaPhraseUnlocked(106)); //add Lv100 before TentPhrases
            for (int i = 0; i < res.Length - 1; i++)
            {
                CLB_Phrases.Items.Add(res[i], SAV.Festa.GetFestaPhraseUnlocked(i));
            }

            DateTime dt = SAV.Festa.FestaDate ?? new DateTime(2000, 1, 1);

            CAL_FestaStartDate.Value = CAL_FestaStartTime.Value = dt;

            string[] res2 = { "Rank 4: missions", "Rank 8: facility", "Rank 10: fashion", "Rank 20: rename", "Rank 30: special menu", "Rank 40: BGM", "Rank 50: theme Glitz", "Rank 60: theme Fairy", "Rank 70: theme Tone", "Rank 100: phrase", "Current Rank", };
            CLB_Reward.Items.Clear();
            CLB_Reward.Items.Add(res2.Last(), (CheckState)RewardState[SAV.Festa.GetFestPrizeReceived(10)]); //add CurrentRank before const-rewards
            for (int i = 0; i < res2.Length - 1; i++)
            {
                CLB_Reward.Items.Add(res2[i], (CheckState)RewardState[SAV.Festa.GetFestPrizeReceived(i)]);
            }

            for (int i = 0; i < 7; i++)
            {
                f[i] = new FestaFacility(SAV, i);
            }

            string[] res3 = { "Meet", "Part", "Moved", "Disappointed" };
            CB_FacilityMessage.Items.Clear();
            CB_FacilityMessage.Items.AddRange(res3);
            string[] res5 =
            {
                "Ace Trainer" + gendersymbols[1],
                "Ace Trainer" + gendersymbols[0],
                "Veteran" + gendersymbols[1],
                "Veteran" + gendersymbols[0],
                "Office Worker" + gendersymbols[0],
                "Office Worker" + gendersymbols[1],
                "Punk Guy",
                "Punk Girl",
                "Breeder" + gendersymbols[0],
                "Breeder" + gendersymbols[1],
                "Youngster",
                "Lass"
            };
            CB_FacilityNPC.Items.Clear();
            CB_FacilityNPC.Items.AddRange(res5);
            string[]   res6 = { "Lottery", "Haunted", "Goody", "Food", "Bouncy", "Fortune", "Dye", "Exchange" };
            string[][] res7 =
            {
                new[] { "BigDream",  "GoldRush",  "TreasureHunt"     },
                new[] { "GhostsDen", "TrickRoom", "ConfuseRay"       },
                new[] { "Ball",      "General",   "Battle", "SoftDrink", "Pharmacy"},
                new[] { "Rare",      "Battle",    "FriendshipCafé", "FriendshipParlor"},
                new[] { "Thump",     "Clink",     "Stomp"            },
                new[] { "Kanto",     "Johto",     "Hoenn", "Sinnoh", "Unova", "Kalos", "Pokémon"},
                new[] { "Red",       "Yellow",    "Green", "Blue", "Orange", "NavyBlue", "Purple", "Pink"},
                new[] { "Switcheroo" }
            };

            CB_FacilityType.Items.Clear();
            for (int k = 0; k < RES_FacilityLevelType.Length - (SAV is SAV7USUM ? 0 : 1); k++) //Exchange is USUM only
            {
                for (int j = 0; j < RES_FacilityLevelType[k].Length; j++)
                {
                    if (RES_FacilityLevelType[k][j] != 4)
                    {
                        for (int i = 0; i < RES_FacilityLevelType[k][j]; i++)
                        {
                            CB_FacilityType.Items.Add($"{res6[k]} {res7[k][j]} {i + 1}");
                        }
                    }
                    else
                    {
                        CB_FacilityType.Items.Add($"{res6[k]} {res7[k][j]} 1");
                        CB_FacilityType.Items.Add($"{res6[k]} {res7[k][j]} 3");
                        CB_FacilityType.Items.Add($"{res6[k]} {res7[k][j]} 5");
                    }
                }
            }

            string[] types = { "GTS", "Wonder Trade", "Battle Spot", "Festival Plaza", "mission", "lottery shop", "haunted house" };
            string[] lvl   = { "+", "++", "+++" };
            CB_LuckyResult.Items.Clear();
            CB_LuckyResult.Items.Add("none");
            foreach (string type in types)
            {
                foreach (string lv in lvl)
                {
                    CB_LuckyResult.Items.Add($"{lv} {type}");
                }
            }

            NUD_Rank.Value = SAV.Festa.FestaRank;
            LoadRankLabel(SAV.Festa.FestaRank);
            NUD_Messages = new[] { NUD_MyMessageMeet, NUD_MyMessagePart, NUD_MyMessageMoved, NUD_MyMessageDissapointed };
            for (int i = 0; i < NUD_Messages.Length; i++)
            {
                NUD_Messages[i].Value = SAV.Festa.GetFestaMessage(i);
            }

            LB_FacilityIndex.SelectedIndex   = 0;
            CB_FacilityMessage.SelectedIndex = 0;
            editing = false;

            entry = 0;
            LoadFacility();
        }
Exemplo n.º 33
0
        static void Main(string[] args)
        {
            List<string> tags = new List<string>{"c#",
                "java",
                "php",
                "javascript",
                "android",
                "jquery",
                "c++",
                "iphone",
                "asp.net",
                "python",
                ".net",
                "html",
                "mysql",
                "objective-c",
                "ios",
                "sql",
                "css",
                "ruby-on-rails",
                "c",
                "ruby",
                "sql-server",
                "wpf",
                "xml",
                "ajax",
                "regex",
                "asp.net-mvc",
                "database",
                "xcode",
                "django",
                "linux",
                "windows",
                "arrays",
                "vb.net",
                "facebook",
                "ruby-on-rails-3",
                "eclipse",
                "json",
                "winforms",
                "string",
                "multithreading",
                "asp.net-mvc-3",
                "visual-studio-2010",
                "wcf",
                "performance",
                "image",
                "osx",
                "algorithm",
                "linq",
                "web-services",
                "visual-studio"
            };
            int startPage = 11;
            int endPage = 20;
            for(int k = 0; k < tags.Count; k++){
                string tag = tags[k];
                Console.WriteLine("Starting to pull for tag: " + tag + ".");
                if(tag == "c#"){
                    tag = "c%23";
                }
                //Full loop for current tag
                List<Responce> responces = new List<Responce>();
                int i = startPage;
                bool keepRunning = true;
                while (keepRunning)
                {
                    string url = "http://api.stackoverflow.com/1.1/questions?body=true&pagesize=100&tagged=" + tag + "&page=" + i.ToString();

                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                    request.Timeout = 5000;

                    try
                    {
                        using (WebResponse response = (HttpWebResponse)request.GetResponse())
                        using (Stream csStream = new GZipStream(response.GetResponseStream(), CompressionMode.Decompress))
                        {
                            byte[] bytes = ReadFully(csStream);
                            string responceString = Encoding.UTF8.GetString(bytes);
                            try
                            {
                                Responce responceObject = JsonConvert.DeserializeObject<Responce>(responceString);
                                responces.Add(responceObject);
                                if (responceObject.total < responceObject.page * responceObject.pagesize || responceObject.page >= endPage)
                                {
                                    keepRunning = false;
                                }
                            }
                            catch{
                            }
                        }

                    }
                    catch (WebException)
                    {
                        Console.WriteLine("Error Occured");
                    }
                    i++;
                }
                if(tag == "c%23")
                    tag = "c#";
                if(responces.Count > 0){
                    SaveFile saveData = new SaveFile();
                    saveData.questions = new List<Question>();
                    saveData.count = responces[0].total;
                    saveData.tag = tag;
                    using (System.IO.StreamWriter file = new System.IO.StreamWriter((@"../../../../JsonFiles/" + tag + ".json"),true))
                    {
                        foreach (var responce in responces)
                        {
                            string output = JsonConvert.SerializeObject(responce);
                            file.WriteLine(output);
                        }
                    }
                }
                Console.WriteLine("Finishing pulling for tag: " + tag + ".");
            }
        }
Exemplo n.º 34
0
 public void Setup()
 {
     _file = new SaveFile(ReadFileTest.TEST_FILE);
     _file.Parse(CallerContext.Empty);
 }
Exemplo n.º 35
0
    private void Update()
    {
        if (isDead)
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                SceneManager.LoadScene("MikkoHideOut");
            }


            return;
        }


        if (m_transform.position.y < -20)
        {
            GetComponent <Stats>().TakeDmg(10000);
        }

        if (m_stats != null && m_stats.isDead)
        {
            if (Input.GetKeyDown(KeyCode.R))
            {
                SceneManager.LoadScene("ForestScene");
            }
        }

        if (m_anim != null)
        {
            float speed = Mathf.Abs(m_move.magnitude);
            m_anim.SetFloat("Speed", speed);

            if (speed > 0 && !walkSound.isPlaying)
            {
                walkSound.Play();
            }
            else if (speed <= 0)
            {
                walkSound.Pause();
            }
        }

        if (!AllowMovement)
        {
            return;
        }

        /*if(Input.GetKeyDown(KeyCode.E))
         * {
         *  if(m_allowDash && canDash)
         *  {
         *      StartCoroutine(Dash());
         *      dashTimerForUI = 0;
         *      m_anim.SetTrigger("Charge");
         *  }
         * }*/

        if (comboStarted)
        {
            comboTimer += 1 * Time.deltaTime;
            if (comboTimer > 3)
            {
                GameManager gm = FindObjectOfType <GameManager>();
                comboTimer   = 0;
                currComboIdx = 0;
                comboStarted = false;
                if (gm.boboFace != null)
                {
                    gm.boboFace.sprite = gm.boboNormal;
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.F))
        {
            AttemptEat();
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            comboStarted = true;
            if (m_anim != null && mainHand.canMelee)
            {
                SaveFile    sf = FindObjectOfType <SaveFile>();
                GameManager gm = FindObjectOfType <GameManager>();
                if (gm.boboFace != null)
                {
                    gm.boboFace.sprite = gm.boboAngry;
                }

                /*if (currComboIdx >= sf.loadedSave.currentMaxCombo)
                 * {
                 *  currComboIdx = 0;
                 * }
                 * else
                 * {
                 *  currComboIdx++;
                 * }*/

                //Debug.Log(currComboIdx);

                switch (currComboIdx)
                {
                case 0:
                    m_anim.SetTrigger("Attack1");
                    m_anim.speed = mainHand.swingTimerMax;
                    mainHand.Swing();
                    currComboIdx++;
                    SoundManager.PlayASource("YetiSound1");
                    break;

                case 1:
                    m_anim.SetTrigger("Attack2");
                    m_anim.speed = mainHand.swingTimerMax;
                    offHand.Swing();
                    SoundManager.PlayASource("YetiSound2");
                    if (currComboIdx < sf.loadedSave.currentMaxCombo)
                    {
                        currComboIdx++;
                    }
                    else
                    {
                        currComboIdx = 0;
                        comboTimer   = 3;
                    }
                    break;

                case 2:
                    m_anim.SetTrigger("Attack3");
                    mainHand.Swing();
                    offHand.Swing();
                    currComboIdx = 0;
                    SoundManager.PlayASource("YetiSound3");
                    break;
                }

                //SoundManager.PlayASource("Swing");
            }
        }

        if (dashTimerForUI < dashCooldown)
        {
            dashTimerForUI += Time.deltaTime;
        }

        if (playerDash != null)
        {
            UpdateDashImage();
        }
    }
Exemplo n.º 36
0
    protected void Page_Load(object sender, EventArgs e)
    {
        tempUploadFolder = Server.MapPath("Uploads") +  string.Format("//Temp//{0}", Session.SessionID);

        if (this.IsPostBack)
        {
            long maxSize = 4000000;

            UploadDetail Upload = (UploadDetail)this.Session["UploadDetail"];
            //Let the webservie know that we are not yet ready
            Upload.IsReady = false;
            if (this.fileUpload.PostedFile != null && this.fileUpload.PostedFile.ContentLength > 0)
            {

                if (!Directory.Exists(tempUploadFolder))
                {
                    Directory.CreateDirectory(tempUploadFolder);
                }

                //START : Saving File in Database
                SaveFile saveFileInDB = new SaveFile();
                saveFileInDB.FileName = this.fileUpload.PostedFile.FileName;
                saveFileInDB.FileExtension = Path.GetExtension(this.fileUpload.PostedFile.FileName);

                saveFileInDB.FileContent = this.fileUpload.FileBytes;
                Result Result = saveFileInDB.SaveFileInDB();
                if (Result.IsError == false)
                {
                    //File Save in Database Successfully!
                }
                else
                {
                    //Error in Saving File in Database!
                    //Error: Result.ErrorMessage
                    //InnerException: Result.InnerException
                    //StackTrace: Result.StackTrace
                }
                //END : Saving File in Database

                //build the local path where upload all the files
                string fileName = Path.GetFileName(this.fileUpload.PostedFile.FileName);

                //Build the strucutre and stuff it into session
                Upload.ContentLength = this.fileUpload.PostedFile.ContentLength;
                Upload.FileName = fileName;
                Upload.UploadedLength = 0;
                //Let the polling process know that we are done initializing ...
                Upload.IsReady = true;

                //set the buffer size to something larger.
                //the smaller the buffer the longer it will take to download,
                //but the more precise your progress bar will be.
                int bufferSize = 1;
                byte[] buffer = new byte[bufferSize];

                //Writing the byte to disk
                using (FileStream fs = new FileStream(Path.Combine(tempUploadFolder, fileName), FileMode.Create))
                {
                    //Aslong was we haven't written everything ...
                    while (Upload.UploadedLength < Upload.ContentLength)
                    {
                        //Fill the buffer from the input stream
                        int bytes = this.fileUpload.PostedFile.InputStream.Read(buffer, 0, bufferSize);
                        //Writing the bytes to the file stream
                        fs.Write(buffer, 0, bytes);
                        //Update the number the webservice is polling on to the session
                        Upload.UploadedLength += bytes;
                    }
                }

                //Call parent page know we have processed the uplaod
                const string jsSuccess = "window.parent.onComplete(1,'File uploaded successfully.','{0}','{1} of {2} Bytes');";
                ScriptManager.RegisterStartupScript(this, typeof(CSVUploadEngine), "progress", string.Format(jsSuccess, fileName, Upload.UploadedLength, Upload.ContentLength), true);
            }
            else
            {
                //Call parent page know we have processed the uplaod
                const string jsError = "window.parent.onComplete(4, 'There was a problem with the file.','','0 of 0 Bytes');";
                ScriptManager.RegisterStartupScript(this, typeof(CSVUploadEngine), "progress", jsError, true);
            }
            //Let webservie know that we are not yet ready
            Upload.IsReady = false;
        }
    }
Exemplo n.º 37
0
        private void openButton_Click(object sender, EventArgs e)
        {
            SelectedSaveFile = saveListBox.SelectedItem as SaveFile;

            Close();
        }
Exemplo n.º 38
0
 /// <summary>
 /// Set active pokemon to egg.
 /// </summary>
 /// <param name="sav">Save File to SetEgg</param>
 /// <param name="pkm">active pokemon</param>
 /// <returns>Egg pokemon</returns>
 public static PKM SetEggCurrent(this SaveFile sav, PKM pkm)
 {
     return(pkm.SetPkmToEgg(sav.Version));
 }
Exemplo n.º 39
0
		// Range: -1 Access: 0 Flags: ( 0, 4, 255 )
		public static void convert_notes_sql( string ckey = null ) {
			SaveFile notesfile = null;
			string notetext = null;
			dynamic server = null;
			string regex = null;
			Regex results = null;
			dynamic timestamp = null;
			string adminckey = null;
			DBQuery query_convert_time = null;
			string err = null;
			notesfile = new SaveFile( "data/player_notes.sav" );
			if ( !( notesfile != null ) ) {
				GlobalFuncs.log_game( "Error: Cannot access " + "data/player_notes.sav" );
				return;
			}
			((dynamic)notesfile).cd = "/" + ckey;
			while (!Lang13.Bool( ((dynamic)notesfile).eof )) {
				notetext = null;
				notetext = ((dynamic)notesfile).read();
				server = null;
				if ( GlobalVars.config != null && Lang13.Bool( GlobalVars.config.server_name ) ) {
					server = GlobalVars.config.server_name;
				}
				regex = "^(\\d{2}-\\w{3}-\\d{4}) \\| (.+) ~(\\w+)$";
				results = GlobalFuncs.regex_note_sql_extract( notetext, regex );
				timestamp = results.f_str( 2 );
				notetext = results.f_str( 3 );
				adminckey = results.f_str( 4 );
				query_convert_time = GlobalVars.dbcon.NewQuery( "SELECT ADDTIME(STR_TO_DATE('" + timestamp + "','%d-%b-%Y'), '0')" );
				if ( !query_convert_time.Execute() ) {
					err = query_convert_time.ErrorMsg();
					GlobalFuncs.log_game( "SQL ERROR converting timestamp. Error : [" + err + "]\n" );
					return;
				}
				if ( query_convert_time.NextRow() ) {
					timestamp = query_convert_time.item[1];
				}
				if ( Lang13.Bool( ckey ) && Lang13.Bool( notetext ) && Lang13.Bool( timestamp ) && Lang13.Bool( adminckey ) && Lang13.Bool( server ) ) {
					GlobalFuncs.add_note( ckey, notetext, timestamp, adminckey, false, server );
				}
			}
			((dynamic)notesfile).cd = "/";
			((dynamic)((dynamic)notesfile).dir).Remove( ckey );
			return;
		}
Exemplo n.º 40
0
 private void closeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SaveFile = null;
 }
Exemplo n.º 41
0
		// Range: -1 Access: 0 Flags: ( 0, 4, 255 )
		public static void appearance_savebanfile(  ) {
			SaveFile S = null;
			S = new SaveFile( "data/appearance_full.ban" );
			S["keys" + 0].write( GlobalVars.appearance_keylist );
			return;
		}
Exemplo n.º 42
0
        private void Form1_DragDrop(object sender, DragEventArgs e)
        {
            while (this.Opacity > 0.3)
            {
                this.Opacity -= 0.1f;
                Thread.Sleep(50);
            }
            SaveFile SF1 = new SaveFile(DubCheck);

            ThreadPool.QueueUserWorkItem(delegate { SF1(e); });
        }
Exemplo n.º 43
0
 // Removes the specified save, then saves the remaining saves to file
 public static void DeleteSave(SaveFile save)
 {
     saved_games.Remove(save);
     Save();
 }
Exemplo n.º 44
0
 public Party8(SaveFile sav, SCBlock block) : base(sav, block.Data)
 {
 }
Exemplo n.º 45
0
        internal SaveForm(string[] ActivePlugins, string[] InactivePlugins)
        {
            InitializeComponent();
            Array.Sort(ActivePlugins);
            Array.Sort(InactivePlugins);
            aPlugins = ActivePlugins;
            iPlugins = InactivePlugins;
            SaveImageList.Images.AddRange(new Image[]
            {
                Resources.GreenSquare,
                Resources.YellowSquare, Resources.YellowSquare
            });
            Icon = Resources.fomm02;
            cmbSort.SelectedIndex      = 3;
            lvSaves.ListViewItemSorter = new SaveListSorter();
            foreach (var file in Directory.GetFiles(Program.GameMode.SavesPath))
            {
                BinaryReader br;
                SaveFile     sf;
                try
                {
                    br = new BinaryReader(File.OpenRead(file));
                }
                catch
                {
                    continue;
                }
                try
                {
                    if (br.BaseStream.Length < 12)
                    {
                        br.Close();
                        continue;
                    }
                    var str = "";
                    for (var i = 0; i < 11; i++)
                    {
                        str += (char)br.ReadByte();
                    }
                    if (str != "FO3SAVEGAME")
                    {
                        br.Close();
                        continue;
                    }
                    sf                      = new SaveFile();
                    sf.saved                = (new FileInfo(file)).LastWriteTime;
                    sf.FileName             = Path.GetFileName(file);
                    br.BaseStream.Position += 9;

                    sf.ImageWidth = br.ReadInt32();
                    br.ReadByte();
                    sf.ImageHeight = br.ReadInt32();
                    br.ReadByte();
                    br.ReadInt32();
                    br.ReadByte();
                    var s = br.ReadInt16();
                    br.ReadByte();
                    for (var i = 0; i < s; i++)
                    {
                        sf.Player += (char)br.ReadByte();
                    }
                    br.ReadByte();
                    s = br.ReadInt16();
                    br.ReadByte();
                    for (var i = 0; i < s; i++)
                    {
                        sf.Karma += (char)br.ReadByte();
                    }
                    br.ReadByte();
                    sf.Level = br.ReadInt32();
                    br.ReadByte();
                    s = br.ReadInt16();
                    br.ReadByte();
                    for (var i = 0; i < s; i++)
                    {
                        sf.Location += (char)br.ReadByte();
                    }
                    br.ReadInt32(); //|<short>|
                    for (var i = 0; i < 3; i++)
                    {
                        sf.Playtime += (char)br.ReadByte();
                    }
                    sf.Playtime += " hours, ";
                    br.ReadByte();
                    for (var i = 0; i < 2; i++)
                    {
                        sf.Playtime += (char)br.ReadByte();
                    }
                    sf.Playtime += " minutes and ";
                    br.ReadByte();
                    for (var i = 0; i < 2; i++)
                    {
                        sf.Playtime += (char)br.ReadByte();
                    }
                    sf.Playtime += " seconds";
                    br.ReadByte();

                    sf.ImageData = new byte[sf.ImageHeight * sf.ImageWidth * 3];
                    br.Read(sf.ImageData, 0, sf.ImageData.Length);
                    //Flip the blue and red channels
                    for (var i = 0; i < sf.ImageWidth * sf.ImageHeight; i++)
                    {
                        var temp = sf.ImageData[i * 3];
                        sf.ImageData[i * 3]     = sf.ImageData[i * 3 + 2];
                        sf.ImageData[i * 3 + 2] = temp;
                    }
                    br.ReadByte();
                    br.ReadInt32();
                    sf.plugins = new string[br.ReadByte()];
                    for (var i = 0; i < sf.plugins.Length; i++)
                    {
                        br.ReadByte();
                        s = br.ReadInt16();
                        br.ReadByte();
                        sf.plugins[i] = "";
                        for (var j = 0; j < s; j++)
                        {
                            sf.plugins[i] += (char)br.ReadByte();
                        }
                    }
                }
                catch (Exception)
                {
                    continue;
                }
                finally
                {
                    br.Close();
                }
                saves.Add(sf);
            }
            UpdateSaveList();
        }
Exemplo n.º 46
0
 public static void Create(string fileName)
 {
     currentSave = new SaveFile(fileName);
     Save();
 }
Exemplo n.º 47
0
        private static Image GetWallpaper(SaveFile SAV, int box)
        {
            string s = BoxWallpaper.GetWallpaper(SAV, box);

            return((Bitmap)(Resources.ResourceManager.GetObject(s) ?? Resources.box_wp16xy));
        }
Exemplo n.º 48
0
    public void SaveGame()
    {
        if (!CanSave) {
            Debug.Log("Can't save now.");
            return;
        }
        if (!System.IO.Directory.Exists(SaveDirectory)) {
            System.IO.Directory.CreateDirectory(SaveDirectory);
        }

        XmlSerializer writer = new XmlSerializer(typeof(SaveFile));
        SaveFile save = new SaveFile();
        save.Initialize();

        if (System.IO.File.Exists(SaveSystem.Instance.SaveDirectory + "/" + PlayerID + FileExt)) {
            System.IO.File.Delete(SaveSystem.Instance.SaveDirectory + "/" + PlayerID + FileExt);
        }
        System.IO.FileStream file = System.IO.File.OpenWrite(SaveDirectory + "/" + PlayerID + FileExt);
        writer.Serialize(file, save);
        file.Close();

        Debug.Log("Saved " + PlayerID + FileExt);
    }
Exemplo n.º 49
0
 // Extension Methods
 public static Image WallpaperImage(this SaveFile SAV, int box) => GetWallpaper(SAV, box);
Exemplo n.º 50
0
    internal SaveForm(string[] ActivePlugins, string[] InactivePlugins)
    {
      InitializeComponent();
      Array.Sort(ActivePlugins);
      Array.Sort(InactivePlugins);
      aPlugins = ActivePlugins;
      iPlugins = InactivePlugins;
      SaveImageList.Images.AddRange(new Image[]
      {
        Resources.GreenSquare,
        Resources.YellowSquare, Resources.YellowSquare
      });
      Icon = Resources.fomm02;
      cmbSort.SelectedIndex = 3;
      lvSaves.ListViewItemSorter = new SaveListSorter();
      foreach (var file in Directory.GetFiles(Program.GameMode.SavesPath))
      {
        BinaryReader br;
        SaveFile sf;
        try
        {
          br = new BinaryReader(File.OpenRead(file));
        }
        catch
        {
          continue;
        }
        try
        {
          if (br.BaseStream.Length < 12)
          {
            br.Close();
            continue;
          }
          var str = "";
          for (var i = 0; i < 11; i++)
          {
            str += (char) br.ReadByte();
          }
          if (str != "FO3SAVEGAME")
          {
            br.Close();
            continue;
          }
          sf = new SaveFile();
          sf.saved = (new FileInfo(file)).LastWriteTime;
          sf.FileName = Path.GetFileName(file);
          br.BaseStream.Position += 9;

          for (var i = 0; i < 64; i++)
          {
            sf.Language += (char) br.ReadByte();
          }
          sf.Language = sf.Language.Trim('\0');
          br.ReadByte();

          sf.ImageWidth = br.ReadInt32();
          br.ReadByte();
          sf.ImageHeight = br.ReadInt32();
          br.ReadByte();
          br.ReadInt32();
          br.ReadByte();
          var s = br.ReadInt16();
          br.ReadByte();
          for (var i = 0; i < s; i++)
          {
            sf.Player += (char) br.ReadByte();
          }
          br.ReadByte();
          s = br.ReadInt16();
          br.ReadByte();
          for (var i = 0; i < s; i++)
          {
            sf.Karma += (char) br.ReadByte();
          }
          br.ReadByte();
          sf.Level = br.ReadInt32();
          br.ReadByte();
          s = br.ReadInt16();
          br.ReadByte();
          for (var i = 0; i < s; i++)
          {
            sf.Location += (char) br.ReadByte();
          }
          br.ReadInt32(); //|<short>|
          for (var i = 0; i < 3; i++)
          {
            sf.Playtime += (char) br.ReadByte();
          }
          sf.Playtime += " hours, ";
          br.ReadByte();
          for (var i = 0; i < 2; i++)
          {
            sf.Playtime += (char) br.ReadByte();
          }
          sf.Playtime += " minutes and ";
          br.ReadByte();
          for (var i = 0; i < 2; i++)
          {
            sf.Playtime += (char) br.ReadByte();
          }
          sf.Playtime += " seconds";
          br.ReadByte();

          sf.ImageData = new byte[sf.ImageHeight*sf.ImageWidth*3];
          br.Read(sf.ImageData, 0, sf.ImageData.Length);
          //Flip the blue and red channels
          for (var i = 0; i < sf.ImageWidth*sf.ImageHeight; i++)
          {
            var temp = sf.ImageData[i*3];
            sf.ImageData[i*3] = sf.ImageData[i*3 + 2];
            sf.ImageData[i*3 + 2] = temp;
          }
          br.ReadByte();
          br.ReadInt32();
          sf.plugins = new string[br.ReadByte()];
          for (var i = 0; i < sf.plugins.Length; i++)
          {
            br.ReadByte();
            s = br.ReadInt16();
            br.ReadByte();
            sf.plugins[i] = "";
            for (var j = 0; j < s; j++)
            {
              sf.plugins[i] += (char) br.ReadByte();
            }
          }
        }
        catch (Exception)
        {
          continue;
        }
        finally
        {
          br.Close();
        }
        saves.Add(sf);
      }
      UpdateSaveList();
    }
Exemplo n.º 51
0
 public static Image Sprite(this SaveFile SAV) => GetSprite(SAV);
Exemplo n.º 52
0
		// Range: -1 Access: 0 Flags: ( 0, 4, 255 )
		public static void appearance_loadbanfile(  ) {
			SaveFile S = null;
			DBQuery query = null;
			dynamic ckey = null;
			if ( GlobalVars.config.ban_legacy_system ) {
				S = new SaveFile( "data/appearance_full.ban" );
				GlobalVars.appearance_keylist = S["keys" + 0].read();
				GlobalFuncs.log_admin( "Loading appearance_rank" );
				GlobalVars.appearanceban_runonce = S["runonce"].read();
				if ( !( GlobalVars.appearance_keylist.Length != 0 ) ) {
					GlobalVars.appearance_keylist = new ByTable();
					GlobalFuncs.log_admin( "appearance_keylist was empty" );
				}
			} else {
				if ( !GlobalFuncs.establish_db_connection() ) {
					((dynamic)Game13.log).write( "Database connection failed. Reverting to the legacy ban system." );
					((dynamic)GlobalVars.diary).write( "Database connection failed. Reverting to the legacy ban system." );
					GlobalVars.config.ban_legacy_system = true;
					GlobalFuncs.appearance_loadbanfile();
					return;
				}
				query = GlobalVars.dbcon.NewQuery( "SELECT ckey FROM " + GlobalFuncs.format_table_name( "ban" ) + " WHERE bantype = 'APPEARANCE_PERMABAN' AND NOT unbanned = 1" );
				query.Execute();
				while (query.NextRow()) {
					ckey = query.item[1];
					GlobalVars.appearance_keylist.Add( "" + ckey );
				}
			}
			return;
		}
Exemplo n.º 53
0
 public static Image Sprite(this PKM pkm, SaveFile SAV, int box, int slot, bool flagIllegal = false)
 => GetSprite(pkm, SAV, box, slot, flagIllegal);
Exemplo n.º 54
0
        public SAV_Misc4(SaveFile sav)
        {
            int ofsFlag;

            SAV = (SAV4)(Origin = sav).Clone();
            InitializeComponent();

            int GBO = SAV.GBO;

            switch (SAV.Version)
            {
            case GameVersion.D:
            case GameVersion.P:
            case GameVersion.DP:
                ofsFlag              = GBO + 0xFDC;
                ofsBP                = GBO + 0x65F8;
                ofsUGFlagCount       = GBO + 0x3A60;
                ofsPoketch           = GBO + 0x114E;
                L_CurrentMap.Visible = CB_UpgradeMap.Visible = false;
                GB_Prints.Visible    = GB_Prints.Enabled = GB_Hall.Visible = GB_Hall.Enabled = GB_Castle.Visible = GB_Castle.Enabled = false;
                BFF = new[] { new[] { 0, 1, 0x5FCA, 0x04, 0x6601 }, };
                break;

            case GameVersion.Pt:
                ofsFlag              = GBO + 0xFEC;
                ofsBP                = GBO + 0x7234;
                ofsUGFlagCount       = GBO + 0x3CE8;
                ofsPoketch           = GBO + 0x1162;
                L_CurrentMap.Visible = CB_UpgradeMap.Visible = false;
                ofsPrints            = GBO + 0xE4A;
                BFF = new[] {
                    new[] { 0, 1, 0x68E0, 0x04, 0x723D },
                    new[] { 1, 0, 0x68F4, 0x10, 0x7EF8 },
                    new[] { 0, 0, 0x6924, 0x18, 0x7EFC },
                    new[] { 2, 0, 0x696C, 0x10, 0x7F00 },
                    new[] { 0, 0, 0x699C, 0x04, 0x7F04 },
                };
                ofsHallStat = GBO + 0x2820;
                break;

            case GameVersion.HG:
            case GameVersion.SS:
            case GameVersion.HGSS:
                ofsFlag            = GBO + 0x10C4;
                ofsBP              = GBO + 0x5BB8;
                L_UGFlags.Visible  = NUD_UGFlags.Visible = false;
                GB_Poketch.Visible = false;
                ofsMap             = GBO + 0xBAE7;
                ofsPrints          = GBO + 0xE7E;
                BFF = new[] {
                    // { BFV, BFT, addr, 1BFTlen, checkBit
                    new[] { 0, 1, 0x5264, 0x04, 0x5BC1 },
                    new[] { 1, 0, 0x5278, 0x10, 0x687C },
                    new[] { 0, 0, 0x52A8, 0x18, 0x6880 },
                    new[] { 2, 0, 0x52F0, 0x10, 0x6884 },
                    new[] { 0, 0, 0x5320, 0x04, 0x6888 },
                };
                ofsHallStat = GBO + 0x230C;
                break;

            default: return;
            }
            ofsFly = ofsFlag + 0x136;
            ReadMain();
            ReadBattleFrontier();
            if (!SAV.HGSS)
            {
                TC_Misc.Controls.Remove(TAB_Walker);
            }
        }
Exemplo n.º 55
0
 // Adds the saved game to the saved_games list
 public static void AddNewSave(SaveFile current)
 {
     // Add to the saved_games list
     saved_games.Add(current);
     Save();
 }