This commit is contained in:
Yadciel
2022-11-24 16:00:50 +01:00
parent 6ca7cd7650
commit 46fbe6685b
120 changed files with 4206 additions and 0 deletions

1
addons/admob/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.zip

21
addons/admob/LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Poing Studios
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/android.png-fb2caea48032eea3d74244daf04c3454.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/admob/assets/android.png"
dest_files=[ "res://.import/android.png-fb2caea48032eea3d74244daf04c3454.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon-1024.png-2958e8f3e03f08146a840475cdd3cd61.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/admob/assets/icon-1024.png"
dest_files=[ "res://.import/icon-1024.png-2958e8f3e03f08146a840475cdd3cd61.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon-120.png-f1130a47a81f19626ca0e688a5d38d3a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/admob/assets/icon-120.png"
dest_files=[ "res://.import/icon-120.png-f1130a47a81f19626ca0e688a5d38d3a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon-15.png-befc05bf38293c8cfe2bd393c6e153c6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/admob/assets/icon-15.png"
dest_files=[ "res://.import/icon-15.png-befc05bf38293c8cfe2bd393c6e153c6.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon-500.png-551469a97496c83ff13bc47c2b1cdefa.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/admob/assets/icon-500.png"
dest_files=[ "res://.import/icon-500.png-551469a97496c83ff13bc47c2b1cdefa.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon-76.png-81101785e7e41d0daa72dddaf6f4956f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/admob/assets/icon-76.png"
dest_files=[ "res://.import/icon-76.png-81101785e7e41d0daa72dddaf6f4956f.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
addons/admob/assets/ios.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/ios.png-09946c77d84d877ee235a3ef7222fc0c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/admob/assets/ios.png"
dest_files=[ "res://.import/ios.png-09946c77d84d877ee235a3ef7222fc0c.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

View File

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/music.ogg-6849ed60109f01916f243ace862e95fb.oggstr"
[deps]
source_file="res://addons/admob/assets/music.ogg"
dest_files=[ "res://.import/music.ogg-6849ed60109f01916f243ace862e95fb.oggstr" ]
[params]
loop=true
loop_offset=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/poing.jpeg-b1ae7a0b5e3bb646b5b1cf5ae07e3b86.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/admob/assets/poing.jpeg"
dest_files=[ "res://.import/poing.jpeg-b1ae7a0b5e3bb646b5b1cf5ae07e3b86.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

View File

7
addons/admob/plugin.cfg Normal file
View File

@ -0,0 +1,7 @@
[plugin]
name="AdMob"
description="The AdMob of Plugin for Android and iOS."
author="Poing Studios"
version="1.3.2"
script="src/core/AdMob.gd"

View File

@ -0,0 +1,27 @@
tool
extends EditorPlugin
var AdMobEditor : Control
func _enter_tree():
add_autoload_singleton("MobileAds", "res://addons/admob/src/singletons/MobileAds.gd")
AdMobEditor = load("res://addons/admob/src/core/AdMobEditor.tscn").instance()
get_editor_interface().get_editor_viewport().add_child(AdMobEditor)
AdMobEditor.hide()
func _exit_tree():
remove_autoload_singleton("MobileAds")
get_editor_interface().get_editor_viewport().remove_child(AdMobEditor)
AdMobEditor.queue_free()
func has_main_screen():
return true
func make_visible(visible):
AdMobEditor.visible = visible
func get_plugin_name():
return "AdMob"
func get_plugin_icon():
return load("res://addons/admob/assets/icon-15.png")

View File

@ -0,0 +1,16 @@
tool
extends Control
var AdMobSettings = preload("res://addons/admob/src/utils/AdMobSettings.gd").new()
func _on_AndroidButton_pressed():
OS.shell_open("https://github.com/Poing-Studios/godot-admob-android#installation")
func _on_iOSButton_pressed():
OS.shell_open("https://github.com/Poing-Studios/godot-admob-ios#installation")
func _on_AdMobButton_pressed():
OS.shell_open("https://github.com/Poing-Studios/godot-admob-editor")
func _on_PoingButton_pressed():
OS.shell_open("https://github.com/Poing-Studios")

View File

@ -0,0 +1,244 @@
[gd_scene load_steps=23 format=2]
[ext_resource path="res://addons/admob/assets/android.png" type="Texture" id=1]
[ext_resource path="res://addons/admob/assets/poing.jpeg" type="Texture" id=2]
[ext_resource path="res://addons/admob/assets/fonts/arial.ttf" type="DynamicFontData" id=3]
[ext_resource path="res://addons/admob/src/core/AdMobEditor.gd" type="Script" id=4]
[ext_resource path="res://addons/admob/assets/ios.png" type="Texture" id=5]
[ext_resource path="res://addons/admob/assets/icon-76.png" type="Texture" id=6]
[ext_resource path="res://addons/admob/src/core/components/ad_format/BannerAdFormat.tscn" type="PackedScene" id=7]
[ext_resource path="res://addons/admob/src/core/components/General.tscn" type="PackedScene" id=8]
[ext_resource path="res://addons/admob/src/core/components/ad_format/InterstitialAdFormat.tscn" type="PackedScene" id=9]
[ext_resource path="res://addons/admob/src/core/components/ad_format/RewardedAdFormat.tscn" type="PackedScene" id=10]
[ext_resource path="res://addons/admob/src/core/components/ad_format/RewardedInterstitialAdFormat.tscn" type="PackedScene" id=11]
[ext_resource path="res://addons/admob/src/core/components/Downloads.tscn" type="PackedScene" id=12]
[ext_resource path="res://addons/admob/src/core/components/Debug.tscn" type="PackedScene" id=13]
[ext_resource path="res://addons/admob/src/core/SupportVersion.gd" type="Script" id=14]
[ext_resource path="res://addons/admob/src/core/CurrentVersion.gd" type="Script" id=15]
[ext_resource path="res://addons/admob/src/core/VersionSupportedHTTPRequest.tscn" type="PackedScene" id=16]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.839216, 0.0352941, 0.0352941, 1 )
[sub_resource type="DynamicFont" id=2]
size = 30
use_filter = true
font_data = ExtResource( 3 )
[sub_resource type="DynamicFont" id=4]
size = 20
use_filter = true
font_data = ExtResource( 3 )
[sub_resource type="StyleBoxFlat" id=3]
bg_color = Color( 1, 0.772549, 0, 1 )
[sub_resource type="DynamicFont" id=6]
size = 20
outline_size = 1
outline_color = Color( 0, 0, 0, 1 )
use_filter = true
font_data = ExtResource( 3 )
[sub_resource type="StyleBoxFlat" id=5]
bg_color = Color( 0.172549, 0.568627, 0.992157, 1 )
[node name="AdMobEditor" type="Control"]
pause_mode = 2
anchor_right = 1.0
anchor_bottom = 1.0
rect_clip_content = true
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 4 )
[node name="TopPanel" type="Panel" parent="."]
anchor_right = 1.0
margin_bottom = 40.0
rect_min_size = Vector2( 0, 35 )
custom_styles/panel = SubResource( 1 )
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false
}
[node name="Description" type="Label" parent="TopPanel"]
anchor_right = 1.0
margin_right = -401.4
margin_bottom = 40.0
custom_fonts/font = SubResource( 2 )
text = "AdMob Editor"
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Icons" type="Control" parent="TopPanel"]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -395.4
margin_right = 0.600037
margin_bottom = 40.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AndroidButton" type="TextureButton" parent="TopPanel/Icons"]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -158.6
margin_right = -118.6
margin_bottom = 40.0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 1 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="iOSButton" type="TextureButton" parent="TopPanel/Icons"]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -118.145
margin_right = -78.1449
margin_bottom = 40.0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 5 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AdMobButton" type="TextureButton" parent="TopPanel/Icons"]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -79.9999
margin_right = -39.9999
margin_bottom = 40.0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 6 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PoingButton" type="TextureButton" parent="TopPanel/Icons"]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -40.0
margin_bottom = 40.0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 2 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MiddleScrollContainer" type="ScrollContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 40.0
margin_right = 6.10352e-05
margin_bottom = -34.9996
__meta__ = {
"_edit_lock_": true
}
[node name="TabContainer" type="TabContainer" parent="MiddleScrollContainer"]
margin_right = 600.0
margin_bottom = 949.0
size_flags_horizontal = 3
size_flags_vertical = 3
tab_align = 0
[node name="General" parent="MiddleScrollContainer/TabContainer" instance=ExtResource( 8 )]
[node name="Debug" parent="MiddleScrollContainer/TabContainer" instance=ExtResource( 13 )]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="Banner" parent="MiddleScrollContainer/TabContainer" instance=ExtResource( 7 )]
visible = false
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="Interstitial" parent="MiddleScrollContainer/TabContainer" instance=ExtResource( 9 )]
visible = false
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="Rewarded" parent="MiddleScrollContainer/TabContainer" instance=ExtResource( 10 )]
visible = false
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="RewardedInterstitial" parent="MiddleScrollContainer/TabContainer" instance=ExtResource( 11 )]
visible = false
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="Downloads" parent="MiddleScrollContainer/TabContainer" instance=ExtResource( 12 )]
visible = false
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="BottomPanel" type="Panel" parent="."]
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = -35.0
rect_min_size = Vector2( 0, 35 )
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false
}
[node name="SupportVersion" type="RichTextLabel" parent="BottomPanel"]
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = -35.0
margin_right = -158.0
custom_fonts/normal_font = SubResource( 4 )
custom_styles/normal = SubResource( 3 )
bbcode_enabled = true
bbcode_text = "[rainbow sat=10]iOS[/rainbow][color=black]:v2.1.0[/color] [rainbow sat=10]Android[/rainbow][color=black]:v2.1.0[/color]"
text = "iOS:v2.1.0 Android:v2.1.0"
script = ExtResource( 14 )
[node name="VersionSupportedHTTPRequest" parent="BottomPanel/SupportVersion" instance=ExtResource( 16 )]
[node name="CurrentVersion" type="Label" parent="BottomPanel"]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -158.0
margin_top = -35.0
rect_min_size = Vector2( 0, 35 )
custom_fonts/font = SubResource( 6 )
custom_styles/normal = SubResource( 5 )
text = "Version: 1.3.0"
align = 2
script = ExtResource( 15 )
[connection signal="pressed" from="TopPanel/Icons/AndroidButton" to="." method="_on_AndroidButton_pressed"]
[connection signal="pressed" from="TopPanel/Icons/iOSButton" to="." method="_on_iOSButton_pressed"]
[connection signal="pressed" from="TopPanel/Icons/AdMobButton" to="." method="_on_AdMobButton_pressed"]
[connection signal="pressed" from="TopPanel/Icons/PoingButton" to="." method="_on_PoingButton_pressed"]

View File

@ -0,0 +1,7 @@
tool
extends Label
var AdMobGlobals = preload("res://addons/admob/src/utils/AdMobGlobals.gd")
func _ready():
text = "Version: " + AdMobGlobals.get_plugin_version()

View File

@ -0,0 +1,8 @@
tool
extends RichTextLabel
var support_version_text = "[rainbow sat=10]iOS[/rainbow][color=black]:%s[/color] [rainbow sat=10]Android[/rainbow][color=black]:%s[/color]"
func _on_VersionSupportedHTTPRequest_supported_version_changed(value_dictionary):
bbcode_text = support_version_text % [value_dictionary.ios, value_dictionary.android]

View File

@ -0,0 +1,16 @@
tool
extends HTTPRequest
signal supported_version_changed(value_dictionary)
var AdMobGlobals = preload("res://addons/admob/src/utils/AdMobGlobals.gd")
func _ready():
request("https://gist.githubusercontent.com/gumaciel/ba15bd85ebcc87866c24a819de37cc9a/raw/admob_editor_versions_supported.json")
func _on_VersionSupportedHTTPRequest_request_completed(result, response_code, headers, body):
var json = JSON.parse(body.get_string_from_utf8())
var version_support : Dictionary = json.result[AdMobGlobals.get_plugin_version()]
emit_signal("supported_version_changed", version_support)

View File

@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/admob/src/core/VersionSupportedHTTPRequest.gd" type="Script" id=1]
[node name="VersionSupportedHTTPRequest" type="HTTPRequest"]
script = ExtResource( 1 )
[connection signal="request_completed" from="." to="." method="_on_VersionSupportedHTTPRequest_request_completed"]

View File

@ -0,0 +1,29 @@
tool
extends VBoxContainer
onready var AdMobEditor : Control = find_parent("AdMobEditor")
onready var DebugOnRelease : Control = $TabContainer/Release/DebugOnRelease
onready var IsReal : Control = $TabContainer/Release/IsReal
onready var TestEuropeUserConsent : Control = $TabContainer/General/TestEuropeUserConsent
func _ready():
DebugOnRelease.pressed = AdMobEditor.AdMobSettings.config.debug.is_debug_on_release
IsReal.pressed = AdMobEditor.AdMobSettings.config.debug.is_real
TestEuropeUserConsent.pressed = AdMobEditor.AdMobSettings.config.debug.is_test_europe_user_consent
IsReal.disabled = not DebugOnRelease.pressed
func _on_DebugOnRelease_pressed():
AdMobEditor.AdMobSettings.config.debug.is_debug_on_release = DebugOnRelease.pressed
if DebugOnRelease.pressed:
IsReal.disabled = false
else:
IsReal.disabled = true
func _on_IsReal_pressed():
AdMobEditor.AdMobSettings.config.debug.is_real = IsReal.pressed
func _on_TestEuropeUserConsent_pressed():
AdMobEditor.AdMobSettings.config.debug.is_test_europe_user_consent = TestEuropeUserConsent.pressed

