v0.9.4: added some missed 0.9.4 code to open source
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 404 B |
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon;
|
|||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.TitleScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.WelcomeScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.WelcomeScene;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.audio.Music;
|
import com.watabou.noosa.audio.Music;
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ public class Updates {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean supportsReviews() {
|
||||||
|
return supportsUpdates() && service.supportsReviews();
|
||||||
|
}
|
||||||
|
|
||||||
public static void launchReview(Callback callback){
|
public static void launchReview(Callback callback){
|
||||||
if (supportsUpdates()){
|
if (supportsUpdates()){
|
||||||
service.initializeReview(new UpdateService.ReviewResultCallback() {
|
service.initializeReview(new UpdateService.ReviewResultCallback() {
|
||||||
@@ -115,4 +119,10 @@ public class Updates {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void openReviewURI(){
|
||||||
|
if (supportsUpdates()){
|
||||||
|
service.openReviewURI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ public class WndSettings extends WndTabbed {
|
|||||||
chkNews.checked(SPDSettings.news());
|
chkNews.checked(SPDSettings.news());
|
||||||
add(chkNews);
|
add(chkNews);
|
||||||
|
|
||||||
if (Updates.supportsUpdates()) {
|
if (Updates.supportsUpdates() && Updates.isUpdateable()) {
|
||||||
chkUpdates = new CheckBox(Messages.get(this, "updates")) {
|
chkUpdates = new CheckBox(Messages.get(this, "updates")) {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ public abstract class UpdateService {
|
|||||||
public abstract void onComplete();
|
public abstract void onComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract boolean supportsReviews();
|
||||||
|
|
||||||
public abstract void initializeReview( ReviewResultCallback callback );
|
public abstract void initializeReview( ReviewResultCallback callback );
|
||||||
|
|
||||||
|
public abstract void openReviewURI();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,10 +70,19 @@ public class DebugUpdates extends UpdateService {
|
|||||||
//does nothing
|
//does nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsReviews() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initializeReview(ReviewResultCallback callback) {
|
public void initializeReview(ReviewResultCallback callback) {
|
||||||
//does nothing
|
//does nothing
|
||||||
callback.onComplete();
|
callback.onComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openReviewURI() {
|
||||||
|
DeviceCompat.openURI("https://www.google.com/");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,9 +138,19 @@ public class GitHubUpdates extends UpdateService {
|
|||||||
//does nothing, always installed
|
//does nothing, always installed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsReviews() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initializeReview(ReviewResultCallback callback) {
|
public void initializeReview(ReviewResultCallback callback) {
|
||||||
//does nothing, no review functionality here
|
//does nothing, no review functionality here
|
||||||
callback.onComplete();
|
callback.onComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openReviewURI() {
|
||||||
|
//does nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user