Skip to content

Commit

Permalink
updated plugin to godot 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ninetailsrabbit committed Mar 4, 2025
1 parent 32b959e commit bd92d92
Show file tree
Hide file tree
Showing 23 changed files with 26 additions and 747 deletions.
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

21 changes: 0 additions & 21 deletions addons/ninetailsrabbit.lootie/ninetailsrabbit.lootie.gd
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
@tool
extends EditorPlugin

const UpdateNotifyToolScene = preload("updater/update_notify_tool.tscn")

var update_notify_tool_instance: Node

func _enter_tree() -> void:
MyPluginSettings.set_update_notification()
_setup_updater()

if not DirAccess.dir_exists_absolute(MyPluginSettings.PluginTemporaryReleaseUpdateDirectoryPath):
DirAccess.make_dir_recursive_absolute(MyPluginSettings.PluginTemporaryReleaseUpdateDirectoryPath)

add_custom_type("LootItem", "Resource", preload("src/loot_item.gd"), null)
add_custom_type("LootItemRarity", "Resource", preload("src/probability_modes/loot_item_rarity.gd"), null)
add_custom_type("LootItemWeight", "Resource", preload("src/probability_modes/loot_item_weight.gd"), null)
Expand All @@ -23,12 +14,6 @@ func _enter_tree() -> void:


func _exit_tree() -> void:
MyPluginSettings.remove_settings()

if update_notify_tool_instance:
update_notify_tool_instance.free()
update_notify_tool_instance = null

remove_autoload_singleton("LootieGlobal")

remove_custom_type("LootTableData")
Expand All @@ -39,9 +24,3 @@ func _exit_tree() -> void:
remove_custom_type("LootItem")

remove_custom_type("LootieTable")

## Update tool referenced from https://github.com/MikeSchulze/gdUnit4/blob/master/addons/gdUnit4
func _setup_updater() -> void:
if MyPluginSettings.is_update_notification_enabled():
update_notify_tool_instance = UpdateNotifyToolScene.instantiate()
Engine.get_main_loop().root.add_child.call_deferred(update_notify_tool_instance)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bjvfwdobxemhk
2 changes: 1 addition & 1 deletion addons/ninetailsrabbit.lootie/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Lootie"
description="Portable loot table for Godot class that facilitates generating random loot based on specified items and their associated probabilities."
author="Ninetailsrabbit"
version="1.0.2"
version="1.1.0"
script="ninetailsrabbit.lootie.gd"
22 changes: 1 addition & 21 deletions addons/ninetailsrabbit.lootie/settings/plugin_settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,12 @@ static var PluginTemporaryReleaseFilePath = "%s/%s.zip" % [PluginTemporaryDirect
static var PluginDebugDirectoryPath = "res://debug"

#region Plugin Settings
static var UpdateNotificationSetting: String = PluginSettingsBasePath + "/update_notification_enabled"
## PluginSettingsBasePath + "/update_notification_enabled"
#endregion

## Enable to test the updater without need to have a latest release version to trigger it
static var DebugMode: bool = false

static func set_update_notification(enable: bool = true) -> void:
ProjectSettings.set_setting(UpdateNotificationSetting, enable)
ProjectSettings.add_property_info({
"name": UpdateNotificationSetting,
"type": typeof(enable),
"value": enable,
"hint": PROPERTY_HINT_TYPE_STRING,
"hint_string": "Turn notifications on or off to receive alerts when new versions of the plugin are released"
})
ProjectSettings.save()


static func is_update_notification_enabled() -> bool:
return ProjectSettings.get_setting(UpdateNotificationSetting, true)


static func remove_settings() -> void:
remove_setting(UpdateNotificationSetting)


static func remove_setting(name: String) -> void:
if ProjectSettings.has_setting(name):
ProjectSettings.set_setting(name, null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://24vtpvhdmbxv
1 change: 1 addition & 0 deletions addons/ninetailsrabbit.lootie/src/loot_item.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cu0csg0rk7pyt
1 change: 1 addition & 0 deletions addons/ninetailsrabbit.lootie/src/loot_table.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cg8q6gv1t1bct
1 change: 1 addition & 0 deletions addons/ninetailsrabbit.lootie/src/loot_table_data.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cqdad5le7fsh8
1 change: 1 addition & 0 deletions addons/ninetailsrabbit.lootie/src/lootie_global.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bhq05737e6hse
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bh3psrckmu2jc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dhf58flkvmfky
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cnkgft1vecm6w
66 changes: 0 additions & 66 deletions addons/ninetailsrabbit.lootie/updater/plugin_version.gd

This file was deleted.

121 changes: 0 additions & 121 deletions addons/ninetailsrabbit.lootie/updater/update_notify_tool.gd

This file was deleted.

Loading

0 comments on commit bd92d92

Please sign in to comment.