View File

@ -0,0 +1,68 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/admob/src/core/components/Debug.gd" type="Script" id=1]
[node name="Debug" type="VBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
script = ExtResource( 1 )
[node name="TabContainer" type="TabContainer" parent="."]
margin_right = 151.0
margin_bottom = 582.0
tab_align = 0
[node name="General" type="VBoxContainer" parent="TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="TestEuropeUserConsent" type="CheckBox" parent="TabContainer/General"]
margin_right = 193.0
margin_bottom = 24.0
text = "Test Europe User Consent"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Release" type="VBoxContainer" parent="TabContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="DebugOnRelease" type="CheckBox" parent="TabContainer/Release"]
margin_right = 143.0
margin_bottom = 24.0
text = "Debug on Release"
[node name="IsReal" type="CheckBox" parent="TabContainer/Release"]
margin_top = 28.0
margin_right = 143.0
margin_bottom = 52.0
disabled = true
pressed = true
text = "Is Real"
[node name="Advice" type="Label" parent="TabContainer/Release"]
margin_top = 56.0
margin_right = 143.0
margin_bottom = 546.0
text = "Advice: `Is Real` will ALWAYS be true unless `Debug on Release` is true.
So if `Debug on Release` is true it will consider the value of `Is Real` on this page when the game is exported as \"Release\".
In other words, you don't need to change anything on this page as it may cause bugs in your app once it's in the store.
Note: The `Test Europe User Consent` button even if it is true, when the application goes to production, that value will be false IF `Debug on Release` is false."
autowrap = true
[connection signal="pressed" from="TabContainer/General/TestEuropeUserConsent" to="." method="_on_TestEuropeUserConsent_pressed"]
[connection signal="pressed" from="TabContainer/Release/DebugOnRelease" to="." method="_on_DebugOnRelease_pressed"]
[connection signal="pressed" from="TabContainer/Release/IsReal" to="." method="_on_IsReal_pressed"]

View File

@ -0,0 +1,184 @@
tool
extends VBoxContainer
onready var AdMobEditor : Control = find_parent("AdMobEditor")
onready var godot_version : String = "v" + String(Engine.get_version_info().major) + "." + String(Engine.get_version_info().minor) + "." + String(Engine.get_version_info().patch)
var actual_downloading_file : String = ""
var downloaded_plugin_version : String = ""
var version_support : Dictionary
var android_dictionary : Dictionary = {
"version" : ["CURRENT"],
"download_directory" : "res://addons/admob/downloads/android"
} setget set_android_dictionary
var ios_dictionary : Dictionary = {
"version" : ["CURRENT"],
"download_directory" : "res://addons/admob/downloads/ios"
} setget set_ios_dictionary
var current_dir_download_label = "Current Download Directory: %s"
var download_complete_message = "Download of %s completed! \n%s"
func set_android_dictionary(value):
android_dictionary = value
$TabContainer/Android/ChangeDirectoryHBoxContainer/DownloadDirectoryLabel.text = current_dir_download_label % android_dictionary.download_directory
func set_ios_dictionary(value):
ios_dictionary = value
$TabContainer/iOS/ChangeDirectoryHBoxContainer/DownloadDirectoryLabel.text = current_dir_download_label % ios_dictionary.download_directory
func _ready():
$DontHaveConnectionPanelContainer/Label.text %= $VerifyNetworkGithub.server_to_test
if godot_version[godot_version.length()-1] == "0":
godot_version = godot_version.substr(0, godot_version.length()-2)
set_process(false)
set_version_platform_supported("ios")
set_version_platform_supported("android")
$TabContainer/Android/ChangeDirectoryHBoxContainer/DownloadDirectoryLabel.text = current_dir_download_label % android_dictionary.download_directory
$TabContainer/iOS/ChangeDirectoryHBoxContainer/DownloadDirectoryLabel.text = current_dir_download_label % ios_dictionary.download_directory
func set_version_platform_supported(platform):
if platform == "android":
$TabContainer/Android/VersionHBoxContainer/AndroidVersion.clear()
for i in android_dictionary.version:
$TabContainer/Android/VersionHBoxContainer/AndroidVersion.add_item(i)
elif platform == "ios":
$TabContainer/iOS/VersionHBoxContainer/iOSVersion.clear()
for i in ios_dictionary.version:
$TabContainer/iOS/VersionHBoxContainer/iOSVersion.add_item(i)
func _process(delta):
var bodySize = $TabContainer/HTTPRequest.get_body_size()
var downloadedBytes = $TabContainer/HTTPRequest.get_downloaded_bytes()
var percent = int(downloadedBytes*100/bodySize)
$ProgressBar.value = percent
func _on_HTTPRequest_request_completed(result, response_code, headers, body):
if response_code != 200:
$AdviceAcceptDialog.dialog_text = "!!!DOWNLOAD FAILED!!!"
$ProgressBar.value = 0
else:
$AdviceAcceptDialog.dialog_text = download_complete_message % [actual_downloading_file, downloaded_plugin_version]
set_process(false)
$AdviceAcceptDialog.popup_centered()
func _on_DownloadGoogleMobileAdsSdkiOS_pressed():
var file_name = "googlemobileadssdkios.zip"
var plugin_version = version_support.ios
$TabContainer/HTTPRequest.download_file = ios_dictionary.download_directory + "/" + file_name
$TabContainer/HTTPRequest.request("https://github.com/Poing-Studios/godot-admob-ios/releases/download/" + plugin_version + "/" + file_name)
actual_downloading_file = file_name
downloaded_plugin_version = "iOS Plugin Version: " + plugin_version
set_process(true)
func _on_DownloadiOSTemplate_pressed():
var ios_version = $TabContainer/iOS/VersionHBoxContainer/iOSVersion.text
if ios_version == "CURRENT":
ios_version = godot_version
var file_name = "ios-template-" + ios_version + ".zip"
var plugin_version = version_support.ios
$TabContainer/HTTPRequest.download_file = ios_dictionary.download_directory + "/" + file_name
$TabContainer/HTTPRequest.request("https://github.com/Poing-Studios/godot-admob-ios/releases/download/" + plugin_version + "/" + file_name)
actual_downloading_file = file_name
downloaded_plugin_version = "iOS Plugin Version: " + plugin_version
set_process(true)
func _on_DownloadAndroidTemplate_pressed():
var android_version = $TabContainer/Android/VersionHBoxContainer/AndroidVersion.text.to_lower()
if android_version == "current":
android_version = godot_version
var android_target = $TabContainer/Android/TargetHBoxContainer/MenuButton.text.to_lower()
if android_target == "current":
android_target = "mono" if Engine.has_singleton("GodotSharp") else "standard"
var file_name = "android-"+ android_target + "-template-" + android_version + ".zip"
var plugin_version = version_support.android
$TabContainer/HTTPRequest.download_file = android_dictionary.download_directory + "/" + file_name
$TabContainer/HTTPRequest.request("https://github.com/Poing-Studios/godot-admob-android/releases/download/" + plugin_version + "/" + file_name)
actual_downloading_file = file_name
downloaded_plugin_version = "Android Plugin Version: " + plugin_version
set_process(true)
func _on_AndroidChangeDirectoryFileDialog_dir_selected(dir):
self.android_dictionary.download_directory = dir
func _on_AndroidChangeDirectoryButton_pressed():
$TabContainer/Android/ChangeDirectoryHBoxContainer/AndroidChangeDirectoryFileDialog.popup_centered()
func _on_iOSChangeDirectoryFileDialog_dir_selected(dir):
self.ios_dictionary.download_directory = dir
func _on_iOSChangeDirectoryButton_pressed():
$TabContainer/iOS/ChangeDirectoryHBoxContainer/iOSChangeDirectoryFileDialog.popup_centered()
func _on_AndroidOpenDirectoryButton_pressed():
var path_directory = ProjectSettings.globalize_path(android_dictionary.download_directory)
OS.shell_open(str("file://", path_directory))
func _on_iOSOpenDirectoryButton_pressed():
var path_directory = ProjectSettings.globalize_path(ios_dictionary.download_directory)
OS.shell_open(str("file://", path_directory))
func _on_VerifyNetworkGithub_network_status_changed(value : int):
if value == $VerifyNetworkGithub.CONNECTED:
$TabContainer.visible = true
$DontHaveConnectionPanelContainer.visible = false
else:
$TabContainer.visible = false
$DontHaveConnectionPanelContainer.visible = true
func _on_VersionSupportedHTTPRequest_supported_version_changed(value_dictionary : Dictionary):
version_support = value_dictionary
$VersionsAndroidSupportedHTTPRequest.request("https://api.github.com/repos/Poing-Studios/godot-admob-android/releases/tags/"+version_support["android"])
$VersionsiOSSupportedHTTPRequest.request("https://api.github.com/repos/Poing-Studios/godot-admob-ios/releases/tags/"+version_support["ios"])
func get_versions_platform_supported(body):
var json = JSON.parse(body.get_string_from_utf8())
var regex = RegEx.new()
regex.compile("[v](([0-9])+(\\.{0,1}([0-9]))*)+")
var versions_supported : Array
for asset in json.result["assets"]:
var godot_version = asset["name"]
var regex_result = regex.search(godot_version)
if regex_result:
if not versions_supported.has(regex_result.get_string()):
versions_supported.append(regex_result.get_string())
return versions_supported
func _on_VersionsiOSSupportedHTTPRequest_request_completed(result, response_code, headers, body):
ios_dictionary.version.append_array(get_versions_platform_supported(body))
set_version_platform_supported("ios")
func _on_VersionsAndroidSupportedHTTPRequest_request_completed(result, response_code, headers, body):
android_dictionary.version.append_array(get_versions_platform_supported(body))
set_version_platform_supported("android")

View File

@ -0,0 +1,265 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://addons/admob/src/core/components/Downloads.gd" type="Script" id=1]
[ext_resource path="res://addons/admob/src/core/components/VerifyNetworkGithub.gd" type="Script" id=2]
[ext_resource path="res://addons/admob/src/core/VersionSupportedHTTPRequest.tscn" type="PackedScene" id=3]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0, 1, 0.109804, 1 )
[sub_resource type="StyleBoxFlat" id=2]
[node name="Downloads" type="VBoxContainer"]
anchor_right = 1.0
margin_bottom = 31.0
script = ExtResource( 1 )
[node name="Advice" type="Label" parent="."]
margin_right = 720.0
margin_bottom = 65.0
text = "This screen is just to download the AdMob plugin referring to the current version of your Godot, IT WILL NOT INSTALL.
To install you need to follow the Android or iOS installation guide clicking on the icons on top screen."
autowrap = true
[node name="ProgressBar" type="ProgressBar" parent="."]
margin_top = 69.0
margin_right = 720.0
margin_bottom = 83.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_styles/fg = SubResource( 1 )
custom_styles/bg = SubResource( 2 )
[node name="AdviceAcceptDialog" type="AcceptDialog" parent="."]
margin_top = 104.0
margin_right = 500.0
margin_bottom = 162.0
popup_exclusive = true
window_title = "Alerta!"
dialog_text = "Download of %s completed! \\n%s"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TabContainer" type="TabContainer" parent="."]
margin_top = 87.0
margin_right = 720.0
margin_bottom = 215.0
[node name="HTTPRequest" type="HTTPRequest" parent="TabContainer"]
[node name="Android" type="VBoxContainer" parent="TabContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="ChangeDirectoryHBoxContainer" type="HBoxContainer" parent="TabContainer/Android"]
margin_right = 712.0
margin_bottom = 20.0
[node name="DownloadDirectoryLabel" type="Label" parent="TabContainer/Android/ChangeDirectoryHBoxContainer"]
margin_top = 3.0
margin_right = 440.0
margin_bottom = 17.0
text = "Current Download Directory: res://addons/admob/downloads/android"
[node name="AndroidChangeDirectoryButton" type="Button" parent="TabContainer/Android/ChangeDirectoryHBoxContainer"]
margin_left = 444.0
margin_right = 585.0
margin_bottom = 20.0
text = "CHANGE DIRECTORY"
[node name="AndroidOpenDirectoryButton" type="Button" parent="TabContainer/Android/ChangeDirectoryHBoxContainer"]
margin_left = 589.0
margin_right = 712.0
margin_bottom = 20.0
text = "OPEN DIRECTORY"
[node name="AndroidChangeDirectoryFileDialog" type="FileDialog" parent="TabContainer/Android/ChangeDirectoryHBoxContainer"]
margin_left = 380.0
margin_right = 780.0
margin_bottom = 250.0
rect_min_size = Vector2( 400, 250 )
window_title = "Open a Directory"
mode = 2
current_dir = "res://addons/admob/downloads/android"
current_path = "res://addons/admob/downloads/android/"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VersionHBoxContainer" type="HBoxContainer" parent="TabContainer/Android"]
margin_top = 24.0
margin_right = 712.0
margin_bottom = 44.0
[node name="Label" type="Label" parent="TabContainer/Android/VersionHBoxContainer"]
margin_top = 3.0
margin_right = 52.0
margin_bottom = 17.0
text = "Version:"
[node name="AndroidVersion" type="OptionButton" parent="TabContainer/Android/VersionHBoxContainer"]
margin_left = 56.0
margin_right = 143.0
margin_bottom = 20.0
text = "CURRENT"
items = [ "CURRENT", null, false, 0, null, "v3.2.2", null, false, 1, null, "v3.2.3", null, false, 2, null, "v3.3.1", null, false, 3, null, "v3.3.2", null, false, 4, null, "v3.3.3", null, false, 5, null, "v3.3.4", null, false, 6, null, "v3.3", null, false, 7, null, "v3.4.1", null, false, 8, null, "v3.4.2", null, false, 9, null, "v3.4.3", null, false, 10, null, "v3.4.4", null, false, 11, null, "v3.4", null, false, 12, null ]
selected = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TargetHBoxContainer" type="HBoxContainer" parent="TabContainer/Android"]
margin_top = 48.0
margin_right = 712.0
margin_bottom = 68.0
[node name="Label" type="Label" parent="TabContainer/Android/TargetHBoxContainer"]
margin_top = 3.0
margin_right = 43.0
margin_bottom = 17.0
text = "Target:"
[node name="MenuButton" type="OptionButton" parent="TabContainer/Android/TargetHBoxContainer"]
margin_left = 47.0
margin_right = 134.0
margin_bottom = 20.0
text = "CURRENT"
items = [ "CURRENT", null, false, 0, null, "STANDARD", null, false, 1, null, "MONO", null, false, 2, null ]
selected = 0
[node name="DownloadAndroidTemplate" type="Button" parent="TabContainer/Android"]
margin_top = 72.0
margin_right = 712.0
margin_bottom = 92.0
text = "Download Android Template"
[node name="iOS" type="VBoxContainer" parent="TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 24.0
margin_right = 599.0
margin_bottom = 354.0
[node name="ChangeDirectoryHBoxContainer" type="HBoxContainer" parent="TabContainer/iOS"]
margin_right = 1690.0
margin_bottom = 250.0
[node name="DownloadDirectoryLabel" type="Label" parent="TabContainer/iOS/ChangeDirectoryHBoxContainer"]
margin_top = 118.0
margin_right = 411.0
margin_bottom = 132.0
text = "Current Download Directory: res://addons/admob/downloads/ios"
[node name="iOSChangeDirectoryButton" type="Button" parent="TabContainer/iOS/ChangeDirectoryHBoxContainer"]
margin_left = 415.0
margin_right = 556.0
margin_bottom = 250.0
text = "CHANGE DIRECTORY"
[node name="iOSOpenDirectoryButton" type="Button" parent="TabContainer/iOS/ChangeDirectoryHBoxContainer"]
margin_left = 560.0
margin_right = 683.0
margin_bottom = 250.0
text = "OPEN DIRECTORY"
[node name="iOSChangeDirectoryFileDialog" type="FileDialog" parent="TabContainer/iOS/ChangeDirectoryHBoxContainer"]
visible = true
margin_left = 687.0
margin_right = 1087.0
margin_bottom = 250.0
rect_min_size = Vector2( 400, 250 )
window_title = "Open a Directory"
mode = 2
current_dir = "res://addons/admob/downloads/ios"
current_path = "res://addons/admob/downloads/ios/"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VersionHBoxContainer" type="HBoxContainer" parent="TabContainer/iOS"]
margin_top = 254.0
margin_right = 1690.0
margin_bottom = 274.0
[node name="Label" type="Label" parent="TabContainer/iOS/VersionHBoxContainer"]
margin_top = 3.0
margin_right = 52.0
margin_bottom = 17.0
text = "Version:"
[node name="iOSVersion" type="OptionButton" parent="TabContainer/iOS/VersionHBoxContainer"]
margin_left = 56.0
margin_right = 143.0
margin_bottom = 20.0
text = "CURRENT"
items = [ "CURRENT", null, false, 0, null, "v3.3.1", null, false, 1, null, "v3.3.2", null, false, 2, null, "v3.3.3", null, false, 3, null, "v3.3.4", null, false, 4, null, "v3.3", null, false, 5, null, "v3.4.1", null, false, 6, null, "v3.4.2", null, false, 7, null, "v3.4.3", null, false, 8, null, "v3.4.4", null, false, 9, null, "v3.4", null, false, 10, null ]
selected = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DownloadiOSTemplate" type="Button" parent="TabContainer/iOS"]
margin_top = 278.0
margin_right = 1690.0
margin_bottom = 298.0
text = "Download iOS Template"
[node name="DownloadGoogleMobileAdsSdkiOS" type="Button" parent="TabContainer/iOS"]
margin_top = 302.0
margin_right = 1690.0
margin_bottom = 322.0
text = "Download GoogleMobileAdsSdkiOS"
[node name="DontHaveConnectionPanelContainer" type="PanelContainer" parent="."]
visible = false
margin_top = 219.0
margin_right = 720.0
margin_bottom = 263.0
[node name="Label" type="RichTextLabel" parent="DontHaveConnectionPanelContainer"]
margin_left = 7.0
margin_top = 7.0
margin_right = 713.0
margin_bottom = 37.0
bbcode_enabled = true
bbcode_text = "[b]You don't have connection to the Server: %s, please verify your connection in order to Download[/b]"
text = "You don't have connection to the Server: https://github.com/, please verify your connection in order to Download"
fit_content_height = true
scroll_active = false
[node name="VerifyNetworkGithub" type="HTTPRequest" parent="."]
script = ExtResource( 2 )
[node name="VerifyAgainTimer" type="Timer" parent="VerifyNetworkGithub"]
wait_time = 60.0
autostart = true
[node name="VersionSupportedHTTPRequest" parent="." instance=ExtResource( 3 )]
[node name="VersionsAndroidSupportedHTTPRequest" type="HTTPRequest" parent="."]
[node name="VersionsiOSSupportedHTTPRequest" type="HTTPRequest" parent="."]
[connection signal="request_completed" from="TabContainer/HTTPRequest" to="." method="_on_HTTPRequest_request_completed"]
[connection signal="pressed" from="TabContainer/Android/ChangeDirectoryHBoxContainer/AndroidChangeDirectoryButton" to="." method="_on_AndroidChangeDirectoryButton_pressed"]
[connection signal="pressed" from="TabContainer/Android/ChangeDirectoryHBoxContainer/AndroidOpenDirectoryButton" to="." method="_on_AndroidOpenDirectoryButton_pressed"]
[connection signal="dir_selected" from="TabContainer/Android/ChangeDirectoryHBoxContainer/AndroidChangeDirectoryFileDialog" to="." method="_on_AndroidChangeDirectoryFileDialog_dir_selected"]
[connection signal="pressed" from="TabContainer/Android/DownloadAndroidTemplate" to="." method="_on_DownloadAndroidTemplate_pressed"]
[connection signal="pressed" from="TabContainer/iOS/ChangeDirectoryHBoxContainer/iOSChangeDirectoryButton" to="." method="_on_iOSChangeDirectoryButton_pressed"]
[connection signal="pressed" from="TabContainer/iOS/ChangeDirectoryHBoxContainer/iOSOpenDirectoryButton" to="." method="_on_iOSOpenDirectoryButton_pressed"]
[connection signal="dir_selected" from="TabContainer/iOS/ChangeDirectoryHBoxContainer/iOSChangeDirectoryFileDialog" to="." method="_on_iOSChangeDirectoryFileDialog_dir_selected"]
[connection signal="pressed" from="TabContainer/iOS/DownloadiOSTemplate" to="." method="_on_DownloadiOSTemplate_pressed"]
[connection signal="pressed" from="TabContainer/iOS/DownloadGoogleMobileAdsSdkiOS" to="." method="_on_DownloadGoogleMobileAdsSdkiOS_pressed"]
[connection signal="network_status_changed" from="VerifyNetworkGithub" to="." method="_on_VerifyNetworkGithub_network_status_changed"]
[connection signal="request_completed" from="VerifyNetworkGithub" to="VerifyNetworkGithub" method="_on_VerifyNetworkGithub_request_completed"]
[connection signal="timeout" from="VerifyNetworkGithub/VerifyAgainTimer" to="VerifyNetworkGithub" method="_on_VerifyAgainTimer_timeout"]
[connection signal="supported_version_changed" from="VersionSupportedHTTPRequest" to="." method="_on_VersionSupportedHTTPRequest_supported_version_changed"]
[connection signal="request_completed" from="VersionsAndroidSupportedHTTPRequest" to="." method="_on_VersionsAndroidSupportedHTTPRequest_request_completed"]
[connection signal="request_completed" from="VersionsiOSSupportedHTTPRequest" to="." method="_on_VersionsiOSSupportedHTTPRequest_request_completed"]

View File

@ -0,0 +1,20 @@
tool
extends CheckBox
onready var AdMobEditor : Control = find_parent("AdMobEditor")
func _ready() -> void:
pressed = AdMobEditor.AdMobSettings.config.general.is_enabled
func _on_Enabled_pressed():
if not pressed:
pressed = true
$ConfirmationDialog.show()
else:
AdMobEditor.AdMobSettings.config.general.is_enabled = pressed
func _on_ConfirmationDialog_confirmed() -> void:
pressed = false
AdMobEditor.AdMobSettings.config.general.is_enabled = pressed

View File

@ -0,0 +1,15 @@
tool
extends VBoxContainer
onready var AdMobEditor : Control = find_parent("AdMobEditor")
func _ready():
$ChildDirectedTreatment.pressed = AdMobEditor.AdMobSettings.config.general.is_for_child_directed_treatment
$MaxAdContentRating/Value.selected = AdMobEditor.AdMobSettings.MAX_AD_RATING.find(AdMobEditor.AdMobSettings.config.general.max_ad_content_rating)
func _on_ChildDirectedTreatment_pressed():
AdMobEditor.AdMobSettings.config.general.is_for_child_directed_treatment = $ChildDirectedTreatment.pressed
func _on_MaxAdContentRating_item_selected(index):
AdMobEditor.AdMobSettings.config.general.max_ad_content_rating = AdMobEditor.AdMobSettings.MAX_AD_RATING[index]

View File

@ -0,0 +1,78 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/admob/src/core/components/General.gd" type="Script" id=1]
[ext_resource path="res://addons/admob/src/core/components/Enabled.gd" type="Script" id=2]
[node name="General" type="VBoxContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
script = ExtResource( 1 )
[node name="Enabled" type="CheckBox" parent="."]
margin_right = 592.0
margin_bottom = 24.0
pressed = true
text = "Enabled"
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ConfirmationDialog" type="ConfirmationDialog" parent="Enabled"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -334.0
margin_top = -46.0
margin_right = 334.0
margin_bottom = 46.0
dialog_text = "If \"Enabled\" is false then ads will no longer work, are you sure?
Note: You can disable ads if the user purchases by IAP, that's why this attribute can be useful."
[node name="ChildDirectedTreatment" type="CheckBox" parent="."]
margin_top = 28.0
margin_right = 592.0
margin_bottom = 52.0
text = "Child Directed Treatment"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MaxAdContentRating" type="HBoxContainer" parent="."]
margin_top = 56.0
margin_right = 592.0
margin_bottom = 76.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Key" type="Label" parent="MaxAdContentRating"]
margin_top = 3.0
margin_right = 132.0
margin_bottom = 17.0
text = "MaxAdContentRating"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Value" type="OptionButton" parent="MaxAdContentRating"]
margin_left = 136.0
margin_right = 183.0
margin_bottom = 20.0
text = "PG"
items = [ "G", null, false, 0, null, "PG", null, false, 1, null, "T", null, false, 2, null, "MA", null, false, 3, null ]
selected = 1
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="Enabled" to="Enabled" method="_on_Enabled_pressed"]
[connection signal="confirmed" from="Enabled/ConfirmationDialog" to="Enabled" method="_on_ConfirmationDialog_confirmed"]
[connection signal="pressed" from="ChildDirectedTreatment" to="." method="_on_ChildDirectedTreatment_pressed"]
[connection signal="item_selected" from="MaxAdContentRating/Value" to="." method="_on_MaxAdContentRating_item_selected"]

View File

@ -0,0 +1,18 @@
tool
extends HTTPRequest
enum {CONNECTED = 200}
signal network_status_changed(value)
export var server_to_test = "https://github.com/"
func _ready():
request(server_to_test)
func _on_VerifyNetworkGithub_request_completed(result, response_code, headers, body):
emit_signal("network_status_changed", response_code)
func _on_VerifyAgainTimer_timeout():
request(server_to_test)

View File

@ -0,0 +1,14 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/admob/src/core/components/ad_format/unit_ids/UnitIds.tscn" type="PackedScene" id=1]
[node name="AdFormat" type="VBoxContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="UnitIds" parent="." instance=ExtResource( 1 )]
margin_right = 500.0
margin_bottom = 60.0

View File

@ -0,0 +1,23 @@
tool
extends VBoxContainer
onready var AdMobEditor : Control = find_parent("AdMobEditor")
func _ready():
$RespectSafeArea.connect("value_changed", self, "_on_RespectSafeArea_value_changed")
$BannerSizeHBoxContainer/BannerSize.selected = AdMobEditor.AdMobSettings.BANNER_SIZE.find(AdMobEditor.AdMobSettings.config.banner.size)
$RespectSafeArea.pressed = AdMobEditor.AdMobSettings.config.banner.respect_safe_area
$BannerShowInstantly.pressed = AdMobEditor.AdMobSettings.config.banner.show_instantly
$BannerOnTop.pressed = AdMobEditor.AdMobSettings.config.banner.position
func _on_BannerSize_item_selected(index):
AdMobEditor.AdMobSettings.config.banner.size = AdMobEditor.AdMobSettings.BANNER_SIZE[index]
func _on_BannerShowInstantly_pressed():
AdMobEditor.AdMobSettings.config.banner.show_instantly = $BannerShowInstantly.pressed#
func _on_BannerOnTop_pressed():
AdMobEditor.AdMobSettings.config.banner.position = int($BannerOnTop.pressed)
func _on_RespectSafeArea_value_changed(value : bool):
AdMobEditor.AdMobSettings.config.banner.respect_safe_area = value

View File

@ -0,0 +1,86 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/admob/src/core/components/ad_format/AdFormat.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/admob/src/core/components/ad_format/BannerAdFormat.gd" type="Script" id=2]
[ext_resource path="res://addons/admob/src/core/components/ad_format/RespectSafeArea.gd" type="Script" id=3]
[node name="BannerAdFormat" instance=ExtResource( 1 )]
script = ExtResource( 2 )
[node name="BannerSizeHBoxContainer" type="HBoxContainer" parent="." index="0"]
margin_right = 500.0
margin_bottom = 20.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="BannerSizeHBoxContainer" index="0"]
margin_top = 3.0
margin_right = 75.0
margin_bottom = 17.0
text = "Banner Size"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="BannerSize" type="OptionButton" parent="BannerSizeHBoxContainer" index="1"]
margin_left = 79.0
margin_right = 243.0
margin_bottom = 20.0
text = "MEDIUM_RECTANGLE"
items = [ "BANNER", null, false, 0, null, "MEDIUM_RECTANGLE", null, false, 1, null, "FULL_BANNER", null, false, 2, null, "LEADERBOARD", null, false, 3, null, "ADAPTIVE", null, false, 4, null, "SMART_BANNER", null, false, 5, null ]
selected = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="RespectSafeArea" type="CheckBox" parent="." index="1"]
margin_top = 24.0
margin_right = 500.0
margin_bottom = 48.0
pressed = true
text = "Respect Safe Area (RECOMMEND TRUE)"
script = ExtResource( 3 )
[node name="ConfirmationDialog" type="ConfirmationDialog" parent="RespectSafeArea" index="0"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -250.0
margin_top = -114.0
margin_right = 250.0
margin_bottom = 114.0
window_title = "!!!WARNING!!!"
dialog_text = "IT'S NOT RECOMMENDED LEAVE THIS AS FALSE
According to Google AdMob documentation for iOS: Banner ads must be placed in the \"Safe Area\" to avoid being obscured by rounded corners, sensor housing, and the Home indicator.
Read here: https://developers.google.com/admob/ios/x-ad-rendering"
dialog_autowrap = true
[node name="BannerShowInstantly" type="CheckBox" parent="." index="2"]
margin_top = 52.0
margin_right = 500.0
margin_bottom = 76.0
pressed = true
text = "Show Banner Instantly"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="BannerOnTop" type="CheckBox" parent="." index="3"]
margin_top = 80.0
margin_right = 500.0
margin_bottom = 104.0
text = "Banner On Top"
[node name="UnitIds" parent="." index="4"]
margin_top = 108.0
margin_bottom = 168.0
[connection signal="item_selected" from="BannerSizeHBoxContainer/BannerSize" to="." method="_on_BannerSize_item_selected"]
[connection signal="pressed" from="RespectSafeArea" to="RespectSafeArea" method="_on_RespectSafeArea_pressed"]
[connection signal="confirmed" from="RespectSafeArea/ConfirmationDialog" to="RespectSafeArea" method="_on_ConfirmationDialog_confirmed"]
[connection signal="pressed" from="BannerShowInstantly" to="." method="_on_BannerShowInstantly_pressed"]
[connection signal="pressed" from="BannerOnTop" to="." method="_on_BannerOnTop_pressed"]

