@@ -11,24 +11,24 @@ public enum PurchaseType
11
11
12
12
public partial class GooglePlayBilling : Node
13
13
{
14
- [ Signal ] public delegate void Connected ( ) ;
15
- [ Signal ] public delegate void Disconnected ( ) ;
16
- [ Signal ] public delegate void ConnectError ( int code , string message ) ;
17
- [ Signal ] public delegate void SkuDetailsQueryCompleted ( Array skuDetails ) ;
18
- [ Signal ] public delegate void SkuDetailsQueryError ( int code , string message , string [ ] querySkuDetails ) ;
19
- [ Signal ] public delegate void PurchasesUpdated ( Array purchases ) ;
20
- [ Signal ] public delegate void PurchaseError ( int code , string message ) ;
21
- [ Signal ] public delegate void PurchaseAcknowledged ( string purchaseToken ) ;
22
- [ Signal ] public delegate void PurchaseAcknowledgementError ( int code , string message ) ;
23
- [ Signal ] public delegate void PurchaseConsumed ( string purchaseToken ) ;
24
- [ Signal ] public delegate void PurchaseConsumptionError ( int code , string message , string purchaseToken ) ;
14
+ [ Signal ] public delegate void ConnectedEventHandler ( ) ;
15
+ [ Signal ] public delegate void DisconnectedEventHandler ( ) ;
16
+ [ Signal ] public delegate void ConnectErrorEventHandler ( int code , string message ) ;
17
+ [ Signal ] public delegate void SkuDetailsQueryCompletedEventHandler ( Array skuDetails ) ;
18
+ [ Signal ] public delegate void SkuDetailsQueryErrorEventHandler ( int code , string message , string [ ] querySkuDetails ) ;
19
+ [ Signal ] public delegate void PurchasesUpdatedEventHandler ( Array purchases ) ;
20
+ [ Signal ] public delegate void PurchaseErrorEventHandler ( int code , string message ) ;
21
+ [ Signal ] public delegate void PurchaseAcknowledgedEventHandler ( string purchaseToken ) ;
22
+ [ Signal ] public delegate void PurchaseAcknowledgementErrorEventHandler ( int code , string message ) ;
23
+ [ Signal ] public delegate void PurchaseConsumedEventHandler ( string purchaseToken ) ;
24
+ [ Signal ] public delegate void PurchaseConsumptionErrorEventHandler ( int code , string message , string purchaseToken ) ;
25
25
26
26
[ Export ] public bool AutoReconnect { get ; set ; }
27
27
[ Export ] public bool AutoConnect { get ; set ; }
28
28
29
29
public bool IsAvailable { get ; private set ; }
30
30
31
- private Object _payment ;
31
+ private GodotObject _payment ;
32
32
33
33
public override void _Ready ( )
34
34
{
@@ -38,17 +38,17 @@ public override void _Ready()
38
38
_payment = Engine . GetSingleton ( "GodotGooglePlayBilling" ) ;
39
39
// These are all signals supported by the API
40
40
// You can drop some of these based on your needs
41
- _payment . Connect ( "connected" , this , nameof ( OnGodotGooglePlayBilling_connected ) ) ; // No params
42
- _payment . Connect ( "disconnected" , this , nameof ( OnGodotGooglePlayBilling_disconnected ) ) ; // No params
43
- _payment . Connect ( "connect_error" , this , nameof ( OnGodotGooglePlayBilling_connect_error ) ) ; // Response ID (int), Debug message (string)
44
- _payment . Connect ( "sku_details_query_completed" , this , nameof ( OnGodotGooglePlayBilling_sku_details_query_completed ) ) ; // SKUs (Array of Dictionary)
45
- _payment . Connect ( "sku_details_query_error" , this , nameof ( OnGodotGooglePlayBilling_sku_details_query_error ) ) ; // Response ID (int), Debug message (string), Queried SKUs (string[])
46
- _payment . Connect ( "purchases_updated" , this , nameof ( OnGodotGooglePlayBilling_purchases_updated ) ) ; // Purchases (Array of Dictionary)
47
- _payment . Connect ( "purchase_error" , this , nameof ( OnGodotGooglePlayBilling_purchase_error ) ) ; // Response ID (int), Debug message (string)
48
- _payment . Connect ( "purchase_acknowledged" , this , nameof ( OnGodotGooglePlayBilling_purchase_acknowledged ) ) ; // Purchase token (string)
49
- _payment . Connect ( "purchase_acknowledgement_error" , this , nameof ( OnGodotGooglePlayBilling_purchase_acknowledgement_error ) ) ; // Response ID (int), Debug message (string), Purchase token (string)
50
- _payment . Connect ( "purchase_consumed" , this , nameof ( OnGodotGooglePlayBilling_purchase_consumed ) ) ; // Purchase token (string)
51
- _payment . Connect ( "purchase_consumption_error" , this , nameof ( OnGodotGooglePlayBilling_purchase_consumption_error ) ) ; // Response ID (int), Debug message (string), Purchase token (string)
41
+ _payment . Connect ( SignalName . Connected , Callable . From ( OnGodotGooglePlayBilling_connected ) ) ; // No params
42
+ _payment . Connect ( SignalName . Disconnected , Callable . From ( OnGodotGooglePlayBilling_disconnected ) ) ; // No params
43
+ _payment . Connect ( SignalName . ConnectError , Callable . From < int , string > ( OnGodotGooglePlayBilling_connect_error ) ) ; // Response ID (int), Debug message (string)
44
+ _payment . Connect ( SignalName . SkuDetailsQueryCompleted , Callable . From < Array > ( OnGodotGooglePlayBilling_sku_details_query_completed ) ) ; // SKUs (Array of Dictionary)
45
+ _payment . Connect ( SignalName . SkuDetailsQueryError , Callable . From < int , string , string [ ] > ( OnGodotGooglePlayBilling_sku_details_query_error ) ) ; // Response ID (int), Debug message (string), Queried SKUs (string[])
46
+ _payment . Connect ( SignalName . PurchasesUpdated , Callable . From < Array > ( OnGodotGooglePlayBilling_purchases_updated ) ) ; // Purchases (Array of Dictionary)
47
+ _payment . Connect ( SignalName . PurchaseError , Callable . From < int , string > ( OnGodotGooglePlayBilling_purchase_error ) ) ; // Response ID (int), Debug message (string)
48
+ _payment . Connect ( SignalName . PurchaseAcknowledged , Callable . From < string > ( OnGodotGooglePlayBilling_purchase_acknowledged ) ) ; // Purchase token (string)
49
+ _payment . Connect ( SignalName . PurchaseAcknowledgementError , Callable . From < int , string > ( OnGodotGooglePlayBilling_purchase_acknowledgement_error ) ) ; // Response ID (int), Debug message (string), Purchase token (string)
50
+ _payment . Connect ( SignalName . PurchaseConsumed , Callable . From < string > ( OnGodotGooglePlayBilling_purchase_consumed ) ) ; // Purchase token (string)
51
+ _payment . Connect ( SignalName . PurchaseConsumptionError , Callable . From < int , string , string > ( OnGodotGooglePlayBilling_purchase_consumption_error ) ) ; // Response ID (int), Debug message (string), Purchase token (string)
52
52
}
53
53
else
54
54
{
@@ -64,7 +64,7 @@ public override void _Ready()
64
64
65
65
public void QuerySkuDetails ( string [ ] querySkuDetails , PurchaseType type ) => _payment ? . Call ( "querySkuDetails" , querySkuDetails , $ "{ type } ". ToLower ( ) ) ;
66
66
67
- public bool IsReady ( ) => ( _payment ? . Call ( "isReady" ) as bool ? ) ?? false ;
67
+ public bool IsReady ( ) => _payment ? . Call ( "isReady" ) . AsBool ( ) ?? false ;
68
68
69
69
public void AcknowledgePurchase ( string purchaseToken ) => _payment ? . Call ( "acknowledgePurchase" , purchaseToken ) ;
70
70
0 commit comments