Hook up solar sensor control to the UI

It uses hardcoded keypad left and right arrows.
This commit is contained in:
Raphaël Zumer
2019-12-10 17:54:34 -05:00
parent f6cd66e5b1
commit ca9f183d24
3 changed files with 21 additions and 4 deletions

View File

@ -38,6 +38,7 @@
#include "DlgWifiSettings.h"
#include "../NDS.h"
#include "../GBACart.h"
#include "../GPU.h"
#include "../SPU.h"
#include "../Wifi.h"
@ -1291,6 +1292,20 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt)
{
if (evt->Modifiers == 0x0) UndoStateLoad();
}
else if (evt->Scancode == 0x4B) // Keypad left
{
if (GBACart::CartInserted && GBACart::HasSolarSensor)
{
if (GBACart_SolarSensor::LightLevel > 0) GBACart_SolarSensor::LightLevel--;
}
}
else if (evt->Scancode == 0x4D) // Keypad right
{
if (GBACart::CartInserted && GBACart::HasSolarSensor)
{
if (GBACart_SolarSensor::LightLevel < 10) GBACart_SolarSensor::LightLevel++;
}
}
for (int i = 0; i < 12; i++)
if (EventMatchesKey(evt, Config::KeyMapping[i], false))