View File

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/admob/src/core/components/ad_format/AdFormat.tscn" type="PackedScene" id=1]
[node name="InterstitialAdFormat" instance=ExtResource( 1 )]

View File

@ -0,0 +1,17 @@
tool
extends CheckBox
signal value_changed(value)
func _on_ConfirmationDialog_confirmed():
pressed = false
emit_signal("value_changed", pressed)
func _on_RespectSafeArea_pressed():
if not pressed:
pressed = true
$ConfirmationDialog.show()
else:
emit_signal("value_changed", pressed)

View File

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/admob/src/core/components/ad_format/AdFormat.tscn" type="PackedScene" id=1]
[node name="RewardedAdFormat" instance=ExtResource( 1 )]

View File

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/admob/src/core/components/ad_format/AdFormat.tscn" type="PackedScene" id=1]
[node name="RewardedInterstitialAdFormat" instance=ExtResource( 1 )]

View File

@ -0,0 +1,44 @@
tool
extends HBoxContainer
var AdUnit = preload("res://addons/admob/src/core/components/ad_format/unit_ids/ad_unit_operational_system/ad_unit/AdUnit.tscn")
onready var AdMobEditor : Control = find_parent("AdMobEditor")
onready var ad_format_name = AdMobEditor.AdMobSettings.pascal2snake(get_parent().name)
func _ready():
for operational_system in $OperationalSystemTabContainer.get_children():
for unit_name in (AdMobEditor.AdMobSettings.config[ad_format_name].unit_ids[operational_system.name] as Dictionary):
var unit_id = AdMobEditor.AdMobSettings.config[ad_format_name].unit_ids[operational_system.name][unit_name]
instance_ad_unit(operational_system.name, false, unit_name, unit_id)
get_node("OperationalSystemTabContainer/"+operational_system.name+"/AddAdUnitButton").connect("pressed", self, "_on_AddAdUnitButton_pressed", [operational_system.name])
func _on_AdUnitChanged(name_value: String, id_value: String, old_name_value :String, system):
remove_ad_unit(system, name_value)
remove_ad_unit(system, old_name_value)
add_ad_unit(system, name_value, id_value)
func _on_AdUnitRemoved(name_value : String, system):
remove_ad_unit(system, name_value)
func _on_AddAdUnitButton_pressed(system):
instance_ad_unit(system, true)
func add_ad_unit(operational_system : String, name_value: String, id_value : String):
AdMobEditor.AdMobSettings.config[ad_format_name].unit_ids[operational_system][name_value] = id_value
func remove_ad_unit(operational_system : String, name_value: String):
AdMobEditor.AdMobSettings.config[ad_format_name].unit_ids[operational_system].erase(name_value)
AdMobEditor.AdMobSettings.save_config()
func instance_ad_unit(system : String, is_editing : bool, unit_name : String = "", unit_id : String = ""):
var tab_container = get_node("OperationalSystemTabContainer/"+system+"/AdUnitVBoxContainer")
var ad_unit = AdUnit.instance()
tab_container.add_child(ad_unit)
ad_unit.connect("AdUnitChanged", self, "_on_AdUnitChanged", [system])
ad_unit.connect("AdUnitRemoved", self, "_on_AdUnitRemoved", [system])
ad_unit.Name.text = unit_name
ad_unit.Id.text = unit_id
ad_unit.is_editing = is_editing

