Example #1
0
 public static void Update()
 {
     try
     {
         Rasu DownloadInformations = new Rasu(new WebClient().DownloadString("https://dl.dropbox.com/s/79qs9izanj6elft/thesescripts_update.txt"));
         if (DownloadInformations.Get("version") != Application.ProductVersion)
         {
             if (MessageBox.Show(Langs.Update, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
             {
                 System.Diagnostics.Process.Start(DownloadInformations.Get("setup_download"));
             }
         }
     }
     catch (Exception ex) { Utils.ThrowException(ex); }
 }
Example #2
0
 public static void ReloadBO3Variables()
 {
     try
     {
         BlackOps3Root = RasuSettings.Get("BlackOps3Root");
         BO3_usermaps  = BlackOps3Root + "\\usermaps\\";
         BO3_Exe       = BlackOps3Root + "\\BlackOps3.exe";
     }
     catch (Exception ex) { Utils.ThrowException(ex); }
 }
Example #3
0
        public WatchFile(String name, String extension)
        {
            try
            {
                this.Name      = name;
                this.Extension = extension;
                this.Path      = Reference.PlaylistsPath + Program.mainForm.playlistsList.Text + "\\" + name;

                if (Extension != ".web")
                {
                    var player = new WindowsMediaPlayer();
                    var clip   = player.newMedia(this.Path + this.Extension);
                    this.Duration = TimeSpan.FromSeconds(clip.duration).ToString();
                }

                Rasu VideoInfo = new Rasu(this.Path + ".info");

                // Check updates
                if (VideoInfo.Get("video_file_version") != Application.ProductVersion)
                {
                    Rasu VideoInfoTemplate = new Rasu(Resources.video);
                    VideoInfo.MergeFile(VideoInfoTemplate);

                    VideoInfoTemplate.Set("video_file_version", Application.ProductVersion);

                    File.WriteAllText(VideoInfo.GetFilePath(), VideoInfoTemplate.GetFileContent());
                    VideoInfo.ReloadFile();
                }

                this.Description = VideoInfo.Get("video_description");
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(Program.mainForm, ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #4
0
        public static void refreshLang()
        {
            try
            {
                loadingLang = true;

                // Put langs into combo box
                Program.mainForm.settings_langcombo.Items.Clear();
                foreach (String langFile in Directory.GetFiles(Reference.SettingsPath, "*.lang", SearchOption.TopDirectoryOnly))
                {
                    Program.mainForm.settings_langcombo.Items.Add(Path.GetFileNameWithoutExtension(langFile));
                }

                if (!File.Exists(Reference.SettingsPath + Reference.RSettings.Get("lang") + ".lang"))
                {
                    Reference.RSettings.Set("lang", "english");
                }

                Program.mainForm.settings_langcombo.SelectedIndex = Program.mainForm.settings_langcombo.FindStringExact(Reference.RSettings.Get("lang"));
                Rasu Lang = new Rasu(Reference.SettingsPath + Reference.RSettings.Get("lang") + ".lang");

                // Label
                Program.mainForm.playlists_playlistslist.Text = Lang.Get("playlistslist") + ":";

                Program.mainForm.editplaylist_editplaylist.Text = Lang.Get("editplaylist") + ":";
                Program.mainForm.editvideo_editvideobutton.Text = Lang.Get("editvideo") + ":";

                Program.mainForm.addplaylist_addplaylist.Text = Lang.Get("addplaylist") + ":";

                Program.mainForm.addplaylist_playlistname.WaterMark   = Lang.Get("playlistname");
                Program.mainForm.editplaylist_playlistname.WaterMark  = Lang.Get("playlistname");
                Program.mainForm.editvideo_videoname.WaterMark        = Lang.Get("videoname");
                Program.mainForm.editvideo_videodescription.WaterMark = Lang.Get("videodescription");

                // Settings
                Program.mainForm.settings_advancedsettings.Text    = Lang.Get("advancedsettings");
                Program.mainForm.settings_generalsettings.Text     = Lang.Get("generalsettings");
                Program.mainForm.settings_videoplayersettings.Text = Lang.Get("videoplayersettings");
                Program.mainForm.settings_informations.Text        = Lang.Get("informations");

                Program.mainForm.settings_sortvideolisttype.Items.Clear();
                Program.mainForm.settings_sortvideolisttype.Items.Add(Lang.Get("ascending"));
                Program.mainForm.settings_sortvideolisttype.Items.Add(Lang.Get("descending"));
                Program.mainForm.settings_sortvideolisttype.SelectedIndex = Int32.Parse(Reference.RSettings.Get("sort_videos_list_type"));

                Program.mainForm.settings_lang.Text              = Lang.Get("language");
                Program.mainForm.settings_autoupdates.Text       = Lang.Get("autoupdates");
                Program.mainForm.settings_manualupdatecheck.Text = Lang.Get("manualupdatecheck");

                Program.mainForm.settings_stretchtofit.Text  = Lang.Get("stretchtofit");
                Program.mainForm.settings_sortvideolist.Text = Lang.Get("sortvideoslist");
                maxDropDownPlaylists = Lang.Get("maxdropdownplaylists");
                Program.mainForm.settings_maxdropdownplaylists.Text = maxDropDownPlaylists + " (" + int.Parse(Reference.RSettings.Get("max_dropdown_playlists")) + ")";

                Program.mainForm.settings_showfiles.Text  = Lang.Get("showfiles");
                Program.mainForm.settings_resetfiles.Text = Lang.Get("resetfiles");

                numberplaylists = Lang.Get("numberplaylists");
                Program.mainForm.settings_numberofplaylists.Text = numberplaylists + ": " + Directory.GetDirectories(Reference.PlaylistsPath).Count();
                weightplaylists = Lang.Get("weightplaylists");
                Program.mainForm.settings_weightofplaylists.Text = weightplaylists + ": " + Settings.GetPlaylistsSize();

                // Buttons
                Program.mainForm.addplaylist_addplaylistbutton.Text   = Lang.Get("addplaylist");
                Program.mainForm.editplaylist_editplaylistbutton.Text = Lang.Get("editplaylist");
                Program.mainForm.editvideo_editvideobutton.Text       = Lang.Get("editvideo");
                Program.mainForm.addplaylist_cancel.Text  = Lang.Get("cancel");
                Program.mainForm.editplaylist_cancel.Text = Lang.Get("cancel");
                Program.mainForm.editvideo_cancel.Text    = Lang.Get("cancel");

                // Tab pages
                Program.mainForm.tabAddPlaylist.Text  = Lang.Get("addplaylist");
                Program.mainForm.tabEditPlaylist.Text = Lang.Get("editplaylist");
                Program.mainForm.tabPlaylists.Text    = Lang.Get("playlists");
                Program.mainForm.tabSettings.Text     = Lang.Get("settings");

                // Variables
                playlistExist   = Lang.Get("playlistexist");
                videoExist      = Lang.Get("videoexist");
                selectVideo     = Lang.Get("selectvideo");
                selectPlaylist  = Lang.Get("selectplaylist");
                deletePlaylist  = Lang.Get("deleteplaylist");
                deleteVideo     = Lang.Get("deletevideo");
                donation        = Lang.Get("donation");
                newVersion      = Lang.Get("newversion");
                noNewVersion    = Lang.Get("nonewversion");
                errorConnection = Lang.Get("errorconnection");
                deletefiles     = Lang.Get("deletefiles");
                restartsoftware = Lang.Get("restartsoftware");
                open            = Lang.Get("open");

                // Playlist list view
                Program.mainForm.fileName.Text        = Lang.Get("filename");
                Program.mainForm.fileDescription.Text = Lang.Get("filedescription");
                Program.mainForm.fileDuration.Text    = Lang.Get("fileduration");

                // Context menu
                Program.mainForm.addPlaylistToolStripMenuItem.Text    = Lang.Get("addplaylist");
                Program.mainForm.removePlaylistToolStripMenuItem.Text = Lang.Get("removeplaylist");
                Program.mainForm.editPlaylistToolStripMenuItem.Text   = Lang.Get("editplaylist");
                Program.mainForm.exportPlaylistToolStripMenuItem.Text = Lang.Get("exportplaylist");

                Program.mainForm.playVideoToolStripMenuItem.Text   = Lang.Get("playvideo");
                Program.mainForm.addVideoToolStripMenuItem.Text    = Lang.Get("addvideo");
                Program.mainForm.removeVideoToolStripMenuItem.Text = Lang.Get("removevideo");
                Program.mainForm.editVideoToolStripMenuItem.Text   = Lang.Get("editvideo");
                Program.mainForm.exportVideoToolStripMenuItem.Text = Lang.Get("exportvideo");

                loadingLang = false;
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(Program.mainForm, ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #5
0
        public static void Translate()
        {
            loadingLang = true;

            // Implements the list of installed software languages in a list
            Reference.SettingsForm.LanguageCombo.Items.Clear();
            foreach (String lang in Directory.GetFiles(Reference.SettingsPath, "*.lang", SearchOption.TopDirectoryOnly))
            {
                Reference.SettingsForm.LanguageCombo.Items.Add(Path.GetFileNameWithoutExtension(lang));
            }

            // If the language specified in the settings does not exist, the software will load the English language
            if (!File.Exists(Reference.SettingsPath + Reference.RasuSettings.Get("lang") + ".lang"))
            {
                Reference.RasuSettings.Set("lang", "English");
            }
            // Selects the language specified in the settings
            Reference.SettingsForm.LanguageCombo.SelectedIndex = Reference.SettingsForm.LanguageCombo.FindStringExact(Reference.RasuSettings.Get("lang"));
            // Load the contents of the language file into a RASU variable
            Rasu Lang = new Rasu(Reference.SettingsPath + Reference.RasuSettings.Get("lang") + ".lang");

            #region "Main window"

            Update = Lang.Get("update");

            Operation = Lang.Get("operation");

            DoubleProcess = Lang.Get("double_process");
            BetaWelcome   = Lang.Get("beta_welcome");

            #region "ToolBar"

            // Files
            Reference.MainForm.filesToolStripMenuItem.Text               = Lang.Get("files");
            Reference.MainForm.openUsermapToolStripMenuItem.Text         = Lang.Get("open_usermap");
            Reference.MainForm.synchronizeMapFilesToolStripMenuItem.Text = Lang.Get("synchronize_map_files");
            Reference.MainForm.settingsToolStripMenuItem.Text            = Lang.Get("settings");

            // Help
            Reference.MainForm.helpToolStripMenuItem.Text        = Lang.Get("help");
            Reference.MainForm.openTheWikiToolStripMenuItem.Text = Lang.Get("open_wiki");

            #endregion

            #region "Tabpages"

            Reference.MainForm.tabMapInformations.Text = Lang.Get("map_informations");
            Reference.MainForm.tabScriptsImporter.Text = Lang.Get("scripts_importer");
            Reference.MainForm.tabOpenUserMap.Text     = Lang.Get("open_usermap");

            #endregion

            #region "tabOpenUserMap"

            WrongBO3Root = Lang.Get("wrong_bo3_root");
            Reference.MainForm.OpenUsermap_SelectMap.Text = Lang.Get("select_map");
            PleaseSelectMap = Lang.Get("please_select_map");
            Reference.MainForm.OpenUsermap_Cancel.Text = Lang.Get("cancel");
            Reference.MainForm.OpenUsermap_OK.Text     = Lang.Get("ok");

            Reference.MainForm.OpenUsermap_List.Groups[0].Header = Lang.Get("zombies_maps");
            Reference.MainForm.OpenUsermap_List.Groups[1].Header = Lang.Get("multiplayers_maps");

            #endregion

            #region "tabMapInformations"

            Reference.MainForm.MapInformations_FileName.Text = Lang.Get("file_name");
            Reference.MainForm.MapInformations_FilePath.Text = Lang.Get("file_path");

            Reference.MainForm.openTheFileLocationToolStripMenuItem.Text = Lang.Get("open_file_location");
            Reference.MainForm.openTheFileToolStripMenuItem.Text         = Lang.Get("open_file");
            Reference.MainForm.deleteFileToolStripMenuItem.Text          = Lang.Get("delete_file");

            DeleteFiles = Lang.Get("delete_files");

            #endregion

            #region "tabScriptsImporter"

            NoConnection = Lang.Get("no_connection");
            Reference.MainForm.ScriptsImporter_LocalImport.Text = Lang.Get("import_local_script_package");

            Reference.MainForm.openFileDialog.Title = Lang.Get("choose_script_package");

            Reference.MainForm.importScriptToolStripMenuItem.Text        = Lang.Get("import_script");
            Reference.MainForm.openTheOriginalLinkToolStripMenuItem.Text = Lang.Get("open_original_link");

            Reference.MainForm.ScriptsImporter_ScriptName.Text = Lang.Get("script_name");
            Reference.MainForm.ScriptsImporter_Author.Text     = Lang.Get("script_author");
            Reference.MainForm.ScriptsImporter_Version.Text    = Lang.Get("script_version");

            Reference.MainForm.ScriptsImporter_Status.Text = Lang.Get("script_status");
            Downloading = Lang.Get("downloading");
            Importing   = Lang.Get("importing");
            Completed   = Lang.Get("completed");

            Reference.MainForm.ScriptsImporter_List.Groups[0].Header = Lang.Get("not_categorized");
            Reference.MainForm.ScriptsImporter_List.Groups[1].Header = Lang.Get("powerups");
            Reference.MainForm.ScriptsImporter_List.Groups[2].Header = Lang.Get("bosses");
            Reference.MainForm.ScriptsImporter_List.Groups[3].Header = Lang.Get("perks");
            Reference.MainForm.ScriptsImporter_List.Groups[4].Header = Lang.Get("visual");
            Reference.MainForm.ScriptsImporter_List.Groups[5].Header = Lang.Get("weapons");

            #endregion

            #endregion

            #region "Settings window"

            NeedRestart = Lang.Get("needrestart");

            #region "General"

            Reference.SettingsForm.tabGeneral.Text = Lang.Get("general");

            Reference.SettingsForm.LanguageLabel.Text = Lang.Get("language") + ":";
            Reference.SettingsForm.BO3RootLabel.Text  = Lang.Get("bo3_root") + ":";

            // Miscellaneous

            Reference.SettingsForm.MiscellaneousGroupBox.Text = Lang.Get("miscellaneous");
            Reference.SettingsForm.BetaWelcomeCheck.Text      = Lang.Get("show_beta_message");

            #endregion

            #region "Advanced"

            Reference.SettingsForm.tabAdvanced.Text = Lang.Get("advanced");

            Reference.SettingsForm.TabsGroupBox.Text     = Lang.Get("pages");
            Reference.SettingsForm.ShowConsoleCheck.Text = Lang.Get("show_console");

            #endregion

            #endregion

            loadingLang = false;
        }
Example #6
0
 private void exportPlaylistToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (!String.IsNullOrEmpty(playlistsList.Text))
         {
             if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
             {
                 foreach (String path in Directory.GetFiles(Reference.PlaylistsPath + playlistsList.Text, "*.info", SearchOption.TopDirectoryOnly))
                 {
                     Rasu VideoInfo = new Rasu(path);
                     exportVideo(Path.GetFileNameWithoutExtension(path), folderBrowserDialog.SelectedPath + "\\" + Path.GetFileNameWithoutExtension(path) + VideoInfo.Get("video_extension"));
                 }
             }
         }
         else
         {
             MetroMessageBox.Show(this, Langs.selectPlaylist, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MetroMessageBox.Show(this, ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }