Example #1
0
 private void SwapGFX()
 {
     if (account.Settings.GFXFile != null)
     {
         GFXManager.UseGFX(account.Settings.GFXFile);
     }
 }
Example #2
0
        private void InitializeControls(bool reinit = false)
        {
            Texture2D back = GFXManager.TextureFromResource(GFXTypes.PreLoginUI, 24, true);

            _backButton = new XNAButton(back, new Vector2(589, 0), new Rectangle(0, 0, back.Width, back.Height / 2),
                                        new Rectangle(0, back.Height / 2, back.Width, back.Height / 2))
            {
                DrawOrder = 100
            };
            _backButton.OnClick  += MainButtonPress;
            _backButton.ClickArea = new Rectangle(4, 16, 16, 16);

            //hide all the components to start with
            foreach (IGameComponent iGameComp in Components)
            {
                DrawableGameComponent component = iGameComp as DrawableGameComponent;
                //don't hide dialogs if reinitializing
                if (reinit && (XNAControl.Dialogs.Contains(component as XNAControl) ||
                               (component as XNAControl != null && XNAControl.Dialogs.Contains((component as XNAControl).TopParent))))
                {
                    continue;
                }

                //...except for the four main buttons
                if (component != null)
                {
                    component.Visible = false;
                }
            }
        }
Example #3
0
    void Start()
    {
        stats      = PlayerManager.stats;
        gfxManager = GFXManager.instance;

        stats.onStatsChangedCallback += UpdateUI;
        UpdateUI();
    }
Example #4
0
        public bool Launch()
        {
            //if (EnableRaisingEvents == true) return false;
            EnableRaisingEvents = true;

            var AccountClient = AccountClientManager.AccountClientCollection.Where(a => a.Client == this).Single();

            if (AccountClient.Account != AccountManager.DefaultAccount)
            {
                AccountClient.Account = new Account(AccountClient.Account.Nickname, null, null);
            }

            Globals.LinkedAccs.Add(AccountClient);
            GFXManager.UseGFX(AccountClient.Account.ConfigurationPath);

            return(Start());
        }
Example #5
0
 private void Init()
 {
     if (GFXFile == null)
     {
         GFXFile = GFXManager.LoadFile(EnviromentManager.GwClientXmlPath);
     }
     if (DLLs == null)
     {
         DLLs = new ObservableCollection <string>();
     }
     if (AccHotkeys == null)
     {
         AccHotkeys = new ObservableCollection <AccountHotkey>();
     }
     if (RelaunchesMax == null)
     {
         RelaunchesMax = 0;
     }
     RelaunchesLeft = RelaunchesMax;
 }
Example #6
0
 private void RestoreGFX()
 {
     GFXManager.RestoreDefault();
 }
Example #7
0
 // Start is called before the first frame update
 void Awake()
 {
     Instance = this;
 }
Example #8
0
            public static void LoadClientInfo()
            {
                //Find the newest XML file in APPDATA (the XML files share the same name as their XML files -> multiple .xml files possible!)
                string[] configfiles = new string[] { };
                try
                {
                    configfiles = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Guild Wars 2\", "*.exe.xml");
                }
                catch (Exception e)
                {
                    //TODO: Handle corrupt/missing Guild Wars install
                    MessageBox.Show("Guild Wars may not be installed. \n " + e.Message);
                    return;
                }
                Globals.ClientXmlpath = "";
                long max = 0;

                foreach (string config in configfiles)
                {
                    if (System.IO.File.GetLastWriteTime(config).Ticks > max)
                    {
                        max = System.IO.File.GetLastWriteTime(config).Ticks;
                        Globals.ClientXmlpath = config;
                    }
                }

                //Read the GFX Settings
                Globals.SelectedGFX = GFXManager.ReadFile(Globals.ClientXmlpath);
                //lv_gfx.ItemsSource = Globals.SelectedGFX.Config;
                //lv_gfx.Items.Refresh();

                // Read the XML file
                try
                {
                    //if (Properties.Settings.Default.use_reshade) cb_reshade.IsChecked = true;

                    StreamReader  stream = new System.IO.StreamReader(Globals.ClientXmlpath);
                    XmlTextReader reader = null;
                    reader = new XmlTextReader(stream);

                    while (reader.Read())
                    {
                        switch (reader.Name)
                        {
                        case "VERSIONNAME":
                            Regex filter = new Regex(@"\d*\d");
                            Version = filter.Match(reader.GetValue()).Value;
                            //lab_version.Content = "Client Version: " + ClientManager.ClientInfo.Version;
                            break;

                        case "INSTALLPATH":
                            InstallPath = reader.GetValue();
                            //lab_path.Content = "Install Path: " + ClientManager.ClientInfo.InstallPath;
                            break;

                        case "EXECUTABLE":
                            Executable = reader.GetValue();
                            //lab_path.Content += ClientManager.ClientInfo.Executable;
                            break;

                        case "EXECCMD":
                            //Filter arguments from path
                            //lab_para.Content = "Latest Start Parameters: ";
                            Regex           regex     = new Regex(@"(?<=^|\s)-(umbra.(\w)*|\w*)");
                            string          input     = reader.GetValue();
                            MatchCollection matchList = regex.Matches(input);

                            foreach (Argument argument in ArgumentManager.ArgumentCollection)
                            {
                                foreach (Match parameter in matchList)
                                {
                                    if (argument.Flag == parameter.Value && !argument.Blocker)
                                    {
                                        AccountArgumentManager.StopGap.IsSelected(parameter.Value, true);
                                    }
                                }
                            }

                            //RefreshUI();
                            break;
                        }
                    }
                }
                catch
                {
                    MessageBox.Show("Gw2 info file not found! Please choose the directory manually!");
                }
            }
Example #9
0
 void Start()
 {
     gfxManager = GFXManager.instance;
 }
Example #10
0
 void Awake()
 {
     instance = this;
     SetUpRefs();
 }