View File

@ -0,0 +1,50 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/admob/src/core/components/ad_format/unit_ids/UnitIds.gd" type="Script" id=1]
[ext_resource path="res://addons/admob/src/core/components/ad_format/unit_ids/ad_unit_operational_system/AdUnitOperationalSystem.tscn" type="PackedScene" id=2]
[node name="UnitIds" type="HBoxContainer"]
margin_right = 600.0
margin_bottom = 84.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Description" type="Label" parent="."]
margin_top = 35.0
margin_right = 58.0
margin_bottom = 49.0
text = "UNIT IDS"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="OperationalSystemTabContainer" type="TabContainer" parent="."]
margin_left = 62.0
margin_right = 262.0
margin_bottom = 84.0
rect_min_size = Vector2( 200, 0 )
rect_clip_content = true
mouse_filter = 1
tab_align = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Android" parent="OperationalSystemTabContainer" instance=ExtResource( 2 )]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="iOS" parent="OperationalSystemTabContainer" instance=ExtResource( 2 )]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0

View File

@ -0,0 +1,23 @@
[gd_scene format=2]
[node name="AdUnitOperationalSystem" type="VBoxContainer"]
margin_right = 382.0
margin_bottom = 159.0
rect_clip_content = true
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AdUnitVBoxContainer" type="VBoxContainer" parent="."]
margin_right = 382.0
margin_bottom = 135.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="AddAdUnitButton" type="Button" parent="."]
margin_top = 139.0
margin_right = 382.0
margin_bottom = 159.0
text = "ADD"

View File

@ -0,0 +1,75 @@
tool
extends GridContainer
signal AdUnitChanged(name_value, id_value, old_name_value)
signal AdUnitRemoved(name_value)
onready var Name := $Name
onready var Id := $Id
onready var ChildrenParent := get_parent().get_children()
onready var AddAdUnitButtonParent := get_parent().get_parent().get_node("AddAdUnitButton")
var old_name_value := ""
var is_editing := true setget set_is_editing
func _ready():
if get_index() == 0:
$GridContainer/RemoveButton.disabled = true
func change_state(editing : bool) -> void:
if editing:
editing_state()
else:
not_editing_state()
func editing_state() -> void:
$GridContainer/ConfirmButton.visible = true
$GridContainer/EditButton.visible = false
Name.editable = true
Id.editable = true
for ad_unit in ChildrenParent:
if ad_unit.get_index() != get_index():
if ad_unit.get_index() != 0: ad_unit.get_node("GridContainer/RemoveButton").disabled = true
ad_unit.get_node("GridContainer/EditButton").disabled = true
AddAdUnitButtonParent.disabled = true
func not_editing_state():
$GridContainer/ConfirmButton.visible = false
$GridContainer/EditButton.visible = true
Name.editable = false
Id.editable = false
for ad_unit in ChildrenParent:
if ad_unit.get_index() != 0: ad_unit.get_node("GridContainer/RemoveButton").disabled = false
ad_unit.get_node("GridContainer/EditButton").disabled = false
AddAdUnitButtonParent.disabled = false
func set_is_editing(value : bool):
change_state(value)
func _on_RemoveButton_pressed():
if (get_parent().get_child_count() > 1):
self.is_editing = false
emit_signal("AdUnitRemoved", Name.text)
queue_free()
func _on_ConfirmButton_pressed():
if Name.text != "" && Id.text != "":
for ad_unit in ChildrenParent:
if ad_unit.get_index() != get_index():
if ad_unit.Name.text == Name.text:
$Alerts/UniqueNameAcceptDialog.popup_centered()
return
else:
$Alerts/NameIdEmptyAcceptDialog.popup_centered()
return
emit_signal("AdUnitChanged", Name.text, Id.text, old_name_value)
self.is_editing = false
func _on_AdUnit_text_entered(new_text):
$GridContainer/ConfirmButton.emit_signal("pressed")
func _on_EditButton_pressed():
old_name_value = Name.text
self.is_editing = true

View File

@ -0,0 +1,97 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/admob/src/core/components/ad_format/unit_ids/ad_unit_operational_system/ad_unit/AdUnit.gd" type="Script" id=1]
[node name="AdUnit" type="GridContainer"]
margin_right = 220.0
margin_bottom = 24.0
columns = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Name" type="LineEdit" parent="."]
margin_right = 108.0
margin_bottom = 24.0
size_flags_horizontal = 3
text = "<insert-name>"
align = 1
expand_to_text_length = true
virtual_keyboard_enabled = false
[node name="Id" type="LineEdit" parent="."]
margin_left = 112.0
margin_right = 196.0
margin_bottom = 24.0
size_flags_horizontal = 3
text = "<insert-id>"
align = 1
expand_to_text_length = true
virtual_keyboard_enabled = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="GridContainer" type="GridContainer" parent="."]
margin_left = 200.0
margin_right = 255.0
margin_bottom = 24.0
columns = 2
[node name="ConfirmButton" type="Button" parent="GridContainer"]
margin_right = 31.0
margin_bottom = 20.0
text = "OK"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="EditButton" type="Button" parent="GridContainer"]
visible = false
margin_left = 35.0
margin_right = 76.0
margin_bottom = 20.0
text = "EDIT"
[node name="RemoveButton" type="Button" parent="GridContainer"]
margin_left = 35.0
margin_right = 55.0
margin_bottom = 20.0
text = "X"
[node name="Alerts" type="Node" parent="."]
[node name="UniqueNameAcceptDialog" type="AcceptDialog" parent="Alerts"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -95.0
margin_top = -29.0
margin_right = 95.0
margin_bottom = 29.0
dialog_text = "The Name must be unique!"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="NameIdEmptyAcceptDialog" type="AcceptDialog" parent="Alerts"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -95.0
margin_top = -29.0
margin_right = 95.0
margin_bottom = 29.0
dialog_text = "The Name and Id must not be empty!"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="text_entered" from="Name" to="." method="_on_AdUnit_text_entered"]
[connection signal="text_entered" from="Id" to="." method="_on_AdUnit_text_entered"]
[connection signal="pressed" from="GridContainer/ConfirmButton" to="." method="_on_ConfirmButton_pressed"]
[connection signal="pressed" from="GridContainer/EditButton" to="." method="_on_EditButton_pressed"]
[connection signal="pressed" from="GridContainer/RemoveButton" to="." method="_on_RemoveButton_pressed"]

View File

