Implemented Google Play donations
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
@@ -4,11 +4,11 @@
|
|||||||
<string name="app_name">Mindustry</string>
|
<string name="app_name">Mindustry</string>
|
||||||
<string-array name="donation_google_catalog_values">
|
<string-array name="donation_google_catalog_values">
|
||||||
<item>1 Dollar</item>
|
<item>1 Dollar</item>
|
||||||
<item>2 Dollars</item>
|
|
||||||
<item>3 Dollars</item>
|
|
||||||
<item>5 Dollars</item>
|
<item>5 Dollars</item>
|
||||||
<item>10 Dollars</item>
|
<item>10 Dollars</item>
|
||||||
<item>15 Dollars</item>
|
<item>15 Dollars</item>
|
||||||
|
<item>25 Dollars</item>
|
||||||
|
<item>50 Dollars</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package io.anuke.mindustry;
|
package io.anuke.mindustry;
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentActivity;
|
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
|
||||||
import org.sufficientlysecure.donations.DonationsFragment;
|
import org.sufficientlysecure.donations.DonationsFragment;
|
||||||
|
|
||||||
@@ -14,11 +14,11 @@ public class DonationsActivity extends FragmentActivity {
|
|||||||
/**
|
/**
|
||||||
* Google
|
* Google
|
||||||
*/
|
*/
|
||||||
private static final String GOOGLE_PUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg8bTVFK5zIg4FGYkHKKQ/j/iGZQlXU0qkAv2BA6epOX1ihbMz78iD4SmViJlECHN8bKMHxouRNd9pkmQKxwEBHg5/xDC/PHmSCXFx/gcY/xa4etA1CSfXjcsS9i94n+j0gGYUg69rNkp+p/09nO9sgfRTAQppTxtgKaXwpfKe1A8oqmDUfOnPzsEAG6ogQL6Svo6ynYLVKIvRPPhXkq+fp6sJ5YVT5Hr356yCXlM++G56Pk8Z+tPzNjjvGSSs/MsYtgFaqhPCsnKhb55xHkc8GJ9haq8k3PSqwMSeJHnGiDq5lzdmsjdmGkWdQq2jIhKlhMZMm5VQWn0T59+xjjIIwIDAQAB";
|
private static final String GOOGLE_PUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzG93KhpfBPKTo2jF0yxbWkkmMKwsPNM4SsMj1aDq7vv6n3R+mqJVfprOJxFfJh7JchXTflLIgiaKXFAiU70gJbMTniEWnEaFSxAeF09a7U0RjOwN+7rFwjCG91c2CpYxPanBTQP4zasc1ODPVzq4q6/4ByjhenN71V4WmR08NFIAodcfFPrOkDPil7i8y7cgcd1Ky53U0TS+LLYJttAK3XdTK4s7VE3I5IKoeNa4uwCmIM59R67q2k3cXjLk/nP6MP+y++EzHN/PTiR1sVg4dMP8K31RPw/1QNLPQwJz6Wc872oWwb7xo5gkoXbDc5WPPydsi8F3SyKNaYwzN6CDFQIDAQAB";
|
||||||
private static final String[] GOOGLE_CATALOG = new String[]{
|
private static final String[] GOOGLE_CATALOG = new String[]{
|
||||||
"ntpsync.donation.1", "ntpsync.donation.2",
|
"mindustry.donation.1", "mindustry.donation.5",
|
||||||
"ntpsync.donation.5", "ntpsync.donation.5",
|
"mindustry.donation.10", "mindustry.donation.15",
|
||||||
"ntpsync.donation.8", "ntpsync.donation.13" };
|
"mindustry.donation.25", "mindustry.donation.50" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the activity is first created.
|
* Called when the activity is first created.
|
||||||
@@ -58,6 +58,7 @@ public class DonationsActivity extends FragmentActivity {
|
|||||||
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
|
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
|
||||||
if (fragment != null) {
|
if (fragment != null) {
|
||||||
fragment.onActivityResult(requestCode, resultCode, data);
|
fragment.onActivityResult(requestCode, resultCode, data);
|
||||||
|
//TODO donation event, set settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
core/assets-raw/sprites/ui/icon-donate.png
Normal file
BIN
core/assets-raw/sprites/ui/icon-donate.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 223 B |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 78 KiB |
@@ -42,35 +42,38 @@ public class MenuFragment implements Fragment{
|
|||||||
add(new MenuButton("text-exit", ()-> Gdx.app.exit()));
|
add(new MenuButton("text-exit", ()-> Gdx.app.exit()));
|
||||||
}
|
}
|
||||||
get().pad(Unit.dp.inPixels(16));
|
get().pad(Unit.dp.inPixels(16));
|
||||||
}};
|
}}.end();
|
||||||
|
|
||||||
visible(()->GameState.is(State.menu));
|
visible(()->GameState.is(State.menu));
|
||||||
}}.end();
|
}}.end();
|
||||||
}else{
|
}else{
|
||||||
new table(){{
|
new table(){{
|
||||||
defaults().size(120f).pad(5).units(Unit.dp);
|
new table(){{
|
||||||
float isize = Unit.dp.inPixels(14f*4);
|
defaults().size(120f).pad(5).units(Unit.dp);
|
||||||
|
float isize = Unit.dp.inPixels(14f*4);
|
||||||
new imagebutton("icon-play-2", isize, () -> ui.showLevels()).text("Play").padTop(4f);
|
|
||||||
|
new imagebutton("icon-play-2", isize, () -> ui.showLevels()).text("Play").padTop(4f);
|
||||||
new imagebutton("icon-tutorial", isize, ()-> control.playMap(Map.tutorial)).text("Tutorial").padTop(4f);
|
|
||||||
|
new imagebutton("icon-tutorial", isize, ()-> control.playMap(Map.tutorial)).text("Tutorial").padTop(4f);
|
||||||
new imagebutton("icon-load", isize, () -> ui.showLoadGame()).text("Load").padTop(4f);
|
|
||||||
|
new imagebutton("icon-load", isize, () -> ui.showLoadGame()).text("Load").padTop(4f);
|
||||||
new imagebutton("icon-tools", isize, () -> ui.showPrefs()).text("Settings").padTop(4f);
|
|
||||||
|
new imagebutton("icon-tools", isize, () -> ui.showPrefs()).text("Settings").padTop(4f);
|
||||||
visible(()->GameState.is(State.menu));
|
|
||||||
|
if(Mindustry.donationsCallable != null){
|
||||||
|
new imagebutton("icon-donate", isize, () -> {
|
||||||
|
Mindustry.donationsCallable.run();
|
||||||
|
}).text("Donate").padTop(4f);
|
||||||
|
}
|
||||||
|
|
||||||
|
visible(()->GameState.is(State.menu));
|
||||||
|
}}.end();
|
||||||
}}.end();
|
}}.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
//settings icon
|
//settings icon
|
||||||
new table(){{
|
new table(){{
|
||||||
atop().aright();
|
atop().aright();
|
||||||
if(Mindustry.donationsCallable != null){
|
|
||||||
new imagebutton("icon-tools", Unit.dp.inPixels(30f), ()->{
|
|
||||||
Mindustry.donationsCallable.run();
|
|
||||||
}).get().pad(Unit.dp.inPixels(14));
|
|
||||||
}
|
|
||||||
new imagebutton("icon-info", Unit.dp.inPixels(30f), ()->{
|
new imagebutton("icon-info", Unit.dp.inPixels(30f), ()->{
|
||||||
ui.showAbout();
|
ui.showAbout();
|
||||||
}).get().pad(Unit.dp.inPixels(14));
|
}).get().pad(Unit.dp.inPixels(14));
|
||||||
|
|||||||
Reference in New Issue
Block a user