void ReDraw() { Ctrl.Controls.Clear(); Bitmap icon = ImageSystemIconForm.MusicIcon(12); U.MakeTransparent(icon); bool isFirst = true; int y = PADDING; int x = PADDING; foreach (Work work in WorkList) { if (x + (BUTTON_WIDTH) >= this.Width) { x = PADDING; y += CELL_HEIGHT; } if (work.IsUpdateMark) { PictureBox pic = new PictureBox(); pic.Image = icon; pic.SizeMode = PictureBoxSizeMode.StretchImage; pic.Size = new System.Drawing.Size(32, 32); pic.Location = new Point(x + BUTTON_WIDTH - 24, y + BUTTON_HEIGHT - 24); pic.Tag = work; pic.Click += ToolAllWorkSupportForm_ClickTitle; Ctrl.Controls.Add(pic); } Button b = new Button(); b.BackgroundImageLayout = ImageLayout.Stretch; b.BackgroundImage = ToolWorkSupportForm.MakeLogoLow(work.LogoFilename, work.ROMFilenme); b.Size = new System.Drawing.Size(BUTTON_WIDTH, BUTTON_HEIGHT); b.Location = new Point(x, y); b.Tag = work; b.Click += ToolAllWorkSupportForm_ClickTitle; Ctrl.Controls.Add(b); Label l = new Label(); l.Text = work.Name; l.Size = new System.Drawing.Size(BUTTON_WIDTH, FONT_HIGHT); l.Location = new Point(x, y + BUTTON_HEIGHT + PADDING); l.TextAlign = ContentAlignment.MiddleCenter; l.Tag = work; l.DoubleClick += ToolAllWorkSupportForm_ClickTitle; Ctrl.Controls.Add(l); if (isFirst) { isFirst = false; b.Focus(); } x += CELL_WIDTH; } }
void UpdateCheck() { foreach (Work work in WorkList) { ToolWorkSupportForm.UPDATE_RESULT ur = ToolWorkSupportForm.CheckUpdateLow(work.UpdateinfoLines, work.ROMFilenme, isSlientMode: true); if (ur == ToolWorkSupportForm.UPDATE_RESULT.UPDATEABLE) { work.IsUpdateMark = true; } else { work.IsUpdateMark = false; } } }
static public void CheckUpdateSlientByThread() { if (Program.ROM == null) { return; } if (Program.ROM.IsVirtualROM) {//仮想ROMは更新できない return; } ToolWorkSupportForm f = (ToolWorkSupportForm)InputFormRef.JumpFormLow <ToolWorkSupportForm>(); f.IsSlientMode = true; f.CheckUpdateSlientMain(Program.ROM.Filename); }
void ReloadWorks() { WorkList = new List <Work>(); string etcDir = Path.Combine(Program.BaseDirectory, "config", "etc"); string[] files = U.Directory_GetFiles_Safe(etcDir, "worksupport_.txt", SearchOption.AllDirectories); foreach (string filename in files) { Dictionary <uint, string> etc = U.LoadTSVResource1(filename, false); string romfilename = U.at(etc, 0); if (!File.Exists(romfilename)) { continue; } string updateinfo_filename = ToolWorkSupportForm.GetUpdateInfo(romfilename); if (!File.Exists(updateinfo_filename)) { continue; } Dictionary <string, string> updateinfo = ToolWorkSupportForm.LoadUpdateInfo(updateinfo_filename); Work w = new Work(); w.ROMFilenme = romfilename; w.UpdateinfoLines = updateinfo; if (updateinfo.ContainsKey("NAME")) { w.Name = U.at(updateinfo, "NAME"); } else { w.Name = Path.GetFileNameWithoutExtension(romfilename); } if (updateinfo.ContainsKey("LOGO_FILENAME")) { w.LogoFilename = Path.Combine(Path.GetDirectoryName(romfilename), U.at(updateinfo, "LOGO_FILENAME")); } else { w.LogoFilename = ""; } w.IsUpdateMark = false; WorkList.Add(w); } }
static public void CheckUpdateSlientByThread() { if (Program.ROM == null) { return; } if (Program.ROM.IsVirtualROM) {//仮想ROMは更新できない return; } if (UpdateCheck.IsAutoUpdateTime() || InputFormRef.GetForm <ToolUpdateDialogForm>() != null) {//FEBuilderGBAの更新があるので、今は自動確認してはいけない。 return; } ToolWorkSupportForm f = (ToolWorkSupportForm)InputFormRef.JumpFormLow <ToolWorkSupportForm>(); f.IsSlientMode = true; f.CheckUpdateSlientMain(Program.ROM.Filename); }