@ -0,0 +1,202 @@
extends Node
signal initialization_complete(status, adapter_name)
signal consent_form_dismissed()
signal consent_status_changed(consent_status_message)
signal consent_form_load_failure(error_code, error_message)
signal consent_info_update_success(consent_status_message)
signal consent_info_update_failure(error_code, error_message)
signal banner_loaded()
signal banner_failed_to_load(error_code)
signal banner_opened()
signal banner_clicked()
signal banner_closed()
signal banner_recorded_impression()
signal banner_destroyed()
signal interstitial_failed_to_load(error_code)
signal interstitial_loaded()
signal interstitial_failed_to_show(error_code)
signal interstitial_opened()
signal interstitial_clicked()
signal interstitial_closed()
signal interstitial_recorded_impression()
signal rewarded_ad_failed_to_load(error_code)
signal rewarded_ad_loaded()
signal rewarded_ad_failed_to_show(error_code)
signal rewarded_ad_opened()
signal rewarded_ad_clicked()
signal rewarded_ad_closed()
signal rewarded_ad_recorded_impression()
signal rewarded_interstitial_ad_failed_to_load(error_code)
signal rewarded_interstitial_ad_loaded()
signal rewarded_interstitial_ad_failed_to_show(error_code)
signal rewarded_interstitial_ad_opened()
signal rewarded_interstitial_ad_clicked()
signal rewarded_interstitial_ad_closed()
signal rewarded_interstitial_ad_recorded_impression()
signal user_earned_rewarded(currency, amount)
var AdMobSettings = preload("res://addons/admob/src/utils/AdMobSettings.gd").new()
onready var config = AdMobSettings.config
var _plugin : Object
func _ready() -> void:
if config.general.is_enabled:
if (Engine.has_singleton("AdMob")):
_plugin = Engine.get_singleton("AdMob")
initialize()
_connect_signals()
func get_is_initialized() -> bool:
if _plugin:
return _plugin.get_is_initialized()
return false
func initialize() -> void:
if _plugin:
var is_release : bool = OS.has_feature("release")
var is_debug_on_release : bool = config.debug.is_debug_on_release
var is_real : bool = false
var is_test_europe_user_consent : bool = config.debug.is_test_europe_user_consent
if is_release:
is_real = true
is_test_europe_user_consent = false
if is_debug_on_release:
is_real = config.debug.is_real
is_test_europe_user_consent = config.debug.is_test_europe_user_consent
_plugin.initialize(config.general.is_for_child_directed_treatment, config.general.max_ad_content_rating, is_real, is_test_europe_user_consent)
func _connect_signals() -> void:
_plugin.connect("initialization_complete", self, "_on_AdMob_initialization_complete")
_plugin.connect("consent_form_dismissed", self, "_on_AdMob_consent_form_dismissed")
_plugin.connect("consent_status_changed", self, "_on_AdMob_consent_status_changed")
_plugin.connect("consent_form_load_failure", self, "_on_AdMob_consent_form_load_failure")
_plugin.connect("consent_info_update_success", self, "_on_AdMob_consent_info_update_success")
_plugin.connect("consent_info_update_failure", self, "_on_AdMob_consent_info_update_failure")
_plugin.connect("banner_loaded", self, "_on_AdMob_banner_loaded")
_plugin.connect("banner_failed_to_load", self, "_on_AdMob_banner_failed_to_load")
_plugin.connect("banner_opened", self, "_on_AdMob_banner_opened")
_plugin.connect("banner_clicked", self, "_on_AdMob_banner_clicked")
_plugin.connect("banner_closed", self, "_on_AdMob_banner_closed")
_plugin.connect("banner_recorded_impression", self, "_on_AdMob_banner_recorded_impression")
_plugin.connect("banner_destroyed", self, "_on_AdMob_banner_destroyed")
_plugin.connect("interstitial_failed_to_load", self, "_on_AdMob_interstitial_failed_to_load")
_plugin.connect("interstitial_loaded", self, "_on_AdMob_interstitial_loaded")
_plugin.connect("interstitial_failed_to_show", self, "_on_AdMob_interstitial_failed_to_show")
_plugin.connect("interstitial_opened", self, "_on_AdMob_interstitial_opened")
_plugin.connect("interstitial_clicked", self, "_on_AdMob_interstitial_clicked")
_plugin.connect("interstitial_closed", self, "_on_AdMob_interstitial_closed")
_plugin.connect("interstitial_recorded_impression", self, "_on_AdMob_interstitial_recorded_impression")
_plugin.connect("rewarded_ad_failed_to_load", self, "_on_AdMob_rewarded_ad_failed_to_load")
_plugin.connect("rewarded_ad_loaded", self, "_on_AdMob_rewarded_ad_loaded")
_plugin.connect("rewarded_ad_failed_to_show", self, "_on_AdMob_rewarded_ad_failed_to_show")
_plugin.connect("rewarded_ad_opened", self, "_on_AdMob_rewarded_ad_opened")
_plugin.connect("rewarded_ad_clicked", self, "_on_AdMob_rewarded_ad_clicked")
_plugin.connect("rewarded_ad_closed", self, "_on_AdMob_rewarded_ad_closed")
_plugin.connect("rewarded_ad_recorded_impression", self, "_on_AdMob_rewarded_ad_recorded_impression")
_plugin.connect("rewarded_interstitial_ad_failed_to_load", self, "_on_AdMob_rewarded_interstitial_ad_failed_to_load")
_plugin.connect("rewarded_interstitial_ad_loaded", self, "_on_AdMob_rewarded_interstitial_ad_loaded")
_plugin.connect("rewarded_interstitial_ad_failed_to_show", self, "_on_AdMob_rewarded_interstitial_ad_failed_to_show")
_plugin.connect("rewarded_interstitial_ad_opened", self, "_on_AdMob_rewarded_interstitial_ad_opened")
_plugin.connect("rewarded_interstitial_ad_clicked", self, "_on_AdMob_rewarded_interstitial_ad_clicked")
_plugin.connect("rewarded_interstitial_ad_closed", self, "_on_AdMob_rewarded_interstitial_ad_closed")
_plugin.connect("rewarded_interstitial_ad_recorded_impression", self, "_on_AdMob_rewarded_interstitial_ad_recorded_impression")
_plugin.connect("user_earned_rewarded", self, "_on_AdMob_user_earned_rewarded")
func _on_AdMob_initialization_complete(status : int, adapter_name : String) -> void:
emit_signal("initialization_complete", status, adapter_name)
func _on_AdMob_consent_form_dismissed() -> void:
emit_signal("consent_form_dismissed")
func _on_AdMob_consent_status_changed(consent_status_message : String) -> void:
emit_signal("consent_status_changed", consent_status_message)
func _on_AdMob_consent_form_load_failure(error_code : int, error_message: String) -> void:
emit_signal("consent_form_load_failure", error_code, error_message)
func _on_AdMob_consent_info_update_success(consent_status_message : String) -> void:
emit_signal("consent_info_update_success", consent_status_message)
func _on_AdMob_consent_info_update_failure(error_code : int, error_message : String) -> void:
emit_signal("consent_info_update_failure", error_code, error_message)
func _on_AdMob_banner_loaded() -> void:
emit_signal("banner_loaded")
func _on_AdMob_banner_failed_to_load(error_code : int) -> void:
emit_signal("banner_failed_to_load", error_code)
func _on_AdMob_banner_opened() -> void:
emit_signal("banner_loaded")
func _on_AdMob_banner_clicked() -> void:
emit_signal("banner_clicked")
func _on_AdMob_banner_closed() -> void:
emit_signal("banner_closed")
func _on_AdMob_banner_recorded_impression() -> void:
emit_signal("banner_recorded_impression")
func _on_AdMob_banner_destroyed() -> void:
emit_signal("banner_destroyed")
func _on_AdMob_interstitial_failed_to_load(error_code : int) -> void:
emit_signal("interstitial_failed_to_load", error_code)
func _on_AdMob_interstitial_loaded() -> void:
emit_signal("interstitial_loaded")
func _on_AdMob_interstitial_failed_to_show(error_code : int) -> void:
emit_signal("interstitial_failed_to_show", error_code)
func _on_AdMob_interstitial_opened() -> void:
emit_signal("interstitial_opened")
func _on_AdMob_interstitial_clicked() -> void:
emit_signal("interstitial_clicked")
func _on_AdMob_interstitial_closed() -> void:
emit_signal("interstitial_closed")
func _on_AdMob_interstitial_recorded_impression() -> void:
emit_signal("interstitial_recorded_impression")
func _on_AdMob_rewarded_ad_failed_to_load(error_code : int) -> void:
emit_signal("rewarded_ad_failed_to_load", error_code)
func _on_AdMob_rewarded_ad_loaded() -> void:
emit_signal("rewarded_ad_loaded")
func _on_AdMob_rewarded_ad_failed_to_show(error_code : int) -> void:
emit_signal("rewarded_ad_failed_to_show", error_code)
func _on_AdMob_rewarded_ad_opened() -> void:
emit_signal("rewarded_ad_opened")
func _on_AdMob_rewarded_ad_clicked() -> void:
emit_signal("rewarded_ad_clicked")
func _on_AdMob_rewarded_ad_closed() -> void:
emit_signal("rewarded_ad_closed")
func _on_AdMob_rewarded_ad_recorded_impression() -> void:
emit_signal("rewarded_ad_recorded_impression")
func _on_AdMob_rewarded_interstitial_ad_failed_to_load(error_code : int) -> void:
emit_signal("rewarded_interstitial_ad_failed_to_load", error_code)
func _on_AdMob_rewarded_interstitial_ad_loaded() -> void:
emit_signal("rewarded_interstitial_ad_loaded")
func _on_AdMob_rewarded_interstitial_ad_failed_to_show(error_code : int) -> void:
emit_signal("rewarded_interstitial_ad_failed_to_show", error_code)
func _on_AdMob_rewarded_interstitial_ad_opened() -> void:
emit_signal("rewarded_interstitial_ad_opened")
func _on_AdMob_rewarded_interstitial_ad_clicked() -> void:
emit_signal("rewarded_interstitial_ad_clicked")
func _on_AdMob_rewarded_interstitial_ad_closed() -> void:
emit_signal("rewarded_interstitial_ad_closed")
func _on_AdMob_rewarded_interstitial_ad_recorded_impression() -> void:
emit_signal("rewarded_interstitial_ad_recorded_impression")
func _on_AdMob_user_earned_rewarded(currency : String, amount : int) -> void:
emit_signal("user_earned_rewarded", currency, amount)

View File

@ -0,0 +1,106 @@
extends "res://addons/admob/src/singletons/AdMobSingleton.gd"
func _ready() -> void:
# warning-ignore:return_value_discarded
get_tree().connect("screen_resized", self, "_on_get_tree_resized")
func load_banner(ad_unit_name : String = "standard") -> void:
if _plugin:
_plugin.load_banner(config.banner.unit_ids[OS.get_name()][ad_unit_name], config.banner.position, config.banner.size, config.banner.show_instantly, config.banner.respect_safe_area)
func load_interstitial(ad_unit_name : String = "standard") -> void:
if _plugin:
_plugin.load_interstitial(config.interstitial.unit_ids[OS.get_name()][ad_unit_name])
func load_rewarded(ad_unit_name : String = "standard") -> void:
if _plugin:
_plugin.load_rewarded(config.rewarded.unit_ids[OS.get_name()][ad_unit_name])
func load_rewarded_interstitial(ad_unit_name : String = "standard") -> void:
if _plugin:
_plugin.load_rewarded_interstitial(config.rewarded_interstitial.unit_ids[OS.get_name()][ad_unit_name])
func destroy_banner() -> void:
if _plugin:
_plugin.destroy_banner()
func show_banner() -> void:
if _plugin:
_plugin.show_banner()
func hide_banner() -> void:
if _plugin:
_plugin.hide_banner()
func show_interstitial() -> void:
if _plugin:
_plugin.show_interstitial()
func show_rewarded() -> void:
if _plugin:
_plugin.show_rewarded()
func show_rewarded_interstitial() -> void:
if _plugin:
_plugin.show_rewarded_interstitial()
func request_user_consent() -> void:
if _plugin:
_plugin.request_user_consent()
func reset_consent_state(will_request_user_consent := false) -> void:
if _plugin:
_plugin.reset_consent_state()
func get_banner_width() -> int:
if _plugin:
return _plugin.get_banner_width()
return 0
func get_banner_width_in_pixels() -> int:
if _plugin:
return _plugin.get_banner_width_in_pixels()
return 0
func get_banner_height() -> int:
if _plugin:
return _plugin.get_banner_height()
return 0
func get_banner_height_in_pixels() -> int:
if _plugin:
return _plugin.get_banner_height_in_pixels()
return 0
func get_is_banner_loaded() -> bool:
if _plugin:
return _plugin.get_is_banner_loaded()
return false
func get_is_interstitial_loaded() -> bool:
if _plugin:
return _plugin.get_is_interstitial_loaded()
return false
func get_is_rewarded_loaded() -> bool:
if _plugin:
return _plugin.get_is_rewarded_loaded()
return false
func get_is_rewarded_interstitial_loaded() -> bool:
if _plugin:
return _plugin.get_is_rewarded_interstitial_loaded()
return false
func _on_get_tree_resized() -> void:
if _plugin:
if get_is_banner_loaded() and config.banner.size == "SMART_BANNER":
load_banner()
if get_is_interstitial_loaded(): #verify if interstitial and rewarded is loaded because the only reason to load again now is to resize
load_interstitial()
if get_is_rewarded_loaded():
load_rewarded()
if get_is_rewarded_interstitial_loaded():
load_rewarded_interstitial()

View File

@ -0,0 +1,8 @@
const SAVE_ADMOB_GLOBALS_PATH := "user://admob_globals.tres"
static func get_plugin_version() -> String:
var plugin_config_file := ConfigFile.new()
plugin_config_file.load("res://addons/admob/plugin.cfg")
var version : String = plugin_config_file.get_value("plugin", "version")
return version

View File

