Example #1
0
        public Form1()
        {
            InitializeComponent();

            //LayoutPatch.CreateTestTemplates();
            //PatchTemplate.BuildTemplateFile();
            Templates.AddRange(DefaultTemplates.templates);
            if (File.Exists("ExtraTemplates.json"))
            {
                Templates.AddRange(PatchTemplate.LoadTemplates());
            }
            if (Directory.Exists("Layouts"))
            {
                foreach (var f in Directory.GetFiles("Layouts").Where(x => x.EndsWith(".json")))
                {
                    Layouts.Add(f, LayoutPatch.LoadTemplate(File.ReadAllText(f)));
                }
            }

            HomeMenuPartBox.Items.AddRange(HomeMenuParts.Keys.ToArray());
            HomeMenuPartBox.SelectedIndex = 0;
            HomeMenuPartBox_SelectedIndexChanged(null, null);

            LoadFileText   = SwitchThemesCommon.GeneratePatchListString(Templates);
            tbPatches.Text = "(To dump the following files check the guide at https://git.io/fxdyF )\r\n" + LoadFileText;
        }
Example #2
0
        public Form1()
        {
            MaterialSkin.MaterialSkinManager.Instance.Theme = MaterialSkin.MaterialSkinManager.Themes.DARK;
            InitializeComponent();

            //LayoutPatch.CreateTestTemplates();
            //PatchTemplate.BuildTemplateFile();
            Templates.AddRange(DefaultTemplates.templates);
            if (File.Exists("ExtraTemplates.json"))
            {
                Templates.AddRange(PatchTemplate.LoadTemplates());
            }
            if (Directory.Exists("Layouts"))
            {
                foreach (var f in Directory.GetFiles("Layouts").Where(x => x.EndsWith(".json")))
                {
                    Layouts.Add(f, LayoutPatch.LoadTemplate(File.ReadAllText(f)));
                }
            }

            HomeMenuPartBox.Items.AddRange(HomeMenuParts.Keys.ToArray());
            HomeMenuPartBox.SelectedIndex = 0;
            HomeMenuPartBox_SelectedIndexChanged(null, null);

            LoadFileText    = SwitchThemesCommon.GeneratePatchListString(Templates);
            tbPatches.Text += LoadFileText;
        }
Example #3
0
        public Form1()
        {
            InitializeComponent();
            PatchLabelText = materialLabel3.Text;

            //LayoutPatch.CreateTestTemplates();
            //PatchTemplate.BuildTemplateFile();
            Templates.AddRange(DefaultTemplates.templates);
            if (File.Exists("ExtraTemplates.json"))
            {
                Templates.AddRange(PatchTemplate.LoadTemplates());
            }
            if (Directory.Exists("Layouts"))
            {
                foreach (var f in Directory.GetFiles("Layouts").Where(x => x.EndsWith(".json")))
                {
                    Layouts.Add(f, LayoutPatch.LoadTemplate(File.ReadAllText(f)));
                }
            }

            LoadFileText   = SwitchThemesCommon.GeneratePatchListString(Templates);
            tbPatches.Text = "(To dump the following files check the guide at https://git.io/fxdyF )\r\n" + LoadFileText;

            if (!File.Exists("hactool\\hactool.exe") || !File.Exists("hactool\\keys.dat"))
            {
                materialTabControl1.TabPages.Remove(NCADumpPage);
            }
        }
Example #4
0
        public static void OnLoad()
        {
#if DEBUG
            Document.GetElementById <HTMLDivElement>("DebugFlag").Hidden = false;
#endif
            topError        = Document.GetElementById <HTMLDivElement>("D_JsWarn");
            topError.Hidden = true;
            Document.GetElementById <HTMLParagraphElement>("P_Version").TextContent = "Switch theme injector online - Version : " + AppVersion + " - Core version : " + SwitchThemesCommon.CoreVer;
            string useragent = Window.Navigator.UserAgent.ToLower();
            if (useragent.Contains("msie") || useragent.Contains("trident"))
            {
                Document.GetElementById <HTMLDivElement>("D_IeWarn").Hidden = false;
            }

            loader          = Document.GetElementById <HTMLDivElement>("loaderDiv");
            LoaderText      = Document.GetElementById <HTMLParagraphElement>("LoadingText");
            lblDetected     = Document.GetElementById <HTMLParagraphElement>("P_DetectedSZS");
            lblDDSPath      = Document.GetElementById <HTMLParagraphElement>("P_DDSPath");
            lblDDSPath_NX   = Document.GetElementById <HTMLParagraphElement>("P_DDSPath2");
            LayoutsComboBox = Document.GetElementById <HTMLSelectElement>("LayoutsBox");
            LayoutPrevDiv   = Document.GetElementById <HTMLDivElement>("PreviewDiv");
            LayoutPrevImg   = Document.GetElementById <HTMLImageElement>("PreviewImg");

            HomePartBox_NX     = Document.GetElementById <HTMLSelectElement>("HomePartBox");
            LayoutsComboBox_NX = Document.GetElementById <HTMLSelectElement>("LayoutsBox2");
            LayoutPrevDiv_NX   = Document.GetElementById <HTMLDivElement>("PreviewDiv2");
            LayoutPrevImg_NX   = Document.GetElementById <HTMLImageElement>("PreviewImg2");

            Document.GetElementById <HTMLParagraphElement>("P_PatchList").InnerHTML = SwitchThemesCommon.GeneratePatchListString(DefaultTemplates.templates).Replace("\r\n", "<br />");

            LoadCustomLayouts();
        }