Skip to content

Commit

Permalink
Merge pull request #5 from lramati/candy-scan
Browse files Browse the repository at this point in the history
v5.5.3
  • Loading branch information
lramati authored Feb 8, 2021
2 parents 7ebd64c + ee328e4 commit d179872
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 79 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ android {
defaultConfig {
minSdkVersion 19 /*Dont change this unless you know why*/
targetSdkVersion 29 /*Dont change this unless you know why*/
versionCode 69
versionName "5.5.2"
versionCode 70
versionName "5.5.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/kamron/pogoiv/GoIVSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class GoIVSettings {
public static final String DOWNLOADED_MOVESET_INFO = "downloaded_moveset_info_goiv";

// Increment this value when you want to make all users recalibrate GoIV
public static int LATEST_SCREEN_CALIBRATION_VERSION = 1;
public static int LATEST_SCREEN_CALIBRATION_VERSION = 2;


private static GoIVSettings instance;
Expand Down Expand Up @@ -106,6 +106,8 @@ public String getCalibrationValue(String valueName) {
}

public void saveScreenCalibrationResults(ScanFieldResults results) {
results.finalAdjustments();

SharedPreferences.Editor editor = prefs.edit();
editor.putString(ScanFieldNames.POKEMON_NAME_AREA,
results.pokemonNameArea.toString());
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/kamron/pogoiv/ScreenGrabber.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void exit() {
Bitmap grabScreen() {
Image image = null;
Bitmap bmp = null;
Integer retries = 60; // Retry for an entire second (given the rendering speed of 60fps)
int retries = 60; // Retry for an entire second (given the rendering speed of 60fps)

while (retries > 0) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,7 @@ public ScanData scanPokemon(@NonNull GoIVSettings settings,
}
ensureCorrectLevelArcSettings(settings, trainerLevel); //todo, make it so it doesnt initiate on every scan?
int totalOffset = 0;
boolean is_lucky = false;
double offsetBase; // offsets are calculated off height of powerup candy cost field. Double to retain precision
// Since we only care about height, its fine that we don't know the proper offset yet
ScanArea powerUpCandyArea = ScanArea.calibratedFromSettings(POKEMON_POWER_UP_CANDY_COST, settings);
Expand Down Expand Up @@ -1132,6 +1133,7 @@ public ScanData scanPokemon(@NonNull GoIVSettings settings,
if (hp.isPresent()) {
// Found successfully; assume this is a lucky pokemon and offset all further scans below that line
totalOffset += luckyOffset;
is_lucky = true;
}
}

Expand Down Expand Up @@ -1197,7 +1199,7 @@ public ScanData scanPokemon(@NonNull GoIVSettings settings,
.toString() + powerUpStardustCost.toString() + powerUpCandyCost.toString();

return new ScanData(estimatedLevelRange, name, type, candyNames, gender, hp, cp, candyAmount, evolutionCost,
powerUpStardustCost, powerUpCandyCost, null, null, (totalOffset != 0), uniqueIdentifier);
powerUpStardustCost, powerUpCandyCost, null, null, is_lucky, uniqueIdentifier);
}

/**
Expand Down
Loading

0 comments on commit d179872

Please sign in to comment.