public Wzd_NewEmu_Config2(Emulator emu) { InitializeComponent(); this.Emulator = emu; }
public void SetGUIProperties() { Dictionary <string, string> guiProperties = getProps(); Emulator emu = associatedEmulator; Game game = associatedGame; if (isFavourites || IsGroup) { guiProperties["#Emulators2.CurrentItem.title"] = Label; } else if (emu != null) { guiProperties["#Emulators2.CurrentItem.isemulator"] = "yes"; guiProperties["#Emulators2.CurrentItem.isgame"] = "no"; guiProperties["#Emulators2.CurrentItem.title"] = emu.Title; guiProperties["#Emulators2.CurrentItem.grade"] = emu.Grade.ToString(); guiProperties["#Emulators2.CurrentItem.description"] = emu.Description; guiProperties["#Emulators2.CurrentItem.company"] = emu.Company; guiProperties["#Emulators2.CurrentItem.year"] = emu.Year > 0 ? emu.Year.ToString() : ""; guiProperties["#Emulators2.CurrentItem.caseaspect"] = emu.CaseAspect.ToString(System.Globalization.CultureInfo.InvariantCulture); guiProperties["#Emulators2.CurrentItem.isarcade"] = emu.IsArcade.ToString(); } else if (game != null) { guiProperties["#Emulators2.CurrentItem.isemulator"] = "no"; guiProperties["#Emulators2.CurrentItem.isgame"] = "yes"; guiProperties["#Emulators2.CurrentItem.goodmerge"] = game.IsGoodmerge ? "yes" : "no"; guiProperties["#Emulators2.CurrentItem.isgoodmerge"] = game.IsGoodmerge.ToString(); guiProperties["#Emulators2.CurrentItem.title"] = game.Title; guiProperties["#Emulators2.CurrentItem.coverflowlabel"] = string.IsNullOrEmpty(Label2) ? game.ParentEmulator.ToString() : Label2; guiProperties["#Emulators2.CurrentItem.emulatortitle"] = game.ParentEmulator.Title; guiProperties["#Emulators2.CurrentItem.grade"] = game.Grade.ToString(); guiProperties["#Emulators2.CurrentItem.description"] = game.Description; guiProperties["#Emulators2.CurrentItem.year"] = game.Yearmade > 0 ? game.Yearmade.ToString() : ""; guiProperties["#Emulators2.CurrentItem.genre"] = game.Genre; guiProperties["#Emulators2.CurrentItem.company"] = game.Company; guiProperties["#Emulators2.CurrentItem.caseaspect"] = game.ParentEmulator.CaseAspect.ToString(System.Globalization.CultureInfo.InvariantCulture); guiProperties["#Emulators2.CurrentItem.isarcade"] = game.ParentEmulator.IsArcade.ToString(); if (game.Latestplay.CompareTo(DateTime.MinValue) == 0) { guiProperties["#Emulators2.CurrentItem.latestplaydate"] = Translator.Instance.never; guiProperties["#Emulators2.CurrentItem.latestplaytime"] = ""; } else { guiProperties["#Emulators2.CurrentItem.latestplaydate"] = game.Latestplay.ToShortDateString(); guiProperties["#Emulators2.CurrentItem.latestplaytime"] = game.Latestplay.ToShortTimeString(); } guiProperties["#Emulators2.CurrentItem.playcount"] = game.Playcount.ToString(); guiProperties["#Emulators2.CurrentItem.favourite"] = game.Favourite ? "yes" : "no"; guiProperties["#Emulators2.CurrentItem.isfavourite"] = game.Favourite.ToString(); if (game.CurrentDiscNum < 2) { guiProperties["#Emulators2.CurrentItem.currentdisc"] = "1"; } else { guiProperties["#Emulators2.CurrentItem.currentdisc"] = game.CurrentDiscNum.ToString(); } guiProperties["#Emulators2.CurrentItem.totaldiscs"] = game.Discs.Count.ToString(); guiProperties["#Emulators2.CurrentItem.path"] = game.Path; guiProperties["#Emulators2.CurrentItem.selectedgoodmerge"] = game.CurrentDisc.LaunchFile; guiProperties["#Emulators2.CurrentItem.Profile.title"] = game.CurrentProfile.Title; guiProperties["#Emulators2.CurrentItem.Profile.emulatorpath"] = game.CurrentProfile.EmulatorPath; guiProperties["#Emulators2.CurrentItem.Profile.arguments"] = game.CurrentProfile.Arguments; guiProperties["#Emulators2.CurrentItem.Profile.workingdirectory"] = game.CurrentProfile.WorkingDirectory; guiProperties["#Emulators2.CurrentItem.Profile.suspendmp"] = (game.CurrentProfile.SuspendMP == true).ToString(); guiProperties["#Emulators2.CurrentItem.Profile.usequotes"] = (game.CurrentProfile.UseQuotes == true).ToString(); guiProperties["#Emulators2.CurrentItem.Profile.mountimages"] = game.CurrentProfile.MountImages.ToString(); guiProperties["#Emulators2.CurrentItem.Profile.escapetoexit"] = game.CurrentProfile.EscapeToExit.ToString(); guiProperties["#Emulators2.CurrentItem.Profile.checkcontroller"] = game.CurrentProfile.CheckController.ToString(); guiProperties["#Emulators2.CurrentItem.Profile.launchedexe"] = game.CurrentProfile.LaunchedExe; } foreach (KeyValuePair <string, string> prop in guiProperties) { GUIPropertyManager.SetProperty(prop.Key, prop.Value); } }
public Wzd_NewEmu_Start(Emulator emu) { InitializeComponent(); this.Emulator = emu; }
//Updates the panels with the selected Emulator's details. private void setEmulatorToPanel(ListViewItem listViewItem) { //reset status flags saveSelectedEmulator = false; saveThumbs = false; saveProfile = false; //get the selected Emulator Emulator dbEmu = listViewItem.Tag as Emulator; selectedEmulator = dbEmu; if (dbEmu == null) { return; } allowChangedEvents = false; int index = platformComboBox.FindStringExact(dbEmu.PlatformTitle); if (index < 0) { index = 0; } if (index < platformComboBox.Items.Count) { platformComboBox.SelectedItem = platformComboBox.Items[index]; } txt_Title.Text = dbEmu.Title; romDirTextBox.Text = dbEmu.PathToRoms; filterTextBox.Text = dbEmu.Filter; isArcadeCheckBox.Checked = dbEmu.IsArcade; txt_company.Text = dbEmu.Company; txt_yearmade.Text = dbEmu.Year.ToString(); txt_description.Text = dbEmu.Description; gradeUpDown.Value = dbEmu.Grade; EmuSettingsAutoFill.SetupAspectDropdown(thumbAspectComboBox, dbEmu.CaseAspect); videoTextBox.Text = dbEmu.VideoPreview; idLabel.Text = dbEmu.UID.ToString(); if (emuThumbs != null) { emuThumbs.Dispose(); } emuThumbs = new ThumbGroup(dbEmu); if (mainTabControl.SelectedTab == thumbsTabPage) { setGameArt(emuThumbs); thumbsLoaded = true; } else { setGameArt(null); thumbsLoaded = false; } txt_Manual.Text = emuThumbs.ManualPath; selectedProfile = null; profileComboBox.Items.Clear(); foreach (EmulatorProfile profile in DB.Instance.GetProfiles(selectedEmulator)) { profileComboBox.Items.Add(profile); if (profile.IsDefault) { profileComboBox.SelectedItem = profile; selectedProfile = profile; } } allowChangedEvents = true; profileComboBox_SelectedIndexChanged(profileComboBox, new EventArgs()); }