create export plugin to make window default size 16x16, while still allowing for easy overlay editing

This commit is contained in:
Crispy 2021-06-03 23:21:05 +02:00
parent 3993531f2d
commit 6b18c51391
4 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,14 @@
tool
extends EditorPlugin
var export_plugin
func _enter_tree():
export_plugin = preload("res://addons/ovr_utils/ovr_utils_exporter.gd").new()
add_export_plugin(export_plugin)
func _exit_tree():
if export_plugin:
remove_export_plugin(export_plugin)

View file

@ -0,0 +1,12 @@
tool
extends EditorExportPlugin
func _export_begin(features: PoolStringArray, is_debug: bool, path: String, flags: int) -> void:
ProjectSettings.set_setting("display/window/size/height", 16)
ProjectSettings.set_setting("display/window/size/width", 16)
ProjectSettings.save()
func _export_end() -> void:
ProjectSettings.set_setting("display/window/size/height", 2048)
ProjectSettings.set_setting("display/window/size/width", 2048)
ProjectSettings.save()

View file

@ -0,0 +1,7 @@
[plugin]
name="OVR Utils"
description="OVR Utils exporter"
author="CrispyPin"
version=""
script="ovr_utils.gd"

View file

@ -29,7 +29,7 @@ window/size/height=2048
[editor_plugins] [editor_plugins]
enabled=PoolStringArray( "res://addons/godot-openvr/plugin.cfg", "res://addons/openvr_overlay/plugin.cfg", "res://addons/settings-manager/plugin.cfg" ) enabled=PoolStringArray( "res://addons/godot-openvr/plugin.cfg", "res://addons/openvr_overlay/plugin.cfg", "res://addons/ovr_utils/plugin.cfg", "res://addons/settings-manager/plugin.cfg" )
[gdnative] [gdnative]