//private System.Windows.Point mMousePos;

        public OverlayWindow()
        {
            InitializeComponent();
            hp = InterfaceSize.LoadInterfaceSize();

            Left   = System.Windows.Forms.SystemInformation.VirtualScreen.Left;
            Top    = System.Windows.Forms.SystemInformation.VirtualScreen.Top;
            Width  = System.Windows.Forms.SystemInformation.VirtualScreen.Width;
            Height = System.Windows.Forms.SystemInformation.VirtualScreen.Height;
        }
        private void treeView_SelectionChanged(object sender, RoutedPropertyChangedEventArgs <Object> e)
        {
            if (treeView.SelectedItem == null)
            {
                m_CurrentBuild = null;
                return;
            }

            // only doing this to make hotloading interface changes easier...
            m_Overlay.hp = InterfaceSize.LoadInterfaceSize();

            m_BuildName = GetBuildName();

            m_CurrentBuild = Build.LoadBuild(m_BuildName + ".xml");
            if (m_CurrentBuild != null)
            {
                var profession = Localization.Instance.GetProfession(m_CurrentBuild.profession);
                for (int ii = 0; ii < 3; ++ii)
                {
                    int specIndex = m_CurrentBuild.Specializations[ii].specIndex;

                    string interfaceName = "Small";

                    if (Config.Instance.InterfaceSize == 1)
                    {
                        interfaceName = "Normal";
                    }
                    else if (Config.Instance.InterfaceSize == 2)
                    {
                        interfaceName = "Large";
                    }
                    else if (Config.Instance.InterfaceSize == 3)
                    {
                        interfaceName = "XLarge";
                    }

                    string filePath = string.Format("Specializations{0}/{1}{2}.bmp", interfaceName, profession.name, specIndex);

                    if (m_bmpSpecializations[ii] != null)
                    {
                        m_bmpSpecializations[ii].Dispose();
                    }

                    if (File.Exists(filePath))
                    {
                        m_bmpSpecializations[ii] = new Bitmap(filePath);
                    }
                    else
                    {
                        m_bmpSpecializations[ii] = null;
                    }
                }
            }
        }
Example #3
0
 public void Default()
 {
     UseCustomTitle = false;
     CustomTitle    = string.Empty;
     // Every Windows PC has notepad pre-installed.
     UseCustomEditor  = false;
     CustomEditorPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "System32", "notepad.exe");
     // Every Windows PC has Consolas pre-installed.
     MonospacedFont            = new FontHelper.FontInfo(new FontFamily("Consolas"), FontWeights.Regular, 12);
     ScaleFactor               = 100;
     DisplayShellExecuteConOut = true;
     InterfaceSize             = InterfaceSize.Adaptive;
 }
 private void cmUseLargeInterface(object sender, RoutedEventArgs e)
 {
     Config.Instance.InterfaceSize = 2;
     m_Overlay.hp = InterfaceSize.LoadInterfaceSize();
     Config.Instance.SaveConfig();
 }