Front end for the Link Cable status bar icon

This commit is contained in:
adelikat 2014-08-23 01:18:59 +00:00
parent 7b03f11091
commit 56384da18b
8 changed files with 415 additions and 340 deletions

View File

@ -1480,6 +1480,7 @@
<None Include="config\ControllerImages\GENController.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\noconnect_16x16.png" />
<None Include="images\snes9x.png" />
<None Include="images\YellowUp.png" />
<None Include="images\YellowRight.png" />
@ -1602,6 +1603,7 @@
<None Include="images\dual.png" />
<None Include="config\ControllerImages\WonderSwanColor.png" />
<None Include="images\alt_about_image.png" />
<None Include="images\connect_16x16.png" />
<Content Include="images\logo.ico" />
<None Include="images\Paste.png" />
<None Include="images\reboot.png" />

File diff suppressed because it is too large Load Diff

View File

@ -54,12 +54,15 @@ namespace BizHawk.Client.EmuHawk
RebootStatusBarIcon.Visible = false;
StatusBarDiskLightOnImage = Properties.Resources.LightOn;
StatusBarDiskLightOffImage = Properties.Resources.LightOff;
LinkCableOn = Properties.Resources.connect_16x16;
LinkCableOff = Properties.Resources.noconnect_16x16;
UpdateCoreStatusBarButton();
if (Global.Config.FirstBoot == true)
{
ProfileFirstBootLabel.Visible = true;
}
HandleToggleLightAndLink();
}
static MainForm()
@ -1213,6 +1216,7 @@ namespace BizHawk.Client.EmuHawk
// Resources
Bitmap StatusBarDiskLightOnImage, StatusBarDiskLightOffImage;
Bitmap LinkCableOn, LinkCableOff;
#endregion
@ -1272,7 +1276,7 @@ namespace BizHawk.Client.EmuHawk
private void UpdateToolsAfter(bool fromLua = false)
{
GlobalWin.Tools.UpdateToolsAfter(fromLua);
HandleToggleLight();
HandleToggleLightAndLink();
}
public void UpdateDumpIcon()
@ -2252,7 +2256,7 @@ namespace BizHawk.Client.EmuHawk
}
}
private void HandleToggleLight()
private void HandleToggleLightAndLink()
{
if (MainStatusBar.Visible)
{
@ -2274,6 +2278,25 @@ namespace BizHawk.Client.EmuHawk
LedLightStatusLabel.Visible = false;
}
}
if (Global.Emulator.CoreComm.UsesLinkCable)
{
if (!LinkConnectStatusBarButton.Visible)
{
LinkConnectStatusBarButton.Visible = true;
}
LinkConnectStatusBarButton.Image = Global.Emulator.CoreComm.LinkConnected
? LinkCableOn
: LinkCableOff;
}
else
{
if (LinkConnectStatusBarButton.Visible)
{
LinkConnectStatusBarButton.Visible = false;
}
}
}
}
@ -2445,6 +2468,9 @@ namespace BizHawk.Client.EmuHawk
CoreNameStatusBarButton.Text = Global.Emulator.DisplayName();
CoreNameStatusBarButton.Image = Global.Emulator.Icon();
CoreNameStatusBarButton.ToolTipText = attributes.Ported ? "(ported) " : string.Empty;
// Let's also do the link icon here too since they both would be updated under the same circumstances
}
#endregion
@ -3411,5 +3437,10 @@ namespace BizHawk.Client.EmuHawk
}
#endregion
private void LinkConnectStatusBarButton_Click(object sender, EventArgs e)
{
// TODO: it would be cool if clicking this toggled the state
}
}
}

View File

@ -310,6 +310,16 @@ namespace BizHawk.Client.EmuHawk.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap connect_16x16 {
get {
object obj = ResourceManager.GetObject("connect_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -830,6 +840,16 @@ namespace BizHawk.Client.EmuHawk.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap noconnect_16x16 {
get {
object obj = ResourceManager.GetObject("noconnect_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>

View File

@ -957,4 +957,10 @@
<data name="snes9x" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\snes9x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="connect_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\connect_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="noconnect_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\noconnect_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

View File

@ -48,6 +48,9 @@ namespace BizHawk.Emulation.Common
public bool DriveLED = false;
public bool UsesDriveLed = false;
public bool LinkConnected = false;
public bool UsesLinkCable = false;
/// <summary>
/// show a message. reasonably annoying (dialog box), shouldn't be used most of the time
/// </summary>