Enhance the IDriveLight interface so that custom tooltip text can be displayed

This commit is contained in:
Asnivor 2024-09-05 15:13:35 +01:00 committed by James Groom
parent 0dbc2b0c27
commit 02ecb0ad24
18 changed files with 37 additions and 0 deletions

View File

@ -2679,6 +2679,7 @@ namespace BizHawk.Client.EmuHawk
if (Emulator.HasDriveLight() && Emulator.AsDriveLight() is { DriveLightEnabled: true } diskLEDCore) if (Emulator.HasDriveLight() && Emulator.AsDriveLight() is { DriveLightEnabled: true } diskLEDCore)
{ {
LedLightStatusLabel.Image = diskLEDCore.DriveLightOn ? _statusBarDiskLightOnImage : _statusBarDiskLightOffImage; LedLightStatusLabel.Image = diskLEDCore.DriveLightOn ? _statusBarDiskLightOnImage : _statusBarDiskLightOffImage;
LedLightStatusLabel.ToolTipText = Emulator.AsDriveLight().DriveLightIconDescription;
LedLightStatusLabel.Visible = true; LedLightStatusLabel.Visible = true;
} }
else else

View File

@ -15,5 +15,10 @@
/// Gets a value indicating whether the light is currently lit /// Gets a value indicating whether the light is currently lit
/// </summary> /// </summary>
bool DriveLightOn { get; } bool DriveLightOn { get; }
/// <summary>
/// Gets a value indicating the description of the drive light icon (that will be displayed as a ToolTip on MainForm
/// </summary>
string DriveLightIconDescription { get; }
} }
} }

View File

@ -6,5 +6,7 @@ namespace BizHawk.Emulation.Cores.Calculators.Emu83
{ {
public bool DriveLightEnabled => true; public bool DriveLightEnabled => true;
public bool DriveLightOn => LibEmu83.TI83_GetLinkActive(Context); public bool DriveLightOn => LibEmu83.TI83_GetLinkActive(Context);
public string DriveLightIconDescription => "Link Activity";
} }
} }

View File

@ -189,5 +189,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public bool DriveLightOn => public bool DriveLightOn =>
(_machine?.TapeDevice != null && _machine.TapeDevice.TapeIsPlaying) (_machine?.TapeDevice != null && _machine.TapeDevice.TapeIsPlaying)
|| (_machine?.UPDDiskDevice != null && _machine.UPDDiskDevice.DriveLight); || (_machine?.UPDDiskDevice != null && _machine.UPDDiskDevice.DriveLight);
public string DriveLightIconDescription => "Disc Drive Activity";
} }
} }

View File

@ -130,6 +130,8 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
public bool DriveLightEnabled => true; public bool DriveLightEnabled => true;
public bool DriveLightOn => _machine.DiskIIController.DriveLight; public bool DriveLightOn => _machine.DiskIIController.DriveLight;
public string DriveLightIconDescription => "Disk Drive Activity LED";
private bool _nextPressed; private bool _nextPressed;
private bool _prevPressed; private bool _prevPressed;

View File

@ -6,5 +6,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
{ {
public bool DriveLightEnabled => _board != null && (_board.CartPort.DriveLightEnabled || _board.Serial.DriveLightEnabled); public bool DriveLightEnabled => _board != null && (_board.CartPort.DriveLightEnabled || _board.Serial.DriveLightEnabled);
public bool DriveLightOn => _board != null && (_board.CartPort.DriveLightOn || _board.Serial.DriveLightOn); public bool DriveLightOn => _board != null && (_board.CartPort.DriveLightOn || _board.Serial.DriveLightOn);
public string DriveLightIconDescription => "Cart or Disk Activity LED";
} }
} }

View File

@ -270,5 +270,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge
get => _driveLightOn; get => _driveLightOn;
protected set => _driveLightOn = value; protected set => _driveLightOn = value;
} }
public string DriveLightIconDescription => "Cart Activity";
} }
} }

View File