@ -0,0 +1,4 @@
static func load_config(p_path) -> Dictionary:
if ProjectSettings.has_setting(p_path):
return ProjectSettings.get_setting(p_path)
return {}

View File

@ -0,0 +1,3 @@
static func save_config(p_path : String, p_config : Dictionary) -> void:
ProjectSettings.set_setting(p_path, p_config)
ProjectSettings.save()

View File

@ -0,0 +1,103 @@
var AdMobLoad = preload("res://addons/admob/src/utils/AdMobLoad.gd")
var AdMobSave = preload("res://addons/admob/src/utils/AdMobSave.gd")
enum INITIALIZATION_STATUS {NOT_READY, READY}
const PATH_ADMOB_PROJECT_SETTINGS = "admob/config"
const BANNER_SIZE : Array = ["BANNER", "MEDIUM_RECTANGLE", "FULL_BANNER", "LEADERBOARD", "ADAPTIVE", "SMART_BANNER"]
const MAX_AD_RATING : Array = ["G", "PG", "T", "MA"]
enum POSITION {BOTTOM, TOP}
var config : Dictionary = {
"general" : {
"is_enabled": true,
"is_for_child_directed_treatment": false,
"max_ad_content_rating": "PG"
},
"debug" : {
"is_debug_on_release": false,
"is_real": true,
"is_test_europe_user_consent": false
},
"banner": {
"position": POSITION.TOP,
"respect_safe_area" : true,
"show_instantly": true,
"size": BANNER_SIZE[0],
"unit_ids" : {
"Android": {
"standard" : "ca-app-pub-3940256099942544/6300978111",
},
"iOS": {
"standard" : "ca-app-pub-3940256099942544/2934735716"
}
}
},
"interstitial": {
"unit_ids" : {
"Android": {
"standard" : "ca-app-pub-3940256099942544/1033173712"
},
"iOS": {
"standard" : "ca-app-pub-3940256099942544/4411468910"
}
}
},
"rewarded": {
"unit_ids" : {
"Android": {
"standard" : "ca-app-pub-3940256099942544/5224354917"
},
"iOS": {
"standard" : "ca-app-pub-3940256099942544/1712485313"
}
}
},
"rewarded_interstitial": {
"unit_ids" : {
"Android": {
"standard" : "ca-app-pub-3940256099942544/5354046379"
},
"iOS": {
"standard" : "ca-app-pub-3940256099942544/6978759866"
}
}
}
} setget set_config
func _init():
var config_project_settings : Dictionary = AdMobLoad.load_config(PATH_ADMOB_PROJECT_SETTINGS)
merge_dir(config, config_project_settings)
if Engine.editor_hint:
save_config()
func save_config():
AdMobSave.save_config(PATH_ADMOB_PROJECT_SETTINGS, self.config)
func set_config(value : Dictionary):
config = value
save_config()
func merge_dir(target : Dictionary, patch : Dictionary):
for key in patch:
if target.has(key):
var tv = target[key]
if typeof(tv) == TYPE_DICTIONARY:
merge_dir(tv, patch[key])
else:
target[key] = patch[key]
else:
target[key] = patch[key]
static func pascal2snake(string : String) -> String:
string = string.replacen("adformat", "")
var result = PoolStringArray()
for ch in string:
if ch == ch.to_lower():
result.append(ch)
else:
result.append('_'+ch.to_lower())
result[0] = result[0][1]
return result.join('')

View File

@ -0,0 +1,299 @@
using Godot;
using System;
using System.Collections;
public class Example : Control
{
private Node MobileAds;
IDictionary config;
private Button EnableBanner;
private Button DisableBanner;
private Button ShowBanner;
private Button HideBanner;
private Button Interstitial;
private Button Rewarded;
private Button RewardedInterstitial;
private Button RequestUserConsent;
private Button ResetConsentState;
private RichTextLabel Advice;
private AudioStreamPlayer Music;
private CheckBox BannerPosition;
private ItemList BannerSizes;
private void GetAllNodes()
{
MobileAds = (Node) GetNode("/root/MobileAds");
config = (IDictionary) MobileAds.Get("config");
EnableBanner = (Button) GetNode("Background/TabContainer/AdFormats/VBoxContainer/Banner/EnableBanner");
DisableBanner = (Button) GetNode("Background/TabContainer/AdFormats/VBoxContainer/Banner/DisableBanner");
ShowBanner = (Button) GetNode("Background/TabContainer/AdFormats/VBoxContainer/Banner2/ShowBanner");
HideBanner = (Button) GetNode("Background/TabContainer/AdFormats/VBoxContainer/Banner2/HideBanner");
Interstitial = (Button) GetNode("Background/TabContainer/AdFormats/VBoxContainer/Interstitial");
Rewarded = (Button) GetNode("Background/TabContainer/AdFormats/VBoxContainer/Rewarded");
RewardedInterstitial = (Button) GetNode("Background/TabContainer/AdFormats/VBoxContainer/RewardedInterstitial");
RequestUserConsent = (Button) GetNode("Background/TabContainer/UMP/VBoxContainer/RequestUserConsent");
ResetConsentState = (Button) GetNode("Background/TabContainer/UMP/VBoxContainer/ResetConsentState");
Advice = (RichTextLabel) GetNode("Background/Advice");
Music = (AudioStreamPlayer) GetNode("Music");
BannerPosition = (CheckBox) GetNode("Background/TabContainer/Banner/VBoxContainer/Position");
BannerSizes = (ItemList) GetNode("Background/TabContainer/Banner/VBoxContainer/BannerSizes");
}
private void _add_text_Advice_Node(String text_value)
{
Advice.BbcodeText += text_value + "\n";
}
public override void _Ready()
{
GetAllNodes();
OS.CenterWindow();
Music.Play();
foreach(String banner_size in (IEnumerable) ((Godot.Object)MobileAds.Get("AdMobSettings")).Get("BANNER_SIZE"))
{
BannerSizes.AddItem(banner_size);
}
if (OS.GetName() == "Android" || OS.GetName() == "iOS"){
BannerPosition.Pressed = Convert.ToBoolean(((IDictionary) config["banner"])["position"]);
MobileAds.Call("request_user_consent");
MobileAds.Connect("consent_info_update_failure", this, nameof(_on_MobileAds_consent_info_update_failure));
MobileAds.Connect("consent_status_changed", this, nameof(_on_MobileAds_consent_status_changed));
MobileAds.Connect("banner_loaded", this, nameof(_on_MobileAds_banner_loaded));
MobileAds.Connect("banner_destroyed", this, nameof(_on_MobileAds_banner_destroyed));
MobileAds.Connect("interstitial_loaded", this, nameof(_on_MobileAds_interstitial_loaded));
MobileAds.Connect("interstitial_closed", this, nameof(_on_MobileAds_interstitial_closed));
MobileAds.Connect("rewarded_ad_loaded", this, nameof(_on_MobileAds_rewarded_ad_loaded));
MobileAds.Connect("rewarded_ad_closed", this, nameof(_on_MobileAds_rewarded_ad_closed));
MobileAds.Connect("rewarded_interstitial_ad_loaded", this, nameof(_on_MobileAds_rewarded_interstitial_ad_loaded));
MobileAds.Connect("rewarded_interstitial_ad_closed", this, nameof(_on_MobileAds_rewarded_interstitial_ad_closed));
MobileAds.Connect("user_earned_rewarded", this, nameof(_on_MobileAds_user_earned_rewarded));
MobileAds.Connect("initialization_complete", this, nameof(_on_MobileAds_initialization_complete));
}
else
{
_add_text_Advice_Node("AdMob only works on Android or iOS devices!");
}
}
private void _on_MobileAds_initialization_complete(int status, String _adapter_name)
{
if (status == (int)((IDictionary) ((Godot.Object)MobileAds.Get("AdMobSettings")).Get("INITIALIZATION_STATUS"))["READY"])
{
MobileAds.Call("load_interstitial");
MobileAds.Call("load_rewarded");
MobileAds.Call("load_rewarded_interstitial");
_add_text_Advice_Node("AdMob initialized on C#! With parameters:");
_add_text_Advice_Node("is_for_child_directed_treatment: " + ((IDictionary) config["general"])["is_for_child_directed_treatment"].ToString());
_add_text_Advice_Node("is_test_europe_user_consent: " + ((IDictionary) config["general"])["is_test_europe_user_consent"].ToString());
_add_text_Advice_Node("max_ad_content_rating: " + ((IDictionary) config["general"])["max_ad_content_rating"].ToString());
_add_text_Advice_Node("instance_id: " + GetInstanceId().ToString());
EnableBanner.Disabled = false;
BannerPosition.Disabled = false;
RequestUserConsent.Disabled = false;
ResetConsentState.Disabled = false;
}
else
{
_add_text_Advice_Node("AdMob not initialized, check your configuration");
}
_add_text_Advice_Node("---------------------------------------------------");
}
private void _on_MobileAds_interstitial_loaded()
{
_add_text_Advice_Node("Interstitial loaded");
Interstitial.Disabled = false;
}
private void _on_MobileAds_interstitial_closed()
{
MobileAds.Call("load_interstitial");
_add_text_Advice_Node("Interstitial closed");
}
private void _on_Interstitial_pressed()
{
MobileAds.Call("show_interstitial");
Interstitial.Disabled = true;
}
private void reset_banner_buttons()
{
DisableBanner.Disabled = true;
EnableBanner.Disabled = false;
ShowBanner.Disabled = true;
HideBanner.Disabled = true;
}
private void _on_MobileAds_banner_destroyed()
{
reset_banner_buttons();
_add_text_Advice_Node("Banner destroyed");
}
private void _on_MobileAds_banner_loaded()
{
DisableBanner.Disabled = false;
EnableBanner.Disabled = true;
ShowBanner.Disabled = false;
HideBanner.Disabled = false;
_add_text_Advice_Node("Banner loaded");
_add_text_Advice_Node("Banner width: " + MobileAds.Call("get_banner_width"));
_add_text_Advice_Node("Banner height: " + MobileAds.Call("get_banner_height"));
_add_text_Advice_Node("Banner width in pixels: " + MobileAds.Call("get_banner_width_in_pixels"));
_add_text_Advice_Node("Banner height in pixels: " + MobileAds.Call("get_banner_height_in_pixels"));
}
private void _on_EnableBanner_pressed()
{
EnableBanner.Disabled = true;
MobileAds.Call("load_banner");
}
private void _on_DisableBanner_pressed()
{
DisableBanner.Disabled = true;
EnableBanner.Disabled = false;
MobileAds.Call("destroy_banner");
}
private void _on_Rewarded_pressed()
{
MobileAds.Call("show_rewarded");
Rewarded.Disabled = true;
}
private void _on_RewardedInterstitial_pressed()
{
MobileAds.Call("show_rewarded_interstitial");
RewardedInterstitial.Disabled = true;
}
private void _on_MobileAds_rewarded_ad_loaded()
{
_add_text_Advice_Node("Rewarded ad loaded");
Rewarded.Disabled = false;
}
private void _on_MobileAds_rewarded_ad_closed()
{
MobileAds.Call("load_rewarded");
_add_text_Advice_Node("Rewarded ad closed");
}
private void _on_MobileAds_rewarded_interstitial_ad_loaded()
{
_add_text_Advice_Node("Rewarded Interstitial ad loaded");
RewardedInterstitial.Disabled = false;
}
private void _on_MobileAds_rewarded_interstitial_ad_closed()
{
MobileAds.Call("load_rewarded_interstitial");
_add_text_Advice_Node("Rewarded Interstitial ad closed");
}
private void _on_MobileAds_user_earned_rewarded(String currency, int amount)
{
Advice.BbcodeText += "EARNED " + currency + " with amount: " + amount.ToString() + "\n";
}
private void _on_MobileAds_consent_info_update_failure(int _error_code, String error_message)
{
_add_text_Advice_Node("Request Consent from European Users failure: " + error_message);
_add_text_Advice_Node("---------------------------------------------------");
}
private void _on_MobileAds_consent_status_changed(String status_message)
{
_add_text_Advice_Node(status_message);
}
private void _on_BannerSizes_item_selected(int index)
{
if ((bool) MobileAds.Call("get_is_initialized"))
{
String item_text = (String) BannerSizes.GetItemText(index);
((IDictionary)config["banner"])["size"] = index;
_add_text_Advice_Node("Banner Size changed:" + item_text);
if ((bool) MobileAds.Call("get_is_banner_loaded"))
{
MobileAds.Call("load_banner");
}
}
}
private void _on_ResetConsentState_pressed()
{
MobileAds.Call("reset_consent_state", true);
}
private void _on_RequestUserConsent_pressed()
{
MobileAds.Call("request_user_consent");
}
private void _on_Position_pressed()
{
((IDictionary)config["banner"])["position"] = BannerPosition.Pressed;
if ((bool)MobileAds.Call("get_is_banner_loaded"))
{
MobileAds.Call("load_banner");
}
}
private void _on_IsInitialized_pressed()
{
_add_text_Advice_Node("Is initialized: " + MobileAds.Call("get_is_initialized"));
}
private void _on_IsBannerLoaded_pressed()
{
_add_text_Advice_Node("Is Banner loaded: " + MobileAds.Call("get_is_banner_loaded"));
}
private void _on_IsInterstitialLoaded_pressed()
{
_add_text_Advice_Node("Is Interstitial loaded: " + MobileAds.Call("get_is_interstitial_loaded"));
}
private void _on_IsRewardedLoaded_pressed(){
_add_text_Advice_Node("Is Rewarded loaded: " + MobileAds.Call("get_is_rewarded_loaded"));
}
private void _on_IsRewardedInterstitialLoaded_pressed(){
_add_text_Advice_Node("Is RewardedInterstitial loaded: " + MobileAds.Call("get_is_rewarded_interstitial_loaded"));
}
private void _on_ShowBanner_pressed()
{
MobileAds.Call("show_banner");
}
private void _on_HideBanner_pressed()
{
MobileAds.Call("hide_banner");
}
}

