Skip to content

Commit

Permalink
Update do Godot 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Shin-NiL committed Apr 23, 2021
1 parent 3eafd68 commit 6e98b23
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 49 deletions.
6 changes: 6 additions & 0 deletions admob-plugin/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions admob-plugin/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admob-plugin/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admob-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.1.3'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions admob-plugin/godotadmob/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'

ext.pluginVersionCode = 3
ext.pluginVersionName = "4.1.1"
ext.pluginVersionCode = 4
ext.pluginVersionName = "5.0.0"

android {
compileSdkVersion 29
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.godotengine.godot.Godot;
import org.godotengine.godot.plugin.GodotPlugin;
import org.godotengine.godot.plugin.SignalInfo;
import org.godotengine.godot.plugin.UsedByGodot;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
Expand Down Expand Up @@ -46,7 +47,7 @@ public class GodotAdMob extends GodotPlugin {

public GodotAdMob(Godot godot) {
super(godot);
activity = godot;
this.activity = getActivity();
}

// create and add a new layout to Godot
Expand All @@ -62,20 +63,6 @@ public String getPluginName() {
return "GodotAdMob";
}

@NonNull
@Override
public List<String> getPluginMethods() {
return Arrays.asList(
"init",
"initWithContentRating",
// banner
"loadBanner", "showBanner", "hideBanner", "getBannerWidth", "getBannerHeight", "resize", "move",
// Interstitial
"loadInterstitial", "showInterstitial",
// Rewarded video
"loadRewardedVideo", "showRewardedVideo");
}

@NonNull
@Override
public Set<SignalInfo> getPluginSignals() {
Expand All @@ -84,12 +71,10 @@ public Set<SignalInfo> getPluginSignals() {
signals.add(new SignalInfo("on_admob_ad_loaded"));
signals.add(new SignalInfo("on_admob_banner_failed_to_load", Integer.class));


signals.add(new SignalInfo("on_interstitial_loaded"));
signals.add(new SignalInfo("on_interstitial_failed_to_load", Integer.class));
signals.add(new SignalInfo("on_interstitial_close"));


signals.add(new SignalInfo("on_rewarded_video_ad_left_application"));
signals.add(new SignalInfo("on_rewarded_video_ad_closed"));
signals.add(new SignalInfo("on_rewarded_video_ad_failed_to_load", Integer.class));
Expand All @@ -110,6 +95,7 @@ public Set<SignalInfo> getPluginSignals() {
*
* @param isReal Tell if the enviroment is for real or test
*/
@UsedByGodot
public void init(boolean isReal) {
this.initWithContentRating(isReal, false, true, "");
}
Expand All @@ -125,6 +111,7 @@ public void init(boolean isReal) {
* ad personalization.
* @param maxAdContentRating must be "G", "PG", "T" or "MA"
*/
@UsedByGodot
public void initWithContentRating(
boolean isReal,
boolean isForChildDirectedTreatment,
Expand Down Expand Up @@ -202,6 +189,7 @@ private AdRequest getAdRequest() {
*
* @param id AdMod Rewarded video ID
*/
@UsedByGodot
public void loadRewardedVideo(final String id) {
activity.runOnUiThread(new Runnable() {
@Override
Expand Down Expand Up @@ -255,6 +243,7 @@ public void onRewardedVideoCompleted() {
/**
* Show a Rewarded Video
*/
@UsedByGodot
public void showRewardedVideo() {
activity.runOnUiThread(new Runnable() {
@Override
Expand All @@ -277,6 +266,7 @@ public void run() {
* @param id AdMod Banner ID
* @param isOnTop To made the banner top or bottom
*/
@UsedByGodot
public void loadBanner(final String id, final boolean isOnTop, final String bannerSize) {
activity.runOnUiThread(new Runnable() {
@Override
Expand All @@ -300,6 +290,7 @@ public void onBannerFailedToLoad(int errorCode) {
/**
* Show the banner
*/
@UsedByGodot
public void showBanner() {
activity.runOnUiThread(new Runnable() {
@Override
Expand All @@ -315,6 +306,7 @@ public void run() {
* Resize the banner
* @param isOnTop To made the banner top or bottom
*/
@UsedByGodot
public void move(final boolean isOnTop) {
activity.runOnUiThread(new Runnable() {
@Override
Expand All @@ -329,6 +321,7 @@ public void run() {
/**
* Resize the banner
*/
@UsedByGodot
public void resize() {
activity.runOnUiThread(new Runnable() {
@Override
Expand All @@ -344,6 +337,7 @@ public void run() {
/**
* Hide the banner
*/
@UsedByGodot
public void hideBanner() {
activity.runOnUiThread(new Runnable() {
@Override
Expand All @@ -360,6 +354,7 @@ public void run() {
*
* @return int Banner width
*/
@UsedByGodot
public int getBannerWidth() {
if (banner != null) {
return banner.getWidth();
Expand All @@ -372,6 +367,7 @@ public int getBannerWidth() {
*
* @return int Banner height
*/
@UsedByGodot
public int getBannerHeight() {
if (banner != null) {
return banner.getHeight();
Expand All @@ -387,6 +383,7 @@ public int getBannerHeight() {
*
* @param id AdMod Interstitial ID
*/
@UsedByGodot
public void loadInterstitial(final String id) {
activity.runOnUiThread(new Runnable() {
@Override
Expand Down Expand Up @@ -426,6 +423,7 @@ public void onInterstitialClosed() {
/**
* Show the interstitial
*/
@UsedByGodot
public void showInterstitial() {
activity.runOnUiThread(new Runnable() {
@Override
Expand Down
4 changes: 2 additions & 2 deletions admob-plugin/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Jun 13 09:42:50 BRT 2020
#Fri Apr 23 18:11:41 BRT 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
2 changes: 1 addition & 1 deletion config/GodotAdMob.gdap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name="GodotAdMob"
binary_type="local"
binary="GodotAdMob.4.1.1.release.aar"
binary="GodotAdMob.5.0.0.release.aar"

[dependencies]

Expand Down
45 changes: 22 additions & 23 deletions demo/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,50 @@ export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.0.options]

graphics/32_bits_framebuffer=true
xr_features/xr_mode=0
xr_features/degrees_of_freedom=0
xr_features/hand_tracking=0
xr_features/focus_awareness=false
one_click_deploy/clear_previous_install=true
custom_template/debug=""
custom_template/release=""
custom_template/use_custom_build=true
custom_template/export_format=0
plugins/GodotAdMob=true
command_line/extra_args=""
architectures/armeabi-v7a=true
architectures/arm64-v8a=false
architectures/x86=true
architectures/x86_64=false
keystore/debug=""
keystore/debug_user=""
keystore/debug_password=""
keystore/release=""
keystore/release_user=""
keystore/release_password=""
one_click_deploy/clear_previous_install=true
version/code=1
version/name="1.0"
package/unique_name="org.godotengine.$genname"
package/name=""
package/signed=true
launcher_icons/main_192x192=""
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
graphics/32_bits_framebuffer=true
graphics/opengl_debug=false
xr_features/xr_mode=0
xr_features/degrees_of_freedom=0
xr_features/hand_tracking=0
xr_features/focus_awareness=false
screen/immersive_mode=true
screen/orientation=0
screen/support_small=true
screen/support_normal=true
screen/support_large=true
screen/support_xlarge=true
screen/opengl_debug=false
launcher_icons/main_192x192=""
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
keystore/debug=""
keystore/debug_user=""
keystore/debug_password=""
keystore/release=""
keystore/release_user=""
keystore/release_password=""
command_line/extra_args=""
apk_expansion/enable=false
apk_expansion/SALT=""
apk_expansion/public_key=""
architectures/armeabi-v7a=true
architectures/arm64-v8a=false
architectures/x86=false
architectures/x86_64=false
permissions/custom_permissions=PoolStringArray( )
permissions/access_checkin_properties=false
permissions/access_coarse_location=false
Expand Down
3 changes: 1 addition & 2 deletions demo/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,11 @@ script = ExtResource( 2 )
__meta__ = {
"_editor_description_": ""
}
banner_size = "ADAPTIVE_BANNER"
banner_id = "ca-app-pub-3940256099942544/6300978111"
interstitial_id = "ca-app-pub-3940256099942544/1033173712"
rewarded_id = "ca-app-pub-3940256099942544/5224354917"
is_personalized = false
max_ad_content_rate = "G"

[connection signal="pressed" from="CanvasLayer/BtnReload" to="." method="_on_BtnReload_pressed"]
[connection signal="pressed" from="CanvasLayer/BtnInterstitial" to="." method="_on_BtnInterstitial_pressed"]
[connection signal="pressed" from="CanvasLayer/BtnBannerResize" to="." method="_on_BtnBannerResize_pressed"]
Expand Down

0 comments on commit 6e98b23

Please sign in to comment.