-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #742 from aaronfranke/2d-to-control
Convert some 2D nodes to Control nodes in GDPaint and Pseudolocalization demos
- Loading branch information
Showing
13 changed files
with
237 additions
and
180 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,67 @@ | ||
extends Node2D | ||
extends Control | ||
|
||
func _ready(): | ||
$HBoxContainer/Pseudolocalization_options/accents.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/replace_with_accents") | ||
$HBoxContainer/Pseudolocalization_options/toggle.button_pressed = TranslationServer.pseudolocalization_enabled | ||
$HBoxContainer/Pseudolocalization_options/fakebidi.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/fake_bidi") | ||
$HBoxContainer/Pseudolocalization_options/doublevowels.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/double_vowels") | ||
$HBoxContainer/Pseudolocalization_options/override.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/override") | ||
$HBoxContainer/Pseudolocalization_options/skipplaceholders.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/skip_placeholders") | ||
$HBoxContainer/Pseudolocalization_options/prefix/TextEdit.text = ProjectSettings.get("internationalization/pseudolocalization/prefix") | ||
$HBoxContainer/Pseudolocalization_options/suffix/TextEdit.text = ProjectSettings.get("internationalization/pseudolocalization/suffix") | ||
$HBoxContainer/Pseudolocalization_options/exp_ratio/TextEdit.text = str(ProjectSettings.get("internationalization/pseudolocalization/expansion_ratio")) | ||
pass | ||
$Main/Pseudolocalization_options/accents.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/replace_with_accents") | ||
$Main/Pseudolocalization_options/toggle.button_pressed = TranslationServer.pseudolocalization_enabled | ||
$Main/Pseudolocalization_options/fakebidi.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/fake_bidi") | ||
$Main/Pseudolocalization_options/doublevowels.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/double_vowels") | ||
$Main/Pseudolocalization_options/override.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/override") | ||
$Main/Pseudolocalization_options/skipplaceholders.button_pressed = ProjectSettings.get("internationalization/pseudolocalization/skip_placeholders") | ||
$Main/Pseudolocalization_options/prefix/TextEdit.text = ProjectSettings.get("internationalization/pseudolocalization/prefix") | ||
$Main/Pseudolocalization_options/suffix/TextEdit.text = ProjectSettings.get("internationalization/pseudolocalization/suffix") | ||
$Main/Pseudolocalization_options/exp_ratio/TextEdit.text = str(ProjectSettings.get("internationalization/pseudolocalization/expansion_ratio")) | ||
|
||
|
||
func _on_accents_toggled(button_pressed): | ||
ProjectSettings.set("internationalization/pseudolocalization/replace_with_accents", button_pressed) | ||
TranslationServer.reload_pseudolocalization() | ||
pass | ||
|
||
|
||
func _on_toggle_toggled(button_pressed): | ||
TranslationServer.pseudolocalization_enabled = button_pressed | ||
pass | ||
|
||
|
||
func _on_fakebidi_toggled(button_pressed): | ||
ProjectSettings.set("internationalization/pseudolocalization/fake_bidi", button_pressed) | ||
TranslationServer.reload_pseudolocalization() | ||
pass | ||
|
||
|
||
func _on_prefix_changed(): | ||
ProjectSettings.set("internationalization/pseudolocalization/prefix", $HBoxContainer/Pseudolocalization_options/prefix/TextEdit.text) | ||
ProjectSettings.set("internationalization/pseudolocalization/prefix", $Main/Pseudolocalization_options/prefix/TextEdit.text) | ||
TranslationServer.reload_pseudolocalization() | ||
pass | ||
|
||
|
||
func _on_suffix_changed(): | ||
ProjectSettings.set("internationalization/pseudolocalization/suffix", $HBoxContainer/Pseudolocalization_options/suffix/TextEdit.text) | ||
ProjectSettings.set("internationalization/pseudolocalization/suffix", $Main/Pseudolocalization_options/suffix/TextEdit.text) | ||
TranslationServer.reload_pseudolocalization() | ||
pass | ||
|
||
|
||
func _on_Pseudolocalize_pressed(): | ||
$HBoxContainer/Pseudolocalizer/Result.text = TranslationServer.pseudolocalize($HBoxContainer/Pseudolocalizer/Key.text) | ||
pass | ||
$Main/Pseudolocalizer/Result.text = TranslationServer.pseudolocalize($Main/Pseudolocalizer/Key.text) | ||
|
||
|
||
func _on_doublevowels_toggled(button_pressed): | ||
ProjectSettings.set("internationalization/pseudolocalization/double_vowels", button_pressed) | ||
TranslationServer.reload_pseudolocalization() | ||
pass | ||
|
||
|
||
func _on_expansion_ratio_text_changed(): | ||
float() | ||
var ratio = ($HBoxContainer/Pseudolocalization_options/exp_ratio/TextEdit.text).to_float() | ||
var ratio = ($Main/Pseudolocalization_options/exp_ratio/TextEdit.text).to_float() | ||
if ratio > 1: | ||
ratio = 1 | ||
$HBoxContainer/Pseudolocalization_options/exp_ratio/TextEdit.text = str(ratio) | ||
$Main/Pseudolocalization_options/exp_ratio/TextEdit.text = str(ratio) | ||
if ratio < 0: | ||
ratio = 0 | ||
$HBoxContainer/Pseudolocalization_options/exp_ratio/TextEdit.text = str(ratio) | ||
$Main/Pseudolocalization_options/exp_ratio/TextEdit.text = str(ratio) | ||
ProjectSettings.set("internationalization/pseudolocalization/expansion_ratio", ratio) | ||
TranslationServer.reload_pseudolocalization() | ||
pass | ||
|
||
|
||
func _on_override_toggled(button_pressed): | ||
ProjectSettings.set("internationalization/pseudolocalization/override", button_pressed) | ||
TranslationServer.reload_pseudolocalization() | ||
pass | ||
|
||
|
||
func _on_skipplaceholders_toggled(button_pressed): | ||
ProjectSettings.set("internationalization/pseudolocalization/skip_placeholders", button_pressed) | ||
TranslationServer.reload_pseudolocalization() | ||
pass |
Oops, something went wrong.