@ -135,5 +135,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge
public bool DriveLightEnabled => _connected && _cartridgeDevice.DriveLightEnabled; public bool DriveLightEnabled => _connected && _cartridgeDevice.DriveLightEnabled;
public bool DriveLightOn => _connected && _cartridgeDevice.DriveLightOn; public bool DriveLightOn => _connected && _cartridgeDevice.DriveLightOn;
public string DriveLightIconDescription => "Cart Activity";
} }
} }

View File

@ -75,5 +75,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial
public bool DriveLightEnabled => true; public bool DriveLightEnabled => true;
public bool DriveLightOn => ReadDeviceLight(); public bool DriveLightOn => ReadDeviceLight();
public bool IsConnected => _connected; public bool IsConnected => _connected;
public string DriveLightIconDescription => "Serial Activity";
} }
} }

View File

@ -280,5 +280,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public bool DriveLightOn => public bool DriveLightOn =>
_machine?.TapeDevice?.TapeIsPlaying == true _machine?.TapeDevice?.TapeIsPlaying == true
|| _machine?.UPDDiskDevice?.DriveLight == true; || _machine?.UPDDiskDevice?.DriveLight == true;
public string DriveLightIconDescription => "Disc Drive Activity";
} }
} }

View File

@ -243,6 +243,8 @@ namespace BizHawk.Emulation.Cores.Atari.Jaguar
public bool DriveLightEnabled => IsJaguarCD; public bool DriveLightEnabled => IsJaguarCD;
public bool DriveLightOn { get; private set; } public bool DriveLightOn { get; private set; }
public string DriveLightIconDescription => "CD Drive Activity";
private readonly LibVirtualJaguar.CDTOCCallback _cdTocCallback; private readonly LibVirtualJaguar.CDTOCCallback _cdTocCallback;
private readonly LibVirtualJaguar.CDReadCallback _cdReadCallback; private readonly LibVirtualJaguar.CDReadCallback _cdReadCallback;

View File

@ -80,5 +80,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
public bool DriveLightEnabled => Cartridge.HasActivityLED; public bool DriveLightEnabled => Cartridge.HasActivityLED;
public bool DriveLightOn => Cartridge.ActivityLED; public bool DriveLightOn => Cartridge.ActivityLED;
public string DriveLightIconDescription => "Computer thinking activity";
} }
} }

View File

@ -7,5 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public bool DriveLightEnabled { get; } public bool DriveLightEnabled { get; }
public bool DriveLightOn { get; private set; } public bool DriveLightOn { get; private set; }
public string DriveLightIconDescription => "Disk Drive Activity";
} }
} }

View File

@ -7,5 +7,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
public bool DriveLightEnabled { get; } = true; public bool DriveLightEnabled { get; } = true;
public bool DriveLightOn { get; internal set; } public bool DriveLightOn { get; internal set; }
public string DriveLightIconDescription => "CD Drive Activity";
} }
} }

View File

@ -281,6 +281,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive
public bool DriveLightEnabled { get; } public bool DriveLightEnabled { get; }
public bool DriveLightOn { get; private set; } public bool DriveLightOn { get; private set; }
public string DriveLightIconDescription => "CD Drive Activity";
public DisplayType Region => _isPal ? DisplayType.PAL : DisplayType.NTSC; public DisplayType Region => _isPal ? DisplayType.PAL : DisplayType.NTSC;
} }
} }

View File

@ -7,6 +7,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
public bool DriveLightEnabled { get; } public bool DriveLightEnabled { get; }
public bool DriveLightOn { get; private set; } public bool DriveLightOn { get; private set; }
public string DriveLightIconDescription => "CD Drive Activity";
private bool _driveLight; private bool _driveLight;
} }
} }

View File

@ -453,6 +453,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
public bool DriveLightEnabled { get; private set; } public bool DriveLightEnabled { get; private set; }
public bool DriveLightOn { get; private set; } public bool DriveLightOn { get; private set; }
public string DriveLightIconDescription => "CD Drive Activity";
private void Attach() private void Attach()
{ {

View File

@ -47,5 +47,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
public bool DriveLightEnabled => _disks?.Length > 0; public bool DriveLightEnabled => _disks?.Length > 0;
public bool DriveLightOn { get; private set; } public bool DriveLightOn { get; private set; }
public string DriveLightIconDescription => "CD Drive Activity";
} }
} }