Ejemplo n.º 1
0
        public WinColor(MainWindow in_main)
        {
            InitializeComponent();

            Config = new IniFile("./boby_add_file.ini");

            tb_red.Text = Config.IniReadValue("boby", "red");
            tb_green.Text = Config.IniReadValue("boby", "green");
            tb_blue.Text = Config.IniReadValue("boby", "blue");

            if (tb_red.Text == "")
                tb_red.Text = "255";
            if (tb_green.Text == "")
                tb_green.Text = "0";
            if (tb_blue.Text == "")
                tb_blue.Text = "0";
            if (Convert.ToInt32(tb_red.Text.Trim()) > 255)
                tb_red.Text = "255";
            if (Convert.ToInt32(tb_green.Text.Trim()) > 255)
                tb_green.Text = "255";
            if (Convert.ToInt32(tb_blue.Text.Trim()) > 255)
                tb_blue.Text = "255";

            var bc = new BrushConverter();
            rt_color.Fill = (Brush)bc.ConvertFrom("#FF" + Convert.ToInt32(tb_red.Text.Trim()).ToString("X2") + Convert.ToInt32(tb_green.Text.Trim()).ToString("X2") + Convert.ToInt32(tb_blue.Text.Trim()).ToString("X2"));
            in_main_win = in_main;
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            if (!File.Exists(System.Windows.Forms.Application.StartupPath + "\\Gibbed.Aion.ConvertXml.exe"))
            {
                byte[] Gibbed_Aion_ConvertXml = Properties.Resources.Gibbed_Aion_ConvertXml;
                File.WriteAllBytes(System.Windows.Forms.Application.StartupPath + "\\Gibbed.Aion.ConvertXml.exe", Gibbed_Aion_ConvertXml);
            }

            if (!File.Exists(System.Windows.Forms.Application.StartupPath + "\\Gibbed.Aion.FileFormats.dll"))
            {
                byte[] Gibbed_Aion_FileFormats = Properties.Resources.Gibbed_Aion_FileFormats;
                File.WriteAllBytes(System.Windows.Forms.Application.StartupPath + "\\Gibbed.Aion.FileFormats.dll", Gibbed_Aion_FileFormats);
            }

            if (!File.Exists(System.Windows.Forms.Application.StartupPath + "\\Gibbed.Helpers.dll"))
            {
                byte[] Gibbed_Helpers = Properties.Resources.Gibbed_Helpers;
                File.WriteAllBytes(System.Windows.Forms.Application.StartupPath + "\\Gibbed.Helpers.dll", Gibbed_Helpers);
            }

            if (!File.Exists(System.Windows.Forms.Application.StartupPath + "\\pak2zip.exe"))
            {
                byte[] pak2zip = Properties.Resources.pak2zip;
                File.WriteAllBytes(System.Windows.Forms.Application.StartupPath + "\\pak2zip.exe", pak2zip);
            }

            InitializeComponent();
            in_Win_Main = this;

            IniFile Config = new IniFile("./boby_add_file.ini");

            string path = Config.IniReadValue("boby", "path");
            string type = Config.IniReadValue("boby", "type");
            string other = Config.IniReadValue("boby", "other");
            string lang = Config.IniReadValue("boby", "lang");

            if (VerifPathAion(path))
            {
                g_path = path;
            }
            else if (VerifPathAion(VerifRegAion()))
            {
                g_path = VerifRegAion();
                Config.IniWriteValue("boby", "path", g_path);
            }

            if (type == "NC")
            {
                rb_NC.IsChecked = true;
            }
            else
            {
                rb_GF.IsChecked = true;
            }

            if (other != "")
                tb_other.Text = other.Replace("<br/>", "\n");
            else
                tb_other.Text = "-ncping -noweb -noauthgg -st\n-charnamemenu -litelauncher\n-ingamebrowser -webshopevent:0\n-f2p -lbox";

            if (g_path != "")
            {
                List<string> dirs = new List<string>(Directory.EnumerateDirectories(g_path + @"\L10N"));

                List<string> dir_name_list = new List<string>();

                foreach (var dir in dirs)
                {
                    string dir_name = dir.Substring(dir.LastIndexOf("\\") + 1);
                    dir_name_list.Add(dir_name);
                }

                this.cb_lang.ItemsSource = dir_name_list;

                if (lang != "" && dir_name_list.Contains(lang))
                    this.cb_lang.SelectedItem = lang;
                else
                    this.cb_lang.SelectedIndex = 0;
            }

            VerifOption();
            start = false;
        }