private static int ScanMora() { var region = new Rectangle( x: (int)(125 / 1280.0 * Navigation.GetWidth()), y: (int)(665 / 720.0 * Navigation.GetHeight()), width: (int)(300 / 1280.0 * Navigation.GetWidth()), height: (int)(30 / 720.0 * Navigation.GetHeight())); if (Navigation.GetAspectRatio() == new Size(8, 5)) { region.Y = (int)(740 / 800.0 * Navigation.GetHeight()); } using (var screenshot = Navigation.CaptureRegion(region)) { string mora = ParseMoraFromScreenshot(screenshot); if (int.TryParse(mora, out int count)) { UserInterface.ResetCharacterDisplay(); UserInterface.SetMora(screenshot, count); } else { UserInterface.SetNavigation_Image(screenshot); UserInterface.AddError("Unable to parse mora count"); screenshot.Save("./logging/materials/mora.png"); } return(count); } }