Correct bug with 2nd loaded image in item creator showing at the wrong size
This commit is contained in:
committed by
Julian Murgia
parent
f74cb48b3d
commit
c660e2d51c
@@ -31,10 +31,14 @@ var image_size:Vector2
|
|||||||
var main_menu_requested:bool
|
var main_menu_requested:bool
|
||||||
var inventory_mode:bool
|
var inventory_mode:bool
|
||||||
var settings_modified:bool
|
var settings_modified:bool
|
||||||
|
var preview_size:Vector2
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
# Capture the size of the window before we update its contents so we have
|
||||||
|
# the absolute size before it gets scaled contents applied to it
|
||||||
|
preview_size = get_node(PREVIEW_NODE).rect_size
|
||||||
inventory_mode = false
|
inventory_mode = false
|
||||||
item_creator_reset()
|
item_creator_reset()
|
||||||
|
|
||||||
@@ -81,8 +85,6 @@ func item_creator_reset() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func resize_image() -> void:
|
func resize_image() -> void:
|
||||||
var preview_size = get_node(PREVIEW_NODE).rect_size
|
|
||||||
|
|
||||||
# Calculate the scale to make the preview as big as possible in the preview window depending on
|
# Calculate the scale to make the preview as big as possible in the preview window depending on
|
||||||
# the height to width ratio of the frame
|
# the height to width ratio of the frame
|
||||||
image_size = image_stream_texture.get_size()
|
image_size = image_stream_texture.get_size()
|
||||||
@@ -95,7 +97,6 @@ func resize_image() -> void:
|
|||||||
else:
|
else:
|
||||||
get_node(PREVIEW_NODE).rect_scale = Vector2(preview_scale.y, preview_scale.y)
|
get_node(PREVIEW_NODE).rect_scale = Vector2(preview_scale.y, preview_scale.y)
|
||||||
|
|
||||||
|
|
||||||
func background_on_ItemName_text_changed(new_text: String) -> void:
|
func background_on_ItemName_text_changed(new_text: String) -> void:
|
||||||
get_node(GLOBAL_ID_NODE).text = new_text
|
get_node(GLOBAL_ID_NODE).text = new_text
|
||||||
settings_modified = true
|
settings_modified = true
|
||||||
|
|||||||
@@ -745,7 +745,7 @@ search_in_file_extensions=PoolStringArray( "gd", "shader", "esc" )
|
|||||||
|
|
||||||
[editor_plugins]
|
[editor_plugins]
|
||||||
|
|
||||||
enabled=PoolStringArray( "res://addons/escoria-core/plugin.cfg", "res://addons/escoria-dialog-simple/plugin.cfg", "res://addons/escoria-ui-9verbs/plugin.cfg" )
|
enabled=PoolStringArray( "res://addons/escoria-core/plugin.cfg", "res://addons/escoria-dialog-simple/plugin.cfg", "res://addons/escoria-ui-9verbs/plugin.cfg", "res://addons/escoria-wizard/plugin.cfg", "res://addons/godot-plugin-refresher/plugin.cfg" )
|
||||||
|
|
||||||
[escoria]
|
[escoria]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user