Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            OnIntro(null, null);
            ErrorGrid.Visibility = Visibility.Hidden;
            laucherSettings      = new LauncherSettings();
            #region background iniciator
            string[] files = Directory.GetFiles("./data/images/background/");
            for (int f_i = 0; f_i < files.Length; f_i++)
            {
                _lstImages.Add(new BitmapImage(new Uri(files[f_i].Replace("./data", "pack://siteoforigin:,,,/data"))));
            }

            Bg1.Source    = _lstImages[_intCurrentImageIndex];
            _tmr.Interval = new TimeSpan(0, 1, 0);
            _tmr.Tick    += new EventHandler(Timer_Tick);
            _tmr.Start();
            #endregion
            #region Updater
            _updater.Interval = new TimeSpan(0, 0, 1);
            _updater.Tick    += new EventHandler(Auto_update_1sec);
            _updater.Start();
            #endregion
            CheckAllErrors();
            LoadAllSettings();
            #region allow external links to be execute in webbrowser
            creatorsWebpage.RequestNavigate += (sender, e) =>
            {
                System.Diagnostics.Process.Start(e.Uri.ToString());
            };
            #endregion
        }
Exemplo n.º 2
0
 private void LoadAllSettings()
 {
     laucherSettings      = new LauncherSettings();
     serverSettings       = new ServerSettings(System.IO.Path.Combine(laucherSettings.GetServerLocation(), "data"));
     ProfileSettings      = new ProfileSettings(Path.Combine(laucherSettings.GetServerLocation(), "data/profiles"));
     LoginBackendURL.Text = laucherSettings.GetBackendURL();
     Port.Text            = serverSettings.GetServerPort();
 }
Exemplo n.º 3
0
 /*******************************
  *  this is ou main function
  * /********************************/
 public main()
 {
     InitializeComponent();
     myState.changeButtonState(LauncherState.Idle, this);
     this.Shown          += new System.EventHandler(this.AfterLoading);
     LauncherVersion.Text = this.Text + " Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString();
     XmlParser.LoadXML();
     settingsForm = new LauncherSettings(this);
 }
Exemplo n.º 4
0
 private bool loadLauncherSettings()
 {
     if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "LauncherSettings.dat"))
     {
         BinaryFormatter binFormat = new BinaryFormatter();
         using (Stream fStream = File.OpenRead("LauncherSettings.dat"))
         {
             launchSettings =
                 (LauncherSettings)binFormat.Deserialize(fStream);
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 5
0
 private void LoadAllSettings()
 {
     laucherSettings          = new LauncherSettings();
     BackendIP.Text           = laucherSettings.LoadIP();
     Port.Text                = laucherSettings.LoadPort();
     ScreenMode.SelectedIndex = laucherSettings.GetScreenMode();
     //replace names if no error exist for client and server
     if (!ErrorHandler.isError(101))
     {
         clientWatcher.ChangeAppName(laucherSettings.GetClientFilename());
     }
     if (!ErrorHandler.isError(102))
     {
         serverWatcher.ChangeAppName(laucherSettings.GetServerFilename());
         serverSettings  = new ServerSettings(laucherSettings.GetServerLocation() + @"\");
         ProfileSettings = new ProfileSettings(laucherSettings.GetServerLocation() + @"\data\profiles");
     }
 }
Exemplo n.º 6
0
        public MainForm()
        {
            InitializeComponent();
            accountForm = new AccountsForm();

            account      = new Account();
            account.Name = "olololo";
            label2.Text += account.Name;

            loadLauncherSettings();
            if (launchSettings == null)
            {
                //set defaul val
                launchSettings = new LauncherSettings();
                launchSettings.setDefaultSettings();
                SaveLauncherSettings();
            }
            settingsForm = new SettingsForm();
        }
Exemplo n.º 7
0
 private void LoadAllSettings()
 {
     laucherSettings = new LauncherSettings();
     serverSettings  = new ServerSettings(Path.Combine(laucherSettings.GetServerLocation(), "data"));
     ProfileSettings = new ProfileSettings(Path.Combine(laucherSettings.GetServerLocation(), "data/profiles"));
 }