mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Initial class and plugin setup.
This commit is contained in:
parent
c3093be0d4
commit
5723a11825
@ -1,10 +1,64 @@
|
||||
tool
|
||||
extends EditorPlugin
|
||||
|
||||
var WorldGenWorld = preload("res://addons/world_generator/resources/world_gen_world.gd")
|
||||
var Continent = preload("res://addons/world_generator/resources/continent.gd")
|
||||
var Zone = preload("res://addons/world_generator/resources/zone.gd")
|
||||
var SubZone = preload("res://addons/world_generator/resources/subzone.gd")
|
||||
|
||||
var editor_packed_scene = preload("res://addons/world_generator/ui/MainScreen.tscn")
|
||||
var editor_scene = null
|
||||
|
||||
var tool_button : ToolButton = null
|
||||
|
||||
func _enter_tree():
|
||||
pass
|
||||
add_custom_type("WorldGenWorld", "Resource", WorldGenWorld, null)
|
||||
add_custom_type("Continent", "Resource", Continent, null)
|
||||
add_custom_type("Zone", "Resource", Zone, null)
|
||||
add_custom_type("SubZone", "Resource", SubZone, null)
|
||||
|
||||
editor_scene = editor_packed_scene.instance()
|
||||
|
||||
tool_button = add_control_to_bottom_panel(editor_scene, "WorldEditor")
|
||||
tool_button.hide()
|
||||
|
||||
func _exit_tree():
|
||||
pass
|
||||
remove_custom_type("WorldGenWorld")
|
||||
remove_custom_type("Continent")
|
||||
remove_custom_type("Zone")
|
||||
remove_custom_type("SubZone")
|
||||
|
||||
remove_control_from_bottom_panel(editor_scene)
|
||||
|
||||
|
||||
func handles(object):
|
||||
return object is WorldGenWorld
|
||||
|
||||
func edit(object):
|
||||
#if editor_scene:
|
||||
# make_bottom_panel_item_visible(editor_scene)
|
||||
|
||||
if object is WorldGenWorld:
|
||||
editor_scene.set_mmmaterial(object as WorldGenWorld)
|
||||
|
||||
func make_visible(visible):
|
||||
if tool_button:
|
||||
if visible:
|
||||
tool_button.show()
|
||||
else:
|
||||
#if tool_button.pressed:
|
||||
# tool_button.pressed = false
|
||||
|
||||
if !tool_button.pressed:
|
||||
tool_button.hide()
|
||||
|
||||
func get_plugin_icon():
|
||||
return null
|
||||
|
||||
func get_plugin_name():
|
||||
return "WorldGeneratorEditor"
|
||||
|
||||
func has_main_screen():
|
||||
return false
|
||||
|
||||
|
||||
|
3
game/addons/world_generator/resources/continent.gd
Normal file
3
game/addons/world_generator/resources/continent.gd
Normal file
@ -0,0 +1,3 @@
|
||||
tool
|
||||
extends Resource
|
||||
class_name Continent
|
3
game/addons/world_generator/resources/subzone.gd
Normal file
3
game/addons/world_generator/resources/subzone.gd
Normal file
@ -0,0 +1,3 @@
|
||||
tool
|
||||
extends Resource
|
||||
class_name SubZone
|
3
game/addons/world_generator/resources/world_gen_world.gd
Normal file
3
game/addons/world_generator/resources/world_gen_world.gd
Normal file
@ -0,0 +1,3 @@
|
||||
tool
|
||||
extends Resource
|
||||
class_name WorldGenWorld
|
3
game/addons/world_generator/resources/zone.gd
Normal file
3
game/addons/world_generator/resources/zone.gd
Normal file
@ -0,0 +1,3 @@
|
||||
tool
|
||||
extends Resource
|
||||
class_name Zone
|
6
game/addons/world_generator/test/test_world.tres
Normal file
6
game/addons/world_generator/test/test_world.tres
Normal file
@ -0,0 +1,6 @@
|
||||
[gd_resource type="Resource" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/world_generator/resources/world_gen_world.gd" type="Script" id=1]
|
||||
|
||||
[resource]
|
||||
script = ExtResource( 1 )
|
124
game/addons/world_generator/ui/MainScreen.tscn
Normal file
124
game/addons/world_generator/ui/MainScreen.tscn
Normal file
@ -0,0 +1,124 @@
|
||||
[gd_scene format=2]
|
||||
|
||||
[node name="Control" type="PanelContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
rect_min_size = Vector2( 0, 200 )
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="."]
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 1017.0
|
||||
margin_bottom = 593.0
|
||||
tab_align = 0
|
||||
|
||||
[node name="World" 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
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="TabContainer/World"]
|
||||
margin_right = 1002.0
|
||||
margin_bottom = 20.0
|
||||
|
||||
[node name="AddButton" type="Button" parent="TabContainer/World/HBoxContainer"]
|
||||
margin_right = 37.0
|
||||
margin_bottom = 20.0
|
||||
text = "Add"
|
||||
|
||||
[node name="DeleteButton" type="Button" parent="TabContainer/World/HBoxContainer"]
|
||||
margin_left = 41.0
|
||||
margin_right = 96.0
|
||||
margin_bottom = 20.0
|
||||
text = "Delete"
|
||||
|
||||
[node name="Continent" 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
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="TabContainer/Continent"]
|
||||
margin_right = 1002.0
|
||||
margin_bottom = 20.0
|
||||
|
||||
[node name="AddButton" type="Button" parent="TabContainer/Continent/HBoxContainer"]
|
||||
margin_right = 37.0
|
||||
margin_bottom = 20.0
|
||||
text = "Add"
|
||||
|
||||
[node name="DeleteButton" type="Button" parent="TabContainer/Continent/HBoxContainer"]
|
||||
margin_left = 41.0
|
||||
margin_right = 96.0
|
||||
margin_bottom = 20.0
|
||||
text = "Delete"
|
||||
|
||||
[node name="Zone" 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
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="TabContainer/Zone"]
|
||||
margin_right = 1002.0
|
||||
margin_bottom = 20.0
|
||||
|
||||
[node name="AddButton" type="Button" parent="TabContainer/Zone/HBoxContainer"]
|
||||
margin_right = 37.0
|
||||
margin_bottom = 20.0
|
||||
text = "Add"
|
||||
|
||||
[node name="DeleteButton" type="Button" parent="TabContainer/Zone/HBoxContainer"]
|
||||
margin_left = 41.0
|
||||
margin_right = 96.0
|
||||
margin_bottom = 20.0
|
||||
text = "Delete"
|
||||
|
||||
[node name="SubZone" 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
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="TabContainer/SubZone"]
|
||||
margin_right = 1002.0
|
||||
margin_bottom = 20.0
|
||||
|
||||
[node name="AddButton" type="Button" parent="TabContainer/SubZone/HBoxContainer"]
|
||||
margin_right = 37.0
|
||||
margin_bottom = 20.0
|
||||
text = "Add"
|
||||
|
||||
[node name="DeleteButton" type="Button" parent="TabContainer/SubZone/HBoxContainer"]
|
||||
margin_left = 41.0
|
||||
margin_right = 96.0
|
||||
margin_bottom = 20.0
|
||||
text = "Delete"
|
@ -29,6 +29,11 @@ _global_script_classes=[ {
|
||||
"language": "GDScript",
|
||||
"path": "res://addons/color-palette/ColorTile.gd"
|
||||
}, {
|
||||
"base": "Resource",
|
||||
"class": "Continent",
|
||||
"language": "GDScript",
|
||||
"path": "res://addons/world_generator/resources/continent.gd"
|
||||
}, {
|
||||
"base": "Entity",
|
||||
"class": "DisplayPlayerGD",
|
||||
"language": "GDScript",
|
||||
@ -224,6 +229,11 @@ _global_script_classes=[ {
|
||||
"language": "GDScript",
|
||||
"path": "res://scripts/spells/gd_spell_script.gd"
|
||||
}, {
|
||||
"base": "Resource",
|
||||
"class": "SubZone",
|
||||
"language": "GDScript",
|
||||
"path": "res://addons/world_generator/resources/subzone.gd"
|
||||
}, {
|
||||
"base": "GameModule",
|
||||
"class": "UIGuiChildModule",
|
||||
"language": "GDScript",
|
||||
@ -233,12 +243,23 @@ _global_script_classes=[ {
|
||||
"class": "UIWindowModule",
|
||||
"language": "GDScript",
|
||||
"path": "res://scripts/game_modules/ui_window_module.gd"
|
||||
}, {
|
||||
"base": "Resource",
|
||||
"class": "WorldGenWorld",
|
||||
"language": "GDScript",
|
||||
"path": "res://addons/world_generator/resources/world_gen_world.gd"
|
||||
}, {
|
||||
"base": "Resource",
|
||||
"class": "Zone",
|
||||
"language": "GDScript",
|
||||
"path": "res://addons/world_generator/resources/zone.gd"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
"AuraGD": "",
|
||||
"BrushPrefabs": "",
|
||||
"CharacterSkeketonAttachPoint": "",
|
||||
"ColorTile": "",
|
||||
"Continent": "",
|
||||
"DisplayPlayerGD": "",
|
||||
"EntityAIGD": "",
|
||||
"EntityDataGD": "",
|
||||
@ -278,8 +299,11 @@ _global_script_class_icons={
|
||||
"SpeedResource": "",
|
||||
"SpellEffectVisualBasic": "",
|
||||
"SpellGD": "",
|
||||
"SubZone": "",
|
||||
"UIGuiChildModule": "",
|
||||
"UIWindowModule": ""
|
||||
"UIWindowModule": "",
|
||||
"WorldGenWorld": "",
|
||||
"Zone": ""
|
||||
}
|
||||
Node="input/actionbar_5_11"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user