コード例 #1
0
 private void cancelButton_Click(object sender, RoutedEventArgs e)
 {
     OverlaySettings.loadSettings(false);
     refresh();
     deploy();
     Hide();
 }
コード例 #2
0
 private void saveButton_Click(object sender, RoutedEventArgs e)
 {
     if (deploy())
     {
         OverlaySettings.saveSettings();
         Hide();
     }
 }
コード例 #3
0
 private void Window_Closing_1(object sender, System.ComponentModel.CancelEventArgs e)
 {
     e.Cancel = true;
     if (deploy())
     {
         OverlaySettings.saveSettings();
         Hide();
     }
 }
コード例 #4
0
 private void defaultsButton_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to reset to defaults?", "GW2Stuff Overlay", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         OverlaySettings.loadSettings(true);
         refresh();
         deploy();
     }
 }
コード例 #5
0
        public MainWindow()
        {
            SetBrowserFeatureControl();



            InitializeComponent();
            // Create the interop host control.

            AppIcon = System.Drawing.Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetEntryAssembly().ManifestModule.Name);

            updater = new SharpUpdater(this);
            this.tbSystemMessages.Text = this.tbSystemMessages.Text + " [A" + this.ApplicationAssembly.GetName().Version.ToString() + "]";
            string refrate = (ConfigurationManager.AppSettings["DefaultRefresh"] == null || ConfigurationManager.AppSettings["DefaultRefresh"] == "") ? refreshrate.ToString() : ConfigurationManager.AppSettings["DefaultRefresh"];

            refreshrate = int.Parse(refrate);

            mwApiConn = new MWA.Integration.MWApiIntegrationConnector("MWApi");

            buildApiConn = new WebApiIntegrationConnector();

            ((INotifyPropertyChanged)mwApiConn).PropertyChanged +=
                new PropertyChangedEventHandler(mwApiConn_PropertyChanged);

            lwConn = new ExeIntegrationConnector("Logwarrior.exe");
            //lwConn = new LWConn("MatchCompletedPublishingTestForm.exe");

            //MatchLogger.MatchCompletedPublisher.OnMatchCompleted+= HandleMatch;



            OverlaySettings.loadSettings();
            btnLWConn.BorderBrush      = System.Windows.Media.Brushes.Transparent;
            btnLWConn.BorderThickness  = new Thickness(0, 0, 0, 0);
            btnLWConn.Background       = System.Windows.Media.Brushes.Transparent;
            btnApiConn.BorderBrush     = System.Windows.Media.Brushes.Transparent;
            btnApiConn.BorderThickness = new Thickness(0, 0, 0, 0);
            btnApiConn.Background      = System.Windows.Media.Brushes.Transparent;

            if (Properties.Settings.Default.dailyCompletionList == null)
            {
                Properties.Settings.Default.dailyCompletionList = new System.Collections.Specialized.StringCollection();
            }

            btnBuildConn_Click("", new RoutedEventArgs());


            menuItem_filters_Association.IsChecked = Properties.Settings.Default.filterAssociation;
            menuItem_filters_ShowBuilds.IsChecked  = Properties.Settings.Default.filterShowBuilds;


            if (Properties.Settings.Default.positionWidth > 0)
            {
                Width  = Properties.Settings.Default.positionWidth;
                Height = Properties.Settings.Default.positionHeight;
                Left   = Properties.Settings.Default.positionLeft;
                Top    = Properties.Settings.Default.positionTop;
            }

            getStartupInformation();


            if (tbPilotName.Text == "Pilot Name" ||
                (string.IsNullOrEmpty(Properties.Settings.Default.UserName) ||
                 Properties.Settings.Default.UserName == "Pilot Name"))
            {
                ForcePilotNameEntry();
            }
            else
            {
                InitIntegrationConnectors();
                tcMWApi.SelectedItem = TabHome;
            }
        }
