dsda: announce gamma on front end
they say the code should be so verbose that you won't need comments. indeed comments that restate the same thing that the code is doing are considered sloppy, because code will change and comments will become outdated. but if a comment is describing the logic of decision making or some unintuitive quirk, they're perfectly fine. so in a few places I go crazy with comments because the decision made there took a long time and a lot of changes, so it kinda summarizes the best result. that's it, no elaborate description of the change itself here... because I put it into that comment instead XD
This commit is contained in:
parent
f0564300c7
commit
40b7b49f8c
Binary file not shown.
|
@ -29,11 +29,24 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
|||
| Convert.ToInt32(_syncSettings.Player3Present) << 2
|
||||
| Convert.ToInt32(_syncSettings.Player4Present) << 3;
|
||||
|
||||
// this is the only change that we're announcing on the front end.
|
||||
// not announcing it at all feels weird given how vanilla and ports do it.
|
||||
// but announcing it via internal messages can show wrong values,
|
||||
// because gamma is detached from savestates, yet the internal on-screen message isn't.
|
||||
// so you can be at gamma 3, switch to 4, get the message, then load a state that
|
||||
// was saved when the gamma 2 message was visible, and it'd now be saying 2,
|
||||
// even tho it'd actually stay at 4 after state load.
|
||||
// announcing live settings changes only makes sense if they happen on hotkey
|
||||
// and not from the dialog where you're deliberately changing them.
|
||||
// so if keys for other settings are added, they can be announced too.
|
||||
if (controller.IsPressed("Change Gamma") && !_lastGammaInput)
|
||||
{
|
||||
// cycle through [0 - 4]
|
||||
_settings.Gamma++;
|
||||
_settings.Gamma %= 5;
|
||||
_comm.Notify("Gamma correction " +
|
||||
(_settings.Gamma == 0 ? "OFF" : "level " + _settings.Gamma),
|
||||
4); // internal messages last 4 seconds
|
||||
}
|
||||
|
||||
if (controller.IsPressed("Automap Toggle")) commonButtons |= (1 << 0);
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
|||
ServiceProvider = ser;
|
||||
_finalSyncSettings = _syncSettings = lp.SyncSettings ?? new DoomSyncSettings();
|
||||
_settings = lp.Settings ?? new DoomSettings();
|
||||
_comm = lp.Comm;
|
||||
_loadCallback = LoadCallback;
|
||||
ControllerDefinition = CreateControllerDefinition(_syncSettings);
|
||||
|
||||
|
@ -255,6 +256,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
|||
private string GetFullName(IRomAsset rom) => Path.GetFileName(rom.RomPath.SubstringAfter('|'));
|
||||
|
||||
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
|
||||
internal CoreComm _comm { get; }
|
||||
private readonly WaterboxHost _elf;
|
||||
private readonly LibDSDA _core;
|
||||
private readonly LibDSDA.load_archive_cb _loadCallback;
|
||||
|
|
Loading…
Reference in New Issue