• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónc2baf83f34a170431f5856b668721945f55cfd0d (tree)
Tiempo2022-01-15 00:32:15
Autorsebastian_bugiu
Commitersebastian_bugiu

Log Message

Added UIRequiresFullScreen. Full access IAP now should limit score if no purchase happened.

Cambiar Resumen

Diferencia incremental

diff -r 1cb27bf5d778 -r c2baf83f34a1 android/src/com/headwayent/spacerocket/AndroidLauncher.java
--- a/android/src/com/headwayent/spacerocket/AndroidLauncher.java Thu Jan 13 17:45:40 2022 +0200
+++ b/android/src/com/headwayent/spacerocket/AndroidLauncher.java Fri Jan 14 17:32:15 2022 +0200
@@ -4,12 +4,13 @@
44
55 import com.badlogic.gdx.backends.android.AndroidApplication;
66 import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
7+import com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling;
78
89 public class AndroidLauncher extends AndroidApplication {
910 @Override
1011 protected void onCreate (Bundle savedInstanceState) {
1112 super.onCreate(savedInstanceState);
1213 AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
13- initialize(new SpaceRocket(), config);
14+ initialize(new SpaceRocket(new PurchaseManagerGoogleBilling(this)), config);
1415 }
1516 }
diff -r 1cb27bf5d778 -r c2baf83f34a1 core/src/com/headwayent/spacerocket/IAPButton.java
--- a/core/src/com/headwayent/spacerocket/IAPButton.java Thu Jan 13 17:45:40 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/IAPButton.java Fri Jan 14 17:32:15 2022 +0200
@@ -11,8 +11,8 @@
1111 private final String sku;
1212 private final int usdCents;
1313
14- public IAPButton(String sku, int usdCents, Skin skin) {
15- super(sku, skin);
14+ public IAPButton(String text, String sku, int usdCents, Skin skin) {
15+ super(text, skin);
1616 this.sku = sku;
1717 this.usdCents = usdCents;
1818
diff -r 1cb27bf5d778 -r c2baf83f34a1 core/src/com/headwayent/spacerocket/IAPObserver.java
--- a/core/src/com/headwayent/spacerocket/IAPObserver.java Thu Jan 13 17:45:40 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/IAPObserver.java Fri Jan 14 17:32:15 2022 +0200
@@ -64,6 +64,9 @@
6464 if (transaction.getIdentifier().equals(IAPShop.SKU_FULL_ACCESS)) {
6565 shop.getBuyEntitlement().setBought(fromRestore);
6666 Preferences.getInstance().setFullAccess(true);
67+ if (!fromRestore) {
68+ shop.getCloseButton().toggle();
69+ }
6770 }
6871
6972 else if (transaction.getIdentifier().equals(IAPShop.MY_CONSUMABLE)) {
diff -r 1cb27bf5d778 -r c2baf83f34a1 core/src/com/headwayent/spacerocket/IAPShop.java
--- a/core/src/com/headwayent/spacerocket/IAPShop.java Thu Jan 13 17:45:40 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/IAPShop.java Fri Jan 14 17:32:15 2022 +0200
@@ -29,7 +29,7 @@
2929 closeButton = new TextButton("Close", skin);
3030 button(closeButton);
3131
32- restoreButton = new TextButton("Restore", skin);
32+ restoreButton = new TextButton("Reclaim purchases", skin);
3333 restoreButton.setDisabled(true);
3434 restoreButton.addListener(new ChangeListener() {
3535 @Override
@@ -56,11 +56,11 @@
5656
5757 Table iapTable = new Table();
5858 iapTable.defaults().fillX().uniform().expandX();
59- buyEntitlement = new IAPButton(SKU_FULL_ACCESS, 100, skin);
59+ buyEntitlement = new IAPButton("Unlock Full Access", SKU_FULL_ACCESS, 100, skin);
6060 iapTable.add(buyEntitlement);
61- buyConsumable = new IAPButton(MY_CONSUMABLE, 100, skin);
62- iapTable.row();
63- iapTable.add(buyConsumable);
61+// buyConsumable = new IAPButton(MY_CONSUMABLE, 100, skin);
62+// iapTable.row();
63+// iapTable.add(buyConsumable);
6464
6565 contentTable.add(iapTable);
6666 }
@@ -78,7 +78,7 @@
7878
7979 public void updateGuiWhenPurchaseManInstalled(String errorMessage) {
8080 buyEntitlement.updateFromManager();
81- buyConsumable.updateFromManager();
81+// buyConsumable.updateFromManager();
8282
8383 if (SpaceRocket.getGame().getPurchaseManager().installed() && errorMessage == null) {
8484 restoreButton.setDisabled(false);
@@ -104,4 +104,8 @@
104104 public IAPButton getBuyConsumable() {
105105 return buyConsumable;
106106 }
107+
108+ public TextButton getCloseButton() {
109+ return closeButton;
110+ }
107111 }
diff -r 1cb27bf5d778 -r c2baf83f34a1 core/src/com/headwayent/spacerocket/SpaceRocket.java
--- a/core/src/com/headwayent/spacerocket/SpaceRocket.java Thu Jan 13 17:45:40 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/SpaceRocket.java Fri Jan 14 17:32:15 2022 +0200
@@ -24,6 +24,7 @@
2424
2525 public class SpaceRocket extends Game {
2626
27+ public static final boolean DEBUG = true;
2728 private static final Random random = new Random(System.currentTimeMillis());
2829 private static SpaceRocket game;
2930 private final PurchaseManager purchaseManager;
@@ -112,8 +113,9 @@
112113 parameter.flip = true;
113114 font = generator.generateFont(parameter); // For the in game flipped ttf.
114115 generator.dispose();
115- // Disable after testing.
116- Preferences.getInstance().setFullAccess(false);
116+ if (DEBUG) {
117+ Preferences.getInstance().setFullAccess(false);
118+ }
117119 canvas = new ExtendedCanvas();
118120 setScreen(new MainMenuActivity(this));
119121 }
diff -r 1cb27bf5d778 -r c2baf83f34a1 core/src/com/headwayent/spacerocket/old/ExtendedCanvas.java
--- a/core/src/com/headwayent/spacerocket/old/ExtendedCanvas.java Thu Jan 13 17:45:40 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/old/ExtendedCanvas.java Fri Jan 14 17:32:15 2022 +0200
@@ -50,7 +50,7 @@
5050 private static final float CORNER_X = 0, CORNER_Y = 0;
5151 public static final int NUM_LIVES = 10;
5252 private static final int HIDDEN_KEY_NUM_PRESSES = 10;
53- public static final int FULL_ACCESS_SCORE = 10;
53+ public static final int FULL_ACCESS_SCORE = SpaceRocket.DEBUG ? 10 : 150;
5454 private static float FONT_HEIGHT;
5555 private static float SCORE_WIDTH;
5656 private static float OTHER_SHIP_SCORE_WIDTH;
diff -r 1cb27bf5d778 -r c2baf83f34a1 desktop/src/com/headwayent/spacerocket/desktop/DesktopLauncher.java
--- a/desktop/src/com/headwayent/spacerocket/desktop/DesktopLauncher.java Thu Jan 13 17:45:40 2022 +0200
+++ b/desktop/src/com/headwayent/spacerocket/desktop/DesktopLauncher.java Fri Jan 14 17:32:15 2022 +0200
@@ -7,6 +7,6 @@
77 public class DesktopLauncher {
88 public static void main (String[] arg) {
99 LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
10- new LwjglApplication(new SpaceRocket(), config);
10+ new LwjglApplication(new SpaceRocket(null), config);
1111 }
1212 }
diff -r 1cb27bf5d778 -r c2baf83f34a1 ios/Info.plist.xml
--- a/ios/Info.plist.xml Thu Jan 13 17:45:40 2022 +0200
+++ b/ios/Info.plist.xml Fri Jan 14 17:32:15 2022 +0200
@@ -28,6 +28,8 @@
2828 <false/>
2929 <key>UIStatusBarHidden</key>
3030 <true/>
31+ <key>UIRequiresFullScreen</key>
32+ <true/>
3133 <key>MinimumOSVersion</key>
3234 <string>8.0</string>
3335 <key>UIDeviceFamily</key>
@@ -43,9 +45,6 @@
4345 <key>UISupportedInterfaceOrientations</key>
4446 <array>
4547 <string>UIInterfaceOrientationPortrait</string>
46- <!-- <string>UIInterfaceOrientationPortraitUpsideDown</string>
47- <string>UIInterfaceOrientationLandscapeLeft</string>
48- <string>UIInterfaceOrientationLandscapeRight</string> -->
4948 </array>
5049 <key>UILaunchStoryboardName</key>
5150 <string>LaunchScreen</string>
diff -r 1cb27bf5d778 -r c2baf83f34a1 ios/robovm.properties
--- a/ios/robovm.properties Thu Jan 13 17:45:40 2022 +0200
+++ b/ios/robovm.properties Fri Jan 14 17:32:15 2022 +0200
@@ -2,5 +2,5 @@
22 app.id=com.headwayent.spacerocket
33 app.mainclass=com.headwayent.spacerocket.IOSLauncher
44 app.executable=IOSLauncher
5-app.build=10
5+app.build=12
66 app.name=Hotshot 2D