View File

@ -0,0 +1,299 @@
extends Control
onready var EnableBanner : Button = $Background/TabContainer/AdFormats/VBoxContainer/Banner/EnableBanner
onready var DisableBanner : Button = $Background/TabContainer/AdFormats/VBoxContainer/Banner/DisableBanner
onready var ShowBanner : Button = $Background/TabContainer/AdFormats/VBoxContainer/Banner2/ShowBanner
onready var HideBanner : Button = $Background/TabContainer/AdFormats/VBoxContainer/Banner2/HideBanner
onready var Interstitial : Button = $Background/TabContainer/AdFormats/VBoxContainer/Interstitial
onready var Rewarded : Button = $Background/TabContainer/AdFormats/VBoxContainer/Rewarded
onready var RewardedInterstitial : Button = $Background/TabContainer/AdFormats/VBoxContainer/RewardedInterstitial
onready var RequestUserConsent : Button = $Background/TabContainer/UMP/VBoxContainer/RequestUserConsent
onready var ResetConsentState : Button = $Background/TabContainer/UMP/VBoxContainer/ResetConsentState
onready var Advice : RichTextLabel = $Background/Advice
onready var BannerPosition : CheckBox = $Background/TabContainer/Banner/VBoxContainer/Position
onready var RespectSafeArea : CheckBox = $Background/TabContainer/Banner/VBoxContainer/RespectSafeArea
onready var BannerSizes : ItemList = $Background/TabContainer/Banner/VBoxContainer/BannerSizes
func _add_text_Advice_Node(text_value : String) -> void:
Advice.bbcode_text += text_value + "\n"
func _ready() -> void:
BannerPosition.pressed = MobileAds.AdMobSettings.config.banner.position
RespectSafeArea.pressed = MobileAds.AdMobSettings.config.banner.respect_safe_area
OS.center_window()
for banner_size in MobileAds.AdMobSettings.BANNER_SIZE:
BannerSizes.add_item(banner_size)
if OS.get_name() == "Android" or OS.get_name() == "iOS":
# warning-ignore:return_value_discarded
MobileAds.connect("consent_form_dismissed", self, "_on_MobileAds_consent_form_dismissed")
# warning-ignore:return_value_discarded
MobileAds.connect("consent_form_load_failure", self, "_on_MobileAds_consent_form_load_failure")
# warning-ignore:return_value_discarded
MobileAds.connect("consent_info_update_failure", self, "_on_MobileAds_consent_info_update_failure")
# warning-ignore:return_value_discarded
MobileAds.connect("consent_info_update_success", self, "_on_MobileAds_consent_info_update_success")
# warning-ignore:return_value_discarded
MobileAds.connect("consent_status_changed", self, "_on_MobileAds_consent_status_changed")
# warning-ignore:return_value_discarded
MobileAds.connect("banner_loaded", self, "_on_MobileAds_banner_loaded")
# warning-ignore:return_value_discarded
MobileAds.connect("banner_destroyed", self, "_on_MobileAds_banner_destroyed")
# warning-ignore:return_value_discarded
MobileAds.connect("banner_clicked", self, "_on_MobileAds_banner_clicked")
# warning-ignore:return_value_discarded
MobileAds.connect("banner_closed", self, "_on_MobileAds_banner_closed")
# warning-ignore:return_value_discarded
MobileAds.connect("banner_failed_to_load", self, "_on_MobileAds_banner_failed_to_load")
# warning-ignore:return_value_discarded
MobileAds.connect("banner_recorded_impression", self, "_on_MobileAds_banner_recorded_impression")
# warning-ignore:return_value_discarded
MobileAds.connect("interstitial_loaded", self, "_on_MobileAds_interstitial_loaded")
# warning-ignore:return_value_discarded
MobileAds.connect("interstitial_closed", self, "_on_MobileAds_interstitial_closed")
# warning-ignore:return_value_discarded
MobileAds.connect("interstitial_clicked", self, "_on_MobileAds_interstitial_clicked")
# warning-ignore:return_value_discarded
MobileAds.connect("interstitial_failed_to_load", self, "_on_MobileAds_interstitial_failed_to_load")
# warning-ignore:return_value_discarded
MobileAds.connect("interstitial_failed_to_show", self, "_on_MobileAds_interstitial_failed_to_show")
# warning-ignore:return_value_discarded
MobileAds.connect("interstitial_opened", self, "_on_MobileAds_interstitial_opened")
# warning-ignore:return_value_discarded
MobileAds.connect("interstitial_recorded_impression", self, "_on_MobileAds_interstitial_recorded_impression")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_ad_loaded", self, "_on_MobileAds_rewarded_ad_loaded")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_ad_closed", self, "_on_MobileAds_rewarded_ad_closed")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_ad_clicked", self, "_on_MobileAds_rewarded_ad_clicked")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_ad_failed_to_load", self, "_on_MobileAds_rewarded_ad_failed_to_load")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_ad_failed_to_show", self, "_on_MobileAds_rewarded_ad_failed_to_show")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_ad_opened", self, "_on_MobileAds_rewarded_ad_opened")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_ad_recorded_impression", self, "_on_MobileAds_rewarded_ad_recorded_impression")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_interstitial_ad_loaded", self, "_on_MobileAds_rewarded_interstitial_ad_loaded")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_interstitial_ad_closed", self, "_on_MobileAds_rewarded_interstitial_ad_closed")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_interstitial_ad_clicked", self, "_on_MobileAds_rewarded_interstitial_ad_clicked")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_interstitial_ad_failed_to_load", self, "_on_MobileAds_rewarded_interstitial_ad_failed_to_load")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_interstitial_ad_failed_to_show", self, "_on_MobileAds_rewarded_interstitial_ad_failed_to_show")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_interstitial_ad_opened", self, "_on_MobileAds_rewarded_interstitial_ad_opened")
# warning-ignore:return_value_discarded
MobileAds.connect("rewarded_interstitial_ad_recorded_impression", self, "_on_MobileAds_rewarded_interstitial_ad_recorded_impression")
# warning-ignore:return_value_discarded
MobileAds.connect("user_earned_rewarded", self, "_on_MobileAds_user_earned_rewarded")
# warning-ignore:return_value_discarded
MobileAds.connect("initialization_complete", self, "_on_MobileAds_initialization_complete")
else:
_add_text_Advice_Node("AdMob only works on Android or iOS devices!")
func _on_MobileAds_rewarded_interstitial_ad_clicked():
_add_text_Advice_Node("Rewarded Interstitial clicked")
func _on_MobileAds_rewarded_interstitial_ad_failed_to_load(error_code):
_add_text_Advice_Node("Rewarded Interstitial failed to load, error_code = " + str(error_code))
func _on_MobileAds_rewarded_interstitial_ad_failed_to_show(error_code):
_add_text_Advice_Node("Rewarded Interstitial failed to show, error_code = " + str(error_code))
func _on_MobileAds_rewarded_interstitial_ad_opened():
_add_text_Advice_Node("Rewarded Interstitial opened")
func _on_MobileAds_rewarded_interstitial_ad_recorded_impression():
_add_text_Advice_Node("Rewarded Interstitial recorded impression")
func _on_MobileAds_rewarded_ad_clicked():
_add_text_Advice_Node("Rewarded clicked")
func _on_MobileAds_rewarded_ad_failed_to_load(error_code):
_add_text_Advice_Node("Rewarded failed to load, error_code = " + str(error_code))
func _on_MobileAds_rewarded_ad_failed_to_show(error_code):
_add_text_Advice_Node("Rewarded failed to show, error_code = " + str(error_code))
func _on_MobileAds_rewarded_ad_opened():
_add_text_Advice_Node("Rewarded opened")
func _on_MobileAds_rewarded_ad_recorded_impression():
_add_text_Advice_Node("Rewarded recorded impression")
func _on_MobileAds_interstitial_clicked():
_add_text_Advice_Node("Interstitial clicked")
func _on_MobileAds_interstitial_failed_to_load(error_code):
_add_text_Advice_Node("Interstitial failed to load, error_code = " + str(error_code))
func _on_MobileAds_interstitial_failed_to_show(error_code):
_add_text_Advice_Node("Interstitial failed to show, error_code = " + str(error_code))
func _on_MobileAds_interstitial_opened():
_add_text_Advice_Node("Interstitial opened")
func _on_MobileAds_interstitial_recorded_impression():
_add_text_Advice_Node("Interstitial recorded impression")
func _on_MobileAds_banner_clicked():
_add_text_Advice_Node("Banner clicked")
func _on_MobileAds_banner_closed():
_add_text_Advice_Node("Banner closed")
func _on_MobileAds_banner_failed_to_load(error_code):
_add_text_Advice_Node("Banner failed to load, error_code = " + str(error_code))
func _on_MobileAds_banner_recorded_impression():
_add_text_Advice_Node("Banner recorded impression")
func _on_MobileAds_initialization_complete(status : int, adapter_name : String) -> void:
if status == MobileAds.AdMobSettings.INITIALIZATION_STATUS.READY:
MobileAds.load_interstitial()
MobileAds.load_rewarded()
MobileAds.load_rewarded_interstitial()
_add_text_Advice_Node("AdMob initialized on GDScript! With parameters:")
_add_text_Advice_Node(JSON.print(MobileAds.config, "\t"))
_add_text_Advice_Node("instance_id: " + str(get_instance_id()))
EnableBanner.disabled = false
BannerPosition.disabled = false
RequestUserConsent.disabled = false
ResetConsentState.disabled = false
else:
_add_text_Advice_Node("AdMob not initialized, check your configuration")
_add_text_Advice_Node("---------------------------------------------------")
func _on_MobileAds_interstitial_loaded() -> void:
Interstitial.disabled = false
_add_text_Advice_Node("Interstitial loaded")
func _on_MobileAds_interstitial_closed() -> void:
MobileAds.load_interstitial()
_add_text_Advice_Node("Interstitial closed")
func _on_Interstitial_pressed() -> void:
MobileAds.show_interstitial()
Interstitial.disabled = true
func reset_banner_buttons() -> void:
DisableBanner.disabled = true
EnableBanner.disabled = false
ShowBanner.disabled = true
HideBanner.disabled = true
func _on_MobileAds_banner_destroyed() -> void:
reset_banner_buttons()
_add_text_Advice_Node("Banner destroyed")
func _on_MobileAds_banner_loaded() -> void:
DisableBanner.disabled = false
EnableBanner.disabled = true
ShowBanner.disabled = false
HideBanner.disabled = false
_add_text_Advice_Node("Banner loaded")
_add_text_Advice_Node("Banner width: " + str(MobileAds.get_banner_width()))
_add_text_Advice_Node("Banner height: " + str(MobileAds.get_banner_height()))
_add_text_Advice_Node("Banner width in pixels: " + str(MobileAds.get_banner_width_in_pixels()))
_add_text_Advice_Node("Banner height in pixels: " + str(MobileAds.get_banner_height_in_pixels()))
func _on_EnableBanner_pressed() -> void:
EnableBanner.disabled = true
MobileAds.load_banner()
func _on_DisableBanner_pressed() -> void:
DisableBanner.disabled = true
EnableBanner.disabled = false
MobileAds.destroy_banner()
func _on_Rewarded_pressed() -> void:
MobileAds.show_rewarded()
Rewarded.disabled = true
func _on_RewardedInterstitial_pressed() -> void:
MobileAds.show_rewarded_interstitial()
RewardedInterstitial.disabled = true
func _on_MobileAds_rewarded_ad_loaded() -> void:
Rewarded.disabled = false
_add_text_Advice_Node("Rewarded ad loaded")
func _on_MobileAds_rewarded_ad_closed() -> void:
MobileAds.load_rewarded()
_add_text_Advice_Node("Rewarded ad closed")
func _on_MobileAds_rewarded_interstitial_ad_loaded() -> void:
RewardedInterstitial.disabled = false
_add_text_Advice_Node("Rewarded Interstitial ad loaded")
func _on_MobileAds_rewarded_interstitial_ad_closed() -> void:
MobileAds.load_rewarded_interstitial()
_add_text_Advice_Node("Rewarded Interstitial ad closed")
func _on_MobileAds_user_earned_rewarded(currency : String, amount : int) -> void:
Advice.bbcode_text += "EARNED " + currency + " with amount: " + str(amount) + "\n"
func _on_MobileAds_consent_form_dismissed() -> void:
_add_text_Advice_Node("Request Consent from European Users Form dismissed")
func _on_MobileAds_consent_form_load_failure(error_code, error_message) -> void:
_add_text_Advice_Node("Request Consent from European Users load_failure: " + error_message)
_add_text_Advice_Node("---------------------------------------------------")
func _on_MobileAds_consent_info_update_failure(_error_code : int, error_message : String) -> void:
_add_text_Advice_Node("Request Consent from European Users update failure: " + error_message)
_add_text_Advice_Node("---------------------------------------------------")
func _on_MobileAds_consent_info_update_success(status_message : String) -> void:
_add_text_Advice_Node("Consent info update success: " + status_message)
func _on_MobileAds_consent_status_changed(status_message : String) -> void:
_add_text_Advice_Node("Consent status changed: " + status_message)
func _on_BannerSizes_item_selected(index : int) -> void:
if MobileAds.get_is_initialized():
var item_text : String = BannerSizes.get_item_text(index)
MobileAds.config.banner.size = item_text
_add_text_Advice_Node("Banner Size changed:" + item_text)
if MobileAds.get_is_banner_loaded():
MobileAds.load_banner()
func _on_ResetConsentState_pressed() -> void:
MobileAds.reset_consent_state(true)
func _on_RequestUserConsent_pressed() -> void:
MobileAds.request_user_consent()
func _on_Position_pressed() -> void:
MobileAds.config.banner.position = BannerPosition.pressed
if MobileAds.get_is_banner_loaded():
MobileAds.load_banner()
func _on_RespectSafeArea_pressed():
MobileAds.config.banner.respect_safe_area = RespectSafeArea.pressed
if MobileAds.get_is_banner_loaded():
MobileAds.load_banner()
func _on_IsInitialized_pressed() -> void:
_add_text_Advice_Node("Is initialized: " + str(MobileAds.get_is_initialized()))
func _on_IsBannerLoaded_pressed() -> void:
_add_text_Advice_Node("Is Banner loaded: " + str(MobileAds.get_is_banner_loaded()))
func _on_IsInterstitialLoaded_pressed() -> void:
_add_text_Advice_Node("Is Interstitial loaded: " + str(MobileAds.get_is_interstitial_loaded()))
func _on_IsRewardedLoaded_pressed() -> void:
_add_text_Advice_Node("Is Rewarded loaded: " + str(MobileAds.get_is_rewarded_loaded()))
func _on_IsRewardedInterstitialLoaded_pressed() -> void:
_add_text_Advice_Node("Is RewardedInterstitial loaded: " + str(MobileAds.get_is_rewarded_interstitial_loaded()))
func _on_ShowBanner_pressed() -> void:
MobileAds.show_banner()
func _on_HideBanner_pressed() -> void:
MobileAds.hide_banner()