コード例 #6
0
        private bool deploy()
        {
            /* Error checking */

            // Active
            FontSettings tempActiveEventTitleFont = activeEventTitleFont.fontSettings;

            if (tempActiveEventTitleFont == null)
            {
                MessageBox.Show("Invalid font setup - Active event title");
                return(false);
            }
            FontSettings tempActiveEventStatusFont = activeEventStatusFont.fontSettings;

            if (tempActiveEventStatusFont == null)
            {
                MessageBox.Show("Invalid font setup - Active event status");
                return(false);
            }
            FontSettings tempActiveEventTimerFont = activeEventTimerFont.fontSettings;

            if (tempActiveEventTimerFont == null)
            {
                MessageBox.Show("Invalid font setup - Active event timer");
                return(false);
            }

            // Window
            FontSettings tempWindowEventTitleFont = windowEventTitleFont.fontSettings;

            if (tempWindowEventTitleFont == null)
            {
                MessageBox.Show("Invalid font setup - In-Window event title");
                return(false);
            }
            FontSettings tempWindowEventStatusFont = windowEventStatusFont.fontSettings;

            if (tempWindowEventStatusFont == null)
            {
                MessageBox.Show("Invalid font setup - In-Window event status");
                return(false);
            }
            FontSettings tempWindowEventTimerFont = windowEventTimerFont.fontSettings;

            if (tempWindowEventTimerFont == null)
            {
                MessageBox.Show("Invalid font setup - In-Window event timer");
                return(false);
            }

            // Inactive
            FontSettings tempInactiveEventTitleFont = inactiveEventTitleFont.fontSettings;

            if (tempInactiveEventTitleFont == null)
            {
                MessageBox.Show("Invalid font setup - Inactive event title");
                return(false);
            }
            FontSettings tempInactiveEventStatusFont = inactiveEventStatusFont.fontSettings;

            if (tempInactiveEventStatusFont == null)
            {
                MessageBox.Show("Invalid font setup - Inactive event status");
                return(false);
            }
            FontSettings tempInactiveEventTimerFont = inactiveEventTimerFont.fontSettings;

            if (tempInactiveEventTimerFont == null)
            {
                MessageBox.Show("Invalid font setup - Inactive event timer");
                return(false);
            }

            /* Deploy new settings */

            String tempActiveEventBackgroundImage = (String)activeEventBackgroundImage.SelectedItem;

            OverlaySettings.activeEventTitleFont         = tempActiveEventTitleFont;
            OverlaySettings.activeEventStatusFont        = tempActiveEventStatusFont;
            OverlaySettings.activeEventTimerFont         = tempActiveEventTimerFont;
            OverlaySettings.activeEventBackgroundImage   = (String)activeEventBackgroundImage.SelectedItem;
            OverlaySettings.activeEventBackgroundOpacity = activeEventBackgroundOpacity.Value;
            OverlaySettings.activeEventMargins           = activeEventMargins.margins;

            String tempWindowEventBackgroundImage = (String)windowEventBackgroundImage.SelectedItem;

            OverlaySettings.windowEventTitleFont         = tempWindowEventTitleFont;
            OverlaySettings.windowEventStatusFont        = tempWindowEventStatusFont;
            OverlaySettings.windowEventTimerFont         = tempWindowEventTimerFont;
            OverlaySettings.windowEventBackgroundImage   = (String)windowEventBackgroundImage.SelectedItem;
            OverlaySettings.windowEventBackgroundOpacity = windowEventBackgroundOpacity.Value;
            OverlaySettings.windowEventMargins           = windowEventMargins.margins;

            String tempIninactiveEventBackgroundImage = (String)inactiveEventBackgroundImage.SelectedItem;

            OverlaySettings.inactiveEventTitleFont         = tempInactiveEventTitleFont;
            OverlaySettings.inactiveEventStatusFont        = tempInactiveEventStatusFont;
            OverlaySettings.inactiveEventTimerFont         = tempInactiveEventTimerFont;
            OverlaySettings.inactiveEventBackgroundImage   = (String)inactiveEventBackgroundImage.SelectedItem;
            OverlaySettings.inactiveEventBackgroundOpacity = inactiveEventBackgroundOpacity.Value;
            OverlaySettings.inactiveEventMargins           = inactiveEventMargins.margins;

            OverlaySettings.clickThroughInGame = clickThroughInGame.IsChecked.Value;
            OverlaySettings.dataServer         = (String)dataServer.SelectedItem;
            OverlaySettings.defaultWorldId     = (defaultWorld.SelectedItem == null) ? 0 : ((WorldInformation)defaultWorld.SelectedItem).worldId;
            OverlaySettings.hideTitleInGame    = hideTitleInGame.IsChecked.Value;

            OverlaySettings.raiseUpdate();
            return(true);
        }