Skip to content

Commit

Permalink
Merge pull request #114 from Poing-Studios/fix-error-4.1-get-plugin-v…
Browse files Browse the repository at this point in the history
…ersion-func

fix: error on Godot 4.1 `get_plugin_version` func
  • Loading branch information
gumaciel authored Nov 14, 2023
2 parents f9f4dbd + c3c46fd commit 89b9ee7
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 19 deletions.
7 changes: 3 additions & 4 deletions addons/admob/admob.gd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var ios_download_path := "res://addons/admob/downloads/ios/"
var default_download_path := "res://addons/admob/downloads/"
var current_download_path := default_download_path
var godot_version := "v" + str(Engine.get_version_info().major) + "." + str(Engine.get_version_info().minor) + "." + str(Engine.get_version_info().patch)
var plugin_version := get_plugin_version()
var plugin_version := PoingAdMobVersionHelper.get_plugin_version()

var version_support := {
"android": "v3.0.2",
Expand All @@ -44,7 +44,6 @@ enum Items {
GitHub
}


class PoingAdMobEditorExportPlugin extends EditorExportPlugin:
const CFG_FILE_PATH := "res://addons/admob/plugin.cfg"

Expand Down Expand Up @@ -102,7 +101,7 @@ func _exit_tree():


func _request_version_support():
var url = "https://raw.githubusercontent.com/Poing-Studios/godot-admob-versions/" + get_plugin_version() + "/versions.json"
var url = "https://raw.githubusercontent.com/Poing-Studios/godot-admob-versions/" + plugin_version + "/versions.json"
var http_request = HTTPRequest.new()
http_request.request_completed.connect(_on_version_support_request_completed)
add_child(http_request)
Expand Down Expand Up @@ -179,7 +178,7 @@ func _on_popupmenu_id_pressed(id : int):
var path_directory = ProjectSettings.globalize_path(default_download_path)
OS.shell_open(str("file://", path_directory))
Items.GitHub:
OS.shell_open("https://github.com/Poing-Studios/godot-admob-plugin/tree/" + get_plugin_version())
OS.shell_open("https://github.com/Poing-Studios/godot-admob-plugin/tree/" + plugin_version)

func show_download_percent(url_download: String = ""):
if not url_download.is_empty():
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/android.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/android.png-fb2caea48032eea3d74244daf04c3454.
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/format-app-open.svg.import
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/format-app-open.svg-09f678ee2c2c062157f34ba08
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/format-banner.svg.import
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/format-banner.svg-fa375daddf415dc3be42b87fb2a
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/format-interstitial.svg.import
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/format-interstitial.svg-068610673c8c89ff9e1c9
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/format-native.svg.import
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/format-native.svg-bcde3b00cc17049b22902f31b65
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/format-rewarded-interstitial.svg-e572976a0c09
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/icon-1024.png.import
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon-1024.png-2958e8f3e03f08146a840475cdd3cd6
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/icon-120.png.import
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon-120.png-f1130a47a81f19626ca0e688a5d38d3a
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/icon-15.png.import
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon-15.png-befc05bf38293c8cfe2bd393c6e153c6.
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/icon-500.png.import
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon-500.png-551469a97496c83ff13bc47c2b1cdefa
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/icon-76.png.import
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon-76.png-81101785e7e41d0daa72dddaf6f4956f.
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/assets/ios.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/ios.png-09946c77d84d877ee235a3ef7222fc0c.ctex
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
Empty file modified addons/admob/assets/music.ogg.import
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion addons/admob/assets/poing.jpeg.import
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/poing.jpeg-b1ae7a0b5e3bb646b5b1cf5ae07e3b86.c
[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand Down
2 changes: 1 addition & 1 deletion addons/admob/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="AdMob"
description="The AdMob Plugin for Android and iOS."
author="Poing Studios"
version="v3.0.1"
version="v3.0.2"
script="admob.gd"
7 changes: 6 additions & 1 deletion addons/admob/version_helper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static var version_formated : String = _get_plugin_version_formated() :
set(value):
version_formated = _get_plugin_version_formated()

static func _get_plugin_version_formated() -> String:
static func get_plugin_version() -> String:
var plugin_config_file := ConfigFile.new()
var version: String = "v3.0.1" #redundancy

Expand All @@ -36,6 +36,11 @@ static func _get_plugin_version_formated() -> String:
else:
push_error("Failed to load plugin.cfg")

return version

static func _get_plugin_version_formated() -> String:
var version := get_plugin_version()

var pattern = RegEx.new()
pattern.compile("(?:v)?(\\d+\\.\\d+\\.\\d+)")

Expand Down

0 comments on commit 89b9ee7

Please sign in to comment.