2 using System.Windows.Forms;
5 namespace DirectOutput.Frontend
16 this.Pinball = Pinball;
17 InitializeComponent();
19 Version V = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
20 DateTime BuildDate =
new DateTime(2000, 1, 1).AddDays(V.Build).AddSeconds(V.Revision * 2);
22 Version.Text =
"Version {0} as of {1}".Build(V.ToString(), BuildDate.ToString(
"yyyy.MM.dd HH:mm"));
24 TableName.Text = (Pinball.
Table.TableName.IsNullOrWhiteSpace() ?
"<No table name set>" : Pinball.
Table.TableName);
25 TableFilename.Text = (Pinball.
Table.TableFilename.IsNullOrWhiteSpace() ?
"<No table file name set>" : Pinball.
Table.TableFilename);
26 TableRomname.Text = (Pinball.
Table.RomName.IsNullOrWhiteSpace() ?
"<No rom name set>" : Pinball.
Table.RomName);
29 GlobalConfigFilename.Text = (Pinball.
GlobalConfig.GlobalConfigFilename.IsNullOrWhiteSpace() ?
"<no global config file set>" : (Pinball.
GlobalConfig.GetGlobalConfigFile().Exists ? Pinball.
GlobalConfig.GlobalConfigFilename :
"<no global config file found>"));
32 switch (Pinball.
Table.ConfigurationSource)
34 case DirectOutput.Table.TableConfigSourceEnum.TableConfigurationFile:
35 TableConfigFilename.Text = Pinball.
Table.TableConfigurationFilename;
37 case DirectOutput.Table.TableConfigSourceEnum.IniFile:
38 TableConfigFilename.Text =
"Table config parsed from LedControl file.";
41 TableConfigFilename.Text =
"<no config file loaded>";
46 if (Pinball.
Cabinet.CabinetConfigurationFilename.IsNullOrWhiteSpace())
48 CabinetConfigFilename.Text =
"<no config file loaded>";
52 CabinetConfigFilename.Text = Pinball.
Cabinet.CabinetConfigurationFilename;
58 public static void Open(Pinball Pinball, Form Owner=null)
62 foreach (Form F
in Application.OpenForms)
80 M.StartPosition = FormStartPosition.CenterParent;
85 private void ShowCabinetConfiguration_Click(
object sender, EventArgs e)
87 foreach (Form F
in Application.OpenForms)
96 CabinetInfo CI =
new CabinetInfo(Pinball.
Cabinet);
97 CI.StartPosition = FormStartPosition.CenterParent;
102 private void ShowTableConfiguration_Click(
object sender, EventArgs e)
104 foreach (Form F
in Application.OpenForms)
106 if (F.GetType() == typeof(TableInfo))
113 TableInfo CI =
new TableInfo(Pinball);
114 CI.StartPosition = FormStartPosition.CenterParent;
118 private void EditGlobalConfiguration_Click(
object sender, EventArgs e)
120 foreach (Form F
in Application.OpenForms)
122 if (F.GetType() == typeof(GlobalConfigEdit))
129 GlobalConfigEdit CI =
new GlobalConfigEdit();
130 CI.StartPosition = FormStartPosition.CenterParent;
134 private void ShowLoadedScripts_Click(
object sender, EventArgs e)
136 foreach (Form F
in Application.OpenForms)
138 if (F.GetType() == typeof(ScriptInfo))
145 ScriptInfo CI =
new ScriptInfo(Pinball);
146 CI.StartPosition = FormStartPosition.CenterParent;
150 private void button1_Click(
object sender, EventArgs e)
152 foreach (Form F
in Application.OpenForms)
154 if (F.GetType() == typeof(AvailableToysInfo))
161 AvailableToysInfo CI =
new AvailableToysInfo();
162 CI.StartPosition = FormStartPosition.CenterParent;
166 private void button2_Click(
object sender, EventArgs e)
168 foreach (Form F
in Application.OpenForms)
170 if (F.GetType() == typeof(AvailableEffectsInfo))
177 AvailableEffectsInfo CI =
new AvailableEffectsInfo();
178 CI.StartPosition = FormStartPosition.CenterParent;
182 private void ShowSystemMonitor_Click(
object sender, EventArgs e)
184 foreach (Form F
in Application.OpenForms)
186 if (F.GetType() == typeof(SystemMonitor))
193 SystemMonitor CI =
new SystemMonitor(Pinball);
194 CI.StartPosition = FormStartPosition.CenterParent;