View File

@ -0,0 +1,347 @@
[gd_scene load_steps=11 format=2]
[ext_resource path="res://addons/admob/test/Example.gd" type="Script" id=1]
[ext_resource path="res://addons/admob/assets/icon-500.png" type="Texture" id=2]
[ext_resource path="res://addons/admob/assets/poing.jpeg" type="Texture" id=3]
[ext_resource path="res://addons/admob/assets/music.ogg" type="AudioStream" id=4]
[ext_resource path="res://addons/admob/test/MusicCheckButton.gd" type="Script" id=5]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.36377, 0.23226, 0.0795746, 1 )
[sub_resource type="StyleBoxEmpty" id=2]
[sub_resource type="Theme" id=3]
TabContainer/styles/panel = SubResource( 2 )
[sub_resource type="StyleBoxFlat" id=4]
bg_color = Color( 0, 0, 0, 1 )
[sub_resource type="StyleBoxFlat" id=5]
bg_color = Color( 0, 0, 0, 1 )
[node name="Example" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false
}
[node name="Background" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 1, 0.541176, 0, 1 )
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false
}
[node name="Poing" type="TextureRect" parent="Background"]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -100.0
margin_top = -100.0
texture = ExtResource( 3 )
expand = true
stretch_mode = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AdMob" type="TextureRect" parent="Background"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -256.0
margin_top = -256.0
margin_right = 256.0
margin_bottom = 256.0
texture = ExtResource( 2 )
stretch_mode = 6
__meta__ = {
"_edit_lock_": true
}
[node name="Advice" type="RichTextLabel" parent="Background"]
anchor_top = 0.0933333
anchor_right = 1.0
anchor_bottom = 0.402222
custom_styles/normal = SubResource( 1 )
bbcode_enabled = true
bbcode_text = "[wave]"
scroll_following = true
__meta__ = {
"_edit_use_anchors_": true
}
[node name="TabContainer" type="TabContainer" parent="Background"]
anchor_left = 0.145
anchor_top = 0.546667
anchor_right = 0.855
anchor_bottom = 0.773333
theme = SubResource( 3 )
__meta__ = {
"_edit_use_anchors_": true
}
[node name="AdFormats" type="Tabs" parent="Background/TabContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 24.0
[node name="VBoxContainer" type="VBoxContainer" parent="Background/TabContainer/AdFormats"]
anchor_right = 1.0
anchor_bottom = 1.0
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Banner" type="HBoxContainer" parent="Background/TabContainer/AdFormats/VBoxContainer"]
margin_top = 46.0
margin_right = 426.0
margin_bottom = 66.0
size_flags_vertical = 0
alignment = 1
[node name="EnableBanner" type="Button" parent="Background/TabContainer/AdFormats/VBoxContainer/Banner"]
margin_right = 211.0
margin_bottom = 20.0
size_flags_horizontal = 3
disabled = true
text = "ENABLE BANNER"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DisableBanner" type="Button" parent="Background/TabContainer/AdFormats/VBoxContainer/Banner"]
margin_left = 215.0
margin_right = 426.0
margin_bottom = 20.0
size_flags_horizontal = 3
disabled = true
text = "DISABLE BANNER"
[node name="Banner2" type="HBoxContainer" parent="Background/TabContainer/AdFormats/VBoxContainer"]
margin_top = 70.0
margin_right = 426.0
margin_bottom = 90.0
size_flags_vertical = 0
alignment = 1
[node name="ShowBanner" type="Button" parent="Background/TabContainer/AdFormats/VBoxContainer/Banner2"]
margin_right = 211.0
margin_bottom = 20.0
size_flags_horizontal = 3
disabled = true
text = "SHOW BANNER"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HideBanner" type="Button" parent="Background/TabContainer/AdFormats/VBoxContainer/Banner2"]
margin_left = 215.0
margin_right = 426.0
margin_bottom = 20.0
size_flags_horizontal = 3
disabled = true
text = "HIDE BANNER"
[node name="Interstitial" type="Button" parent="Background/TabContainer/AdFormats/VBoxContainer"]
margin_top = 94.0
margin_right = 426.0
margin_bottom = 114.0
disabled = true
text = "INTERSTITIAL"
[node name="Rewarded" type="Button" parent="Background/TabContainer/AdFormats/VBoxContainer"]
margin_top = 118.0
margin_right = 426.0
margin_bottom = 138.0
disabled = true
text = "REWARDED"
[node name="RewardedInterstitial" type="Button" parent="Background/TabContainer/AdFormats/VBoxContainer"]
margin_top = 142.0
margin_right = 426.0
margin_bottom = 162.0
disabled = true
text = "REWARDED INTERSTITIAL"
[node name="Banner" type="Tabs" parent="Background/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 24.0
[node name="VBoxContainer" type="VBoxContainer" parent="Background/TabContainer/Banner"]
anchor_right = 1.0
anchor_bottom = 1.0
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Control" type="Control" parent="Background/TabContainer/Banner/VBoxContainer"]
margin_top = 58.0
margin_right = 355.0
margin_bottom = 68.0
rect_min_size = Vector2( 0, 10 )
[node name="Position" type="CheckBox" parent="Background/TabContainer/Banner/VBoxContainer"]
margin_top = 72.0
margin_right = 355.0
margin_bottom = 88.0
custom_styles/hover = SubResource( 4 )
custom_styles/pressed = SubResource( 4 )
custom_styles/normal = SubResource( 4 )
pressed = true
text = "Position on TOP"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="RespectSafeArea" type="CheckBox" parent="Background/TabContainer/Banner/VBoxContainer"]
margin_top = 92.0
margin_right = 355.0
margin_bottom = 108.0
custom_styles/hover = SubResource( 4 )
custom_styles/pressed = SubResource( 4 )
custom_styles/normal = SubResource( 4 )
text = "Respect Safe Area (RECOMMENDED TRUE)"
[node name="BannerSizes" type="ItemList" parent="Background/TabContainer/Banner/VBoxContainer"]
margin_top = 112.0
margin_right = 355.0
margin_bottom = 121.0
auto_height = true
same_column_width = true
__meta__ = {
"_edit_use_anchors_": true
}
[node name="UMP" type="Tabs" parent="Background/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 24.0
[node name="VBoxContainer" type="VBoxContainer" parent="Background/TabContainer/UMP"]
anchor_right = 1.0
anchor_bottom = 1.0
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="RequestUserConsent" type="Button" parent="Background/TabContainer/UMP/VBoxContainer"]
margin_top = 67.0
margin_right = 355.0
margin_bottom = 87.0
disabled = true
text = "REQUEST USER CONSENT"
[node name="ResetConsentState" type="Button" parent="Background/TabContainer/UMP/VBoxContainer"]
margin_top = 91.0
margin_right = 355.0
margin_bottom = 111.0
disabled = true
text = "RESET CONSENT STATE"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="General" type="Tabs" parent="Background/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 24.0
[node name="VBoxContainer" type="VBoxContainer" parent="Background/TabContainer/General"]
anchor_right = 1.0
anchor_bottom = 1.0
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="IsInitialized" type="Button" parent="Background/TabContainer/General/VBoxContainer"]
margin_top = 31.0
margin_right = 355.0
margin_bottom = 51.0
text = "is_initialized()"
[node name="IsBannerLoaded" type="Button" parent="Background/TabContainer/General/VBoxContainer"]
margin_top = 55.0
margin_right = 355.0
margin_bottom = 75.0
text = "is_banner_loaded()"
[node name="IsInterstitialLoaded" type="Button" parent="Background/TabContainer/General/VBoxContainer"]
margin_top = 79.0
margin_right = 355.0
margin_bottom = 99.0
text = "is_interstitial_loaded()"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="IsRewardedLoaded" type="Button" parent="Background/TabContainer/General/VBoxContainer"]
margin_top = 103.0
margin_right = 355.0
margin_bottom = 123.0
text = "is_rewarded_loaded()"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="IsRewardedInterstitialLoaded" type="Button" parent="Background/TabContainer/General/VBoxContainer"]
margin_top = 127.0
margin_right = 355.0
margin_bottom = 147.0
text = "is_rewarded_interstitial_loaded()"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MusicCheckButton" type="CheckButton" parent="Background"]
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
margin_left = -110.0
margin_top = -84.0
margin_bottom = -44.0
custom_styles/hover = SubResource( 5 )
custom_styles/pressed = SubResource( 5 )
custom_styles/normal = SubResource( 5 )
pressed = true
text = "MUSIC"
script = ExtResource( 5 )
[node name="Music" type="AudioStreamPlayer" parent="Background/MusicCheckButton"]
stream = ExtResource( 4 )
[connection signal="pressed" from="Background/TabContainer/AdFormats/VBoxContainer/Banner/EnableBanner" to="." method="_on_EnableBanner_pressed"]
[connection signal="pressed" from="Background/TabContainer/AdFormats/VBoxContainer/Banner/DisableBanner" to="." method="_on_DisableBanner_pressed"]
[connection signal="pressed" from="Background/TabContainer/AdFormats/VBoxContainer/Banner2/ShowBanner" to="." method="_on_ShowBanner_pressed"]
[connection signal="pressed" from="Background/TabContainer/AdFormats/VBoxContainer/Banner2/HideBanner" to="." method="_on_HideBanner_pressed"]
[connection signal="pressed" from="Background/TabContainer/AdFormats/VBoxContainer/Interstitial" to="." method="_on_Interstitial_pressed"]
[connection signal="pressed" from="Background/TabContainer/AdFormats/VBoxContainer/Rewarded" to="." method="_on_Rewarded_pressed"]
[connection signal="pressed" from="Background/TabContainer/AdFormats/VBoxContainer/RewardedInterstitial" to="." method="_on_RewardedInterstitial_pressed"]
[connection signal="pressed" from="Background/TabContainer/Banner/VBoxContainer/Position" to="." method="_on_Position_pressed"]
[connection signal="pressed" from="Background/TabContainer/Banner/VBoxContainer/RespectSafeArea" to="." method="_on_RespectSafeArea_pressed"]
[connection signal="item_selected" from="Background/TabContainer/Banner/VBoxContainer/BannerSizes" to="." method="_on_BannerSizes_item_selected"]
[connection signal="pressed" from="Background/TabContainer/UMP/VBoxContainer/RequestUserConsent" to="." method="_on_RequestUserConsent_pressed"]
[connection signal="pressed" from="Background/TabContainer/UMP/VBoxContainer/ResetConsentState" to="." method="_on_ResetConsentState_pressed"]
[connection signal="pressed" from="Background/TabContainer/General/VBoxContainer/IsInitialized" to="." method="_on_IsInitialized_pressed"]
[connection signal="pressed" from="Background/TabContainer/General/VBoxContainer/IsBannerLoaded" to="." method="_on_IsBannerLoaded_pressed"]
[connection signal="pressed" from="Background/TabContainer/General/VBoxContainer/IsInterstitialLoaded" to="." method="_on_IsInterstitialLoaded_pressed"]
[connection signal="pressed" from="Background/TabContainer/General/VBoxContainer/IsRewardedLoaded" to="." method="_on_IsRewardedLoaded_pressed"]
[connection signal="pressed" from="Background/TabContainer/General/VBoxContainer/IsRewardedInterstitialLoaded" to="." method="_on_IsRewardedInterstitialLoaded_pressed"]
[connection signal="pressed" from="Background/MusicCheckButton" to="Background/MusicCheckButton" method="_on_MusicCheckButton_pressed"]

View File

@ -0,0 +1,7 @@
extends CheckButton
func _ready():
$Music.playing = pressed
func _on_MusicCheckButton_pressed():
$Music.playing = pressed