From 9c33ad827e887b3374b53943614c25e513877ae0 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 23 Aug 2022 16:21:12 +0200 Subject: [PATCH] Better setup for the blog plugin. --- game/Main.tscn | 8 ++++--- game/addons/web_blog/classes/WebBlog.gd | 17 ++------------ .../web_blog/icons/icon_web_blog.svg.import | 6 ++--- game/addons/web_blog/plugin.gd | 22 +++---------------- game/project.pandemonium | 12 +++++++++- 5 files changed, 24 insertions(+), 41 deletions(-) diff --git a/game/Main.tscn b/game/Main.tscn index 62e8ca3..db7b272 100644 --- a/game/Main.tscn +++ b/game/Main.tscn @@ -1,14 +1,16 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gd" type="Script" id=1] +[ext_resource path="res://addons/web_blog/classes/WebBlog.gd" type="Script" id=2] [node name="WebServer" type="WebServerSimple"] script = ExtResource( 1 ) [node name="WebRoot" type="WebRoot" parent="."] -[node name="Gallery" type="WebNode" parent="WebRoot"] - [node name="index" type="StaticWebPage" parent="WebRoot"] uri_segment = "/" data = "Gallery" + +[node name="WebBlog" type="WebNode" parent="WebRoot"] +script = ExtResource( 2 ) diff --git a/game/addons/web_blog/classes/WebBlog.gd b/game/addons/web_blog/classes/WebBlog.gd index 1eccaec..fc9c496 100644 --- a/game/addons/web_blog/classes/WebBlog.gd +++ b/game/addons/web_blog/classes/WebBlog.gd @@ -1,16 +1,3 @@ -extends Node +extends WebNode +class_name WebBlog, "res://addons/web_blog/icons/icon_web_blog.svg" - -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - - -# Called when the node enters the scene tree for the first time. -func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass diff --git a/game/addons/web_blog/icons/icon_web_blog.svg.import b/game/addons/web_blog/icons/icon_web_blog.svg.import index be51519..8a0dc64 100644 --- a/game/addons/web_blog/icons/icon_web_blog.svg.import +++ b/game/addons/web_blog/icons/icon_web_blog.svg.import @@ -14,13 +14,13 @@ dest_files=[ "res://.import/icon_web_blog.svg-717b51dbe8e2412ad01ab3d85a2cfea9.s [params] -compress/mode=0 +compress/mode=3 compress/lossy_quality=0.7 compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -31,5 +31,5 @@ process/invert_color=false process/normal_map_invert_y=false stream=false size_limit=0 -detect_3d=true +detect_3d=false svg/scale=1.0 diff --git a/game/addons/web_blog/plugin.gd b/game/addons/web_blog/plugin.gd index 1fb1afd..256d543 100644 --- a/game/addons/web_blog/plugin.gd +++ b/game/addons/web_blog/plugin.gd @@ -1,27 +1,11 @@ tool extends EditorPlugin -var blog_icon : Texture = null - -#func _ready(): -# gallery_icon = ResourceLoader.load("res://addons/web_gallery/icons/icon_gallery.svg", ) - -func enable_plugin() ->void: +func _enter_tree(): pass -func disable_plugin() ->void: +func _exit_tree(): pass - + func get_plugin_name() -> String: return "WebBlogEditorPlugin" - -#func handles(object: Object) -> bool: -# return false - -#func has_main_screen() -> bool: -# return false - -#func make_visible(visible: bool) -> void: -# pass - - diff --git a/game/project.pandemonium b/game/project.pandemonium index d9d35a7..c91ac7e 100644 --- a/game/project.pandemonium +++ b/game/project.pandemonium @@ -8,6 +8,16 @@ config_version=4 +_global_script_classes=[ { +"base": "WebNode", +"class": @"WebBlog", +"language": @"GDScript", +"path": "res://addons/web_blog/classes/WebBlog.gd" +} ] +_global_script_class_icons={ +@"WebBlog": "res://addons/web_blog/icons/icon_web_blog.svg" +} + [application] config/name="Pandemonium CMS" @@ -16,7 +26,7 @@ config/icon="res://icon.png" [editor_plugins] -enabled=PoolStringArray( "res://addons/web_gallery/plugin.cfg" ) +enabled=PoolStringArray( "res://addons/web_blog/plugin.cfg", "res://addons/web_gallery/plugin.cfg" ) [physics]