first Prototype
This commit is contained in:
parent
e11825c698
commit
35ce267482
481 changed files with 17315 additions and 1 deletions
|
|
@ -0,0 +1,31 @@
|
|||
# Placeholder UI for LocalizationEditor : MIT License
|
||||
# @author Vladimir Petrenko
|
||||
@tool
|
||||
extends MarginContainer
|
||||
|
||||
var _key
|
||||
var _locale
|
||||
var _data: LocalizationData
|
||||
|
||||
@onready var _placeholder_ui = $HBox/Placeholder
|
||||
|
||||
const Locales = preload("res://addons/localization_editor/model/LocalizationLocalesList.gd")
|
||||
|
||||
func set_data(key, locale, data: LocalizationData) -> void:
|
||||
_key = key
|
||||
_locale = locale
|
||||
_data = data
|
||||
_draw_view()
|
||||
|
||||
func _ready() -> void:
|
||||
_init_connections()
|
||||
|
||||
func _init_connections() -> void:
|
||||
if not _placeholder_ui.is_connected("text_changed", _on_text_changed):
|
||||
assert(_placeholder_ui.text_changed.connect(_on_text_changed) == OK)
|
||||
|
||||
func _draw_view() -> void:
|
||||
_placeholder_ui.text = _data.data_placeholders[_key][_locale]
|
||||
|
||||
func _on_text_changed(new_text) -> void:
|
||||
_data.data_placeholders[_key][_locale] = new_text
|
||||
Loading…
Add table
Add a link
Reference in a new issue