-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.gd
More file actions
42 lines (31 loc) · 1.42 KB
/
Copy pathmod.gd
File metadata and controls
42 lines (31 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
extends "GUMM_mod.gd"
func _initialize(scene_tree: SceneTree) -> void:
var theme = load_from_file()
print(theme)
replace_resource_at("res://Client/NPC.png", load_texture("mod://NPC.png"))
replace_resource_at("res://Bopimo/Client/Resources/Imported/Texture/Texture2D/CompressedTexture2D/GUI/Icons.png", load_texture("mod://Toolkit/NewIcons.png"))
replace_resource_at("res://Client/Scenes/GUI/Interface/Interface.tscn", load_resource("mod://Toolkit/Interface.tscn"))
#replace_resource_at("res://Client/Scripts/GUI/Interface.gd", load_resource("mod://Toolkit/Interface.gd"))
var spawner = Themer.new()
spawner.name = "Themer"
spawner.gumm = self
spawner.theme = load_resource(str("mod://Themes/", theme))
scene_tree.root.call_deferred("add_child", spawner)
print("\t!!! Loaded Butab's complete toolkit !!!\t")
func load_from_file():
var file = FileAccess.open("user://mods/ButabsToolkitMod/current_theme.dat", FileAccess.READ)
var content : String = file.get_as_text()
return str(content)
# Written by Winonamac!
#This class is watching for new nodes
class Themer extends Node:
var gumm
var theme
var default_theme = load("res://addons/BopimoTheme/Resources/BopimoTheme.tres")
func _ready():
# Notify me on each new node.
get_tree().node_added.connect(on_new_node)
func on_new_node(node):
if "theme" in node:
if node.theme == default_theme: # Only replace if node has the default theme.
node.theme = theme