mirror of
https://github.com/defold/extension-iap
synced 2025-06-27 18:37:44 +02:00
Compare commits
No commits in common. "master" and "5.0.0" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,5 +9,3 @@ Thumbs.db
|
|||||||
.cproject
|
.cproject
|
||||||
builtins
|
builtins
|
||||||
_site
|
_site
|
||||||
manifest.private.der
|
|
||||||
manifest.public.der
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Defold In-app purchase extension API documentation
|
title: Defold In-app purchase extension API documentation
|
||||||
brief: This manual covers how to setup and use In-App Purchases in Defold.
|
brief: This manual covers how to setup and use Google Play Game Services in Defold.
|
||||||
---
|
---
|
||||||
|
|
||||||
# Defold In-app purchase extension API documentation
|
# Defold In-app purchase extension API documentation
|
||||||
@ -234,3 +234,6 @@ On iOS, the "price_string" field contains '~' characters
|
|||||||
## Source code
|
## Source code
|
||||||
|
|
||||||
The source code is available on [GitHub](https://github.com/defold/extension-iap)
|
The source code is available on [GitHub](https://github.com/defold/extension-iap)
|
||||||
|
|
||||||
|
|
||||||
|
## API reference
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
name: IAPExt
|
name: IAPExt
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
|
armv7-ios:
|
||||||
|
context:
|
||||||
|
weakFrameworks: ['StoreKit', 'UIKit', 'Foundation']
|
||||||
|
|
||||||
arm64-ios:
|
arm64-ios:
|
||||||
context:
|
context:
|
||||||
weakFrameworks: ['StoreKit', 'UIKit', 'Foundation']
|
weakFrameworks: ['StoreKit', 'UIKit', 'Foundation']
|
||||||
|
@ -71,7 +71,7 @@ var LibraryFacebookIAP = {
|
|||||||
|
|
||||||
if(url_index == product_count-1) {
|
if(url_index == product_count-1) {
|
||||||
var productsJSON = JSON.stringify(products);
|
var productsJSON = JSON.stringify(products);
|
||||||
var res_buf = stringToUTF8OnStack(productsJSON);
|
var res_buf = allocate(intArrayFromString(productsJSON), 'i8', ALLOC_STACK);
|
||||||
{{{ makeDynCall('vii', 'callback')}}}(lua_callback, res_buf);
|
{{{ makeDynCall('vii', 'callback')}}}(lua_callback, res_buf);
|
||||||
} else {
|
} else {
|
||||||
var xmlhttp = new XMLHttpRequest();
|
var xmlhttp = new XMLHttpRequest();
|
||||||
@ -143,7 +143,7 @@ var LibraryFacebookIAP = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var productsJSON = JSON.stringify(result)
|
var productsJSON = JSON.stringify(result)
|
||||||
var res_buf = stringToUTF8OnStack(productsJSON);
|
var res_buf = allocate(intArrayFromString(productsJSON), 'i8', ALLOC_STACK);
|
||||||
{{{ makeDynCall('viii', 'callback')}}}(lua_callback, res_buf, 0);
|
{{{ makeDynCall('viii', 'callback')}}}(lua_callback, res_buf, 0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -166,4 +166,4 @@ var LibraryFacebookIAP = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
autoAddDeps(LibraryFacebookIAP, '$FBinner');
|
autoAddDeps(LibraryFacebookIAP, '$FBinner');
|
||||||
addToLibrary(LibraryFacebookIAP);
|
mergeInto(LibraryManager.library, LibraryFacebookIAP);
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.android.billingclient:billing:7.0.0'
|
implementation 'com.android.billingclient:billing:5.0.0'
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ enum BillingResponse
|
|||||||
BILLING_RESPONSE_RESULT_ERROR = 6,
|
BILLING_RESPONSE_RESULT_ERROR = 6,
|
||||||
BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7,
|
BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7,
|
||||||
BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8,
|
BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8,
|
||||||
BILLING_RESPONSE_RESULT_NETWORK_ERROR = 9,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ProviderId
|
enum ProviderId
|
||||||
|
@ -308,7 +308,6 @@ static void HandleProductResult(const IAPCommand* cmd)
|
|||||||
if (cmd->m_ResponseCode == BILLING_RESPONSE_RESULT_OK) {
|
if (cmd->m_ResponseCode == BILLING_RESPONSE_RESULT_OK) {
|
||||||
const char* json = (const char*)cmd->m_Data;
|
const char* json = (const char*)cmd->m_Data;
|
||||||
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
||||||
lua_pushnil(L);
|
|
||||||
} else {
|
} else {
|
||||||
dmLogError("IAP error %d", cmd->m_ResponseCode);
|
dmLogError("IAP error %d", cmd->m_ResponseCode);
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
@ -344,7 +343,6 @@ static void HandlePurchaseResult(const IAPCommand* cmd)
|
|||||||
if (cmd->m_Data != 0) {
|
if (cmd->m_Data != 0) {
|
||||||
const char* json = (const char*)cmd->m_Data;
|
const char* json = (const char*)cmd->m_Data;
|
||||||
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
||||||
lua_pushnil(L);
|
|
||||||
} else {
|
} else {
|
||||||
dmLogError("IAP error, purchase response was null");
|
dmLogError("IAP error, purchase response was null");
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
@ -47,7 +47,6 @@ static void IAPList_Callback(void* luacallback, const char* result_json)
|
|||||||
if(result_json != 0)
|
if(result_json != 0)
|
||||||
{
|
{
|
||||||
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
||||||
lua_pushnil(L);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -98,7 +97,6 @@ static void IAPListener_Callback(void* luacallback, const char* result_json, int
|
|||||||
|
|
||||||
if (result_json) {
|
if (result_json) {
|
||||||
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
||||||
lua_pushnil(L);
|
|
||||||
} else {
|
} else {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
switch(error_code)
|
switch(error_code)
|
||||||
|
@ -21,7 +21,6 @@ import com.android.billingclient.api.BillingClient;
|
|||||||
import com.android.billingclient.api.BillingClient.BillingResponseCode;
|
import com.android.billingclient.api.BillingClient.BillingResponseCode;
|
||||||
import com.android.billingclient.api.BillingClient.ProductType;
|
import com.android.billingclient.api.BillingClient.ProductType;
|
||||||
import com.android.billingclient.api.BillingResult;
|
import com.android.billingclient.api.BillingResult;
|
||||||
import com.android.billingclient.api.PendingPurchasesParams;
|
|
||||||
import com.android.billingclient.api.Purchase;
|
import com.android.billingclient.api.Purchase;
|
||||||
import com.android.billingclient.api.Purchase.PurchaseState;
|
import com.android.billingclient.api.Purchase.PurchaseState;
|
||||||
import com.android.billingclient.api.ProductDetails;
|
import com.android.billingclient.api.ProductDetails;
|
||||||
@ -57,8 +56,7 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
this.autoFinishTransactions = autoFinishTransactions;
|
this.autoFinishTransactions = autoFinishTransactions;
|
||||||
|
|
||||||
PendingPurchasesParams pendingPurchasesParams = PendingPurchasesParams.newBuilder().enableOneTimeProducts().build();
|
billingClient = BillingClient.newBuilder(activity).setListener(this).enablePendingPurchases().build();
|
||||||
billingClient = BillingClient.newBuilder(activity).setListener(this).enablePendingPurchases(pendingPurchasesParams).build();
|
|
||||||
billingClient.startConnection(new BillingClientStateListener() {
|
billingClient.startConnection(new BillingClientStateListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onBillingSetupFinished(BillingResult billingResult) {
|
public void onBillingSetupFinished(BillingResult billingResult) {
|
||||||
@ -223,6 +221,7 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
case BillingResponseCode.OK:
|
case BillingResponseCode.OK:
|
||||||
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_OK;
|
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_OK;
|
||||||
break;
|
break;
|
||||||
|
case BillingResponseCode.SERVICE_TIMEOUT:
|
||||||
case BillingResponseCode.SERVICE_UNAVAILABLE:
|
case BillingResponseCode.SERVICE_UNAVAILABLE:
|
||||||
case BillingResponseCode.SERVICE_DISCONNECTED:
|
case BillingResponseCode.SERVICE_DISCONNECTED:
|
||||||
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE;
|
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE;
|
||||||
@ -230,9 +229,6 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
case BillingResponseCode.USER_CANCELED:
|
case BillingResponseCode.USER_CANCELED:
|
||||||
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_USER_CANCELED;
|
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_USER_CANCELED;
|
||||||
break;
|
break;
|
||||||
case BillingResponseCode.NETWORK_ERROR: // new in Play Billing Library 6.0.0
|
|
||||||
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_NETWORK_ERROR;
|
|
||||||
break;
|
|
||||||
case BillingResponseCode.FEATURE_NOT_SUPPORTED:
|
case BillingResponseCode.FEATURE_NOT_SUPPORTED:
|
||||||
case BillingResponseCode.ERROR:
|
case BillingResponseCode.ERROR:
|
||||||
default:
|
default:
|
||||||
@ -247,20 +243,6 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
return billingResponseCodeToDefoldResponse(result.getResponseCode());
|
return billingResponseCodeToDefoldResponse(result.getResponseCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void invokeOnPurchaseResultListener(IPurchaseListener purchaseListener, int billingResultCode, String purchaseData) {
|
|
||||||
if (purchaseListener == null) {
|
|
||||||
Log.w(TAG, "Received billing result but no listener has been set");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
purchaseListener.onPurchaseResult(billingResultCode, purchaseData);
|
|
||||||
}
|
|
||||||
private void invokeOnPurchaseResultListener(IPurchaseListener purchaseListener, BillingResult billingResult, Purchase purchase) {
|
|
||||||
invokeOnPurchaseResultListener(purchaseListener, billingResultToDefoldResponse(billingResult), convertPurchase(purchase));
|
|
||||||
}
|
|
||||||
private void invokeOnPurchaseResultListener(IPurchaseListener purchaseListener, BillingResult billingResult) {
|
|
||||||
invokeOnPurchaseResultListener(purchaseListener, billingResultToDefoldResponse(billingResult), "");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called either explicitly from Lua or from extension code
|
* This method is called either explicitly from Lua or from extension code
|
||||||
* when "set_listener()" is called from Lua.
|
* when "set_listener()" is called from Lua.
|
||||||
@ -324,7 +306,7 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
// note: we only call the purchase listener if an error happens
|
// note: we only call the purchase listener if an error happens
|
||||||
if (billingResult.getResponseCode() != BillingResponseCode.OK) {
|
if (billingResult.getResponseCode() != BillingResponseCode.OK) {
|
||||||
Log.e(TAG, "Unable to consume purchase: " + billingResult.getDebugMessage());
|
Log.e(TAG, "Unable to consume purchase: " + billingResult.getDebugMessage());
|
||||||
invokeOnPurchaseResultListener(purchaseListener, billingResult);
|
purchaseListener.onPurchaseResult(billingResultToDefoldResponse(billingResult), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -347,7 +329,7 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
// note: we only call the purchase listener if an error happens
|
// note: we only call the purchase listener if an error happens
|
||||||
if (billingResult.getResponseCode() != BillingResponseCode.OK) {
|
if (billingResult.getResponseCode() != BillingResponseCode.OK) {
|
||||||
Log.e(TAG, "Unable to acknowledge purchase: " + billingResult.getDebugMessage());
|
Log.e(TAG, "Unable to acknowledge purchase: " + billingResult.getDebugMessage());
|
||||||
invokeOnPurchaseResultListener(purchaseListener, billingResult);
|
purchaseListener.onPurchaseResult(billingResultToDefoldResponse(billingResult), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -366,12 +348,12 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onConsumeResponse(BillingResult billingResult, String purchaseToken) {
|
public void onConsumeResponse(BillingResult billingResult, String purchaseToken) {
|
||||||
Log.d(TAG, "handlePurchase() response code " + billingResult.getResponseCode() + " purchaseToken: " + purchaseToken);
|
Log.d(TAG, "handlePurchase() response code " + billingResult.getResponseCode() + " purchaseToken: " + purchaseToken);
|
||||||
invokeOnPurchaseResultListener(purchaseListener, billingResult, purchase);
|
purchaseListener.onPurchaseResult(billingResultToDefoldResponse(billingResult), convertPurchase(purchase));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
invokeOnPurchaseResultListener(purchaseListener, billingResponseCodeToDefoldResponse(BillingResponseCode.OK), convertPurchase(purchase));
|
purchaseListener.onPurchaseResult(billingResponseCodeToDefoldResponse(BillingResponseCode.OK), convertPurchase(purchase));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,17 +362,13 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onPurchasesUpdated(BillingResult billingResult, List<Purchase> purchases) {
|
public void onPurchasesUpdated(BillingResult billingResult, List<Purchase> purchases) {
|
||||||
if (billingResult.getResponseCode() == BillingResponseCode.OK) {
|
if (billingResult.getResponseCode() == BillingResponseCode.OK && purchases != null) {
|
||||||
if (purchases != null && !purchases.isEmpty()) {
|
for (Purchase purchase : purchases) {
|
||||||
for (Purchase purchase : purchases) {
|
handlePurchase(purchase, this.purchaseListener);
|
||||||
if (purchase != null) {
|
|
||||||
handlePurchase(purchase, this.purchaseListener);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
invokeOnPurchaseResultListener(this.purchaseListener, billingResult);
|
this.purchaseListener.onPurchaseResult(billingResultToDefoldResponse(billingResult), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,7 +392,7 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
BillingResult billingResult = billingClient.launchBillingFlow(this.activity, billingFlowParams);
|
BillingResult billingResult = billingClient.launchBillingFlow(this.activity, billingFlowParams);
|
||||||
if (billingResult.getResponseCode() != BillingResponseCode.OK) {
|
if (billingResult.getResponseCode() != BillingResponseCode.OK) {
|
||||||
Log.e(TAG, "Purchase failed: " + billingResult.getDebugMessage());
|
Log.e(TAG, "Purchase failed: " + billingResult.getDebugMessage());
|
||||||
invokeOnPurchaseResultListener(purchaseListener, billingResult);
|
purchaseListener.onPurchaseResult(billingResultToDefoldResponse(billingResult), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,16 +413,11 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onProductDetailsResponse(BillingResult billingResult, List<ProductDetails> productDetailsList) {
|
public void onProductDetailsResponse(BillingResult billingResult, List<ProductDetails> productDetailsList) {
|
||||||
if (billingResult.getResponseCode() == BillingResponseCode.OK && (productDetailsList != null) && !productDetailsList.isEmpty()) {
|
if (billingResult.getResponseCode() == BillingResponseCode.OK && (productDetailsList != null) && !productDetailsList.isEmpty()) {
|
||||||
for (ProductDetails productDetails : productDetailsList) {
|
buyProduct(productDetailsList.get(0), token, purchaseListener);
|
||||||
if (productDetails != null) {
|
|
||||||
buyProduct(productDetails, token, purchaseListener);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log.e(TAG, "Unable to get product details before buying: " + billingResult.getDebugMessage());
|
Log.e(TAG, "Unable to get product details before buying: " + billingResult.getDebugMessage());
|
||||||
invokeOnPurchaseResultListener(purchaseListener, billingResult);
|
purchaseListener.onPurchaseResult(billingResultToDefoldResponse(billingResult), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -462,12 +435,10 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onProductDetailsResponse(BillingResult billingResult, List<ProductDetails> productDetails) {
|
public void onProductDetailsResponse(BillingResult billingResult, List<ProductDetails> productDetails) {
|
||||||
if (productDetails != null && !productDetails.isEmpty()) {
|
if (productDetails != null) {
|
||||||
// cache products (cache will be used to speed up buying)
|
// cache products (cache will be used to speed up buying)
|
||||||
for (ProductDetails pd : productDetails) {
|
for (ProductDetails pd : productDetails) {
|
||||||
if (pd != null) {
|
IapGooglePlay.this.products.put(pd.getProductId(), pd);
|
||||||
IapGooglePlay.this.products.put(pd.getProductId(), pd);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// add to list of all product details
|
// add to list of all product details
|
||||||
allProductDetails.addAll(productDetails);
|
allProductDetails.addAll(productDetails);
|
||||||
@ -514,11 +485,9 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onProductDetailsResponse(BillingResult billingResult, List<ProductDetails> productDetails) {
|
public void onProductDetailsResponse(BillingResult billingResult, List<ProductDetails> productDetails) {
|
||||||
JSONArray a = new JSONArray();
|
JSONArray a = new JSONArray();
|
||||||
if ((billingResult.getResponseCode() == BillingResponseCode.OK) && (productDetails != null) && !productDetails.isEmpty()) {
|
if (billingResult.getResponseCode() == BillingResponseCode.OK) {
|
||||||
for (ProductDetails pd : productDetails) {
|
for (ProductDetails pd : productDetails) {
|
||||||
if (pd != null) {
|
a.put(convertProductDetails(pd));
|
||||||
a.put(convertProductDetails(pd));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -18,7 +18,6 @@ public class IapJNI implements IListProductsListener, IPurchaseListener {
|
|||||||
public static final int BILLING_RESPONSE_RESULT_ERROR = 6;
|
public static final int BILLING_RESPONSE_RESULT_ERROR = 6;
|
||||||
public static final int BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7;
|
public static final int BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7;
|
||||||
public static final int BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8;
|
public static final int BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8;
|
||||||
public static final int BILLING_RESPONSE_RESULT_NETWORK_ERROR = 9;
|
|
||||||
|
|
||||||
public IapJNI() {
|
public IapJNI() {
|
||||||
}
|
}
|
||||||
|
@ -11,12 +11,12 @@ height = 1136
|
|||||||
[android]
|
[android]
|
||||||
input_method = HiddenInputField
|
input_method = HiddenInputField
|
||||||
package = com.defold.extension.iap
|
package = com.defold.extension.iap
|
||||||
version_code = 9
|
version_code = 7
|
||||||
minimum_sdk_version = 21
|
target_sdk_version = 29
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
title = extension-iap
|
title = extension-iap
|
||||||
dependencies#0 = https://github.com/andsve/dirtylarry/archive/master.zip
|
dependencies = https://github.com/andsve/dirtylarry/archive/master.zip
|
||||||
|
|
||||||
[library]
|
[library]
|
||||||
include_dirs = extension-iap
|
include_dirs = extension-iap
|
||||||
|
100
main/main.gui
100
main/main.gui
@ -1,7 +1,7 @@
|
|||||||
script: "/main/main.gui_script"
|
script: "/main/main.gui_script"
|
||||||
fonts {
|
fonts {
|
||||||
name: "default"
|
name: "system_font"
|
||||||
font: "/builtins/fonts/default.font"
|
font: "/builtins/fonts/system_font.font"
|
||||||
}
|
}
|
||||||
background_color {
|
background_color {
|
||||||
x: 0.0
|
x: 0.0
|
||||||
@ -47,8 +47,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/button.gui"
|
template: "/dirtylarry/button.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -104,10 +102,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -172,10 +166,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -215,8 +205,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/button.gui"
|
template: "/dirtylarry/button.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -273,10 +261,6 @@ nodes {
|
|||||||
overridden_fields: 4
|
overridden_fields: 4
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -341,10 +325,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -380,7 +360,7 @@ nodes {
|
|||||||
type: TYPE_TEXT
|
type: TYPE_TEXT
|
||||||
blend_mode: BLEND_MODE_ALPHA
|
blend_mode: BLEND_MODE_ALPHA
|
||||||
text: "<text>"
|
text: "<text>"
|
||||||
font: "default"
|
font: "system_font"
|
||||||
id: "log"
|
id: "log"
|
||||||
xanchor: XANCHOR_NONE
|
xanchor: XANCHOR_NONE
|
||||||
yanchor: YANCHOR_NONE
|
yanchor: YANCHOR_NONE
|
||||||
@ -407,10 +387,6 @@ nodes {
|
|||||||
template_node_child: false
|
template_node_child: false
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -450,8 +426,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/button.gui"
|
template: "/dirtylarry/button.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -507,10 +481,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -575,10 +545,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -618,8 +584,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/button.gui"
|
template: "/dirtylarry/button.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -675,10 +639,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -743,10 +703,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -786,8 +742,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/button.gui"
|
template: "/dirtylarry/button.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -844,10 +798,6 @@ nodes {
|
|||||||
overridden_fields: 4
|
overridden_fields: 4
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -912,10 +862,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -955,8 +901,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/button.gui"
|
template: "/dirtylarry/button.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1012,10 +956,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1080,10 +1020,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1123,8 +1059,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/button.gui"
|
template: "/dirtylarry/button.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1181,10 +1115,6 @@ nodes {
|
|||||||
overridden_fields: 4
|
overridden_fields: 4
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1249,10 +1179,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1292,8 +1218,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/checkbox_label.gui"
|
template: "/dirtylarry/checkbox_label.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1349,10 +1273,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1417,10 +1337,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1460,8 +1376,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template: "/dirtylarry/checkbox_label.gui"
|
template: "/dirtylarry/checkbox_label.gui"
|
||||||
template_node_child: false
|
template_node_child: false
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1517,10 +1431,6 @@ nodes {
|
|||||||
alpha: 1.0
|
alpha: 1.0
|
||||||
template_node_child: true
|
template_node_child: true
|
||||||
size_mode: SIZE_MODE_MANUAL
|
size_mode: SIZE_MODE_MANUAL
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
@ -1585,10 +1495,6 @@ nodes {
|
|||||||
template_node_child: true
|
template_node_child: true
|
||||||
text_leading: 1.0
|
text_leading: 1.0
|
||||||
text_tracking: 0.0
|
text_tracking: 0.0
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
material: ""
|
|
||||||
}
|
}
|
||||||
material: "/builtins/materials/gui.material"
|
material: "/builtins/materials/gui.material"
|
||||||
adjust_reference: ADJUST_REFERENCE_PARENT
|
adjust_reference: ADJUST_REFERENCE_PARENT
|
||||||
|
@ -44,13 +44,7 @@ end
|
|||||||
|
|
||||||
local function buy(id)
|
local function buy(id)
|
||||||
log("iap.buy() " .. id)
|
log("iap.buy() " .. id)
|
||||||
local options = {}
|
iap.buy(id)
|
||||||
local item = available_items[id]
|
|
||||||
if item.subscriptions then
|
|
||||||
local subscription = item.subscriptions[1]
|
|
||||||
options.token = subscription.token
|
|
||||||
end
|
|
||||||
iap.buy(id, options)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function restore()
|
local function restore()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user