Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
68
scripts/CustomControls/ChangeKarma/ChangeKarmaContainer.gd
Normal file
68
scripts/CustomControls/ChangeKarma/ChangeKarmaContainer.gd
Normal file
|
@ -0,0 +1,68 @@
|
|||
extends Control
|
||||
|
||||
onready var textScene = preload("res://resources/customControls/ChangeKarma/ChangeKarma.tscn");
|
||||
|
||||
var linesAmount:int = 0;
|
||||
|
||||
func AddText(event, charStructure):
|
||||
var locale = TranslationServer.get_locale();
|
||||
|
||||
var charName = tr(charStructure["charName"]);
|
||||
var color = charStructure["color"];
|
||||
|
||||
var sex:bool = charStructure["sex"];
|
||||
|
||||
var changedKarmaText = "";
|
||||
match locale:
|
||||
"en":
|
||||
if sex:
|
||||
changedKarmaText = "changes his attitude";
|
||||
else :
|
||||
changedKarmaText = "changes her attitude";
|
||||
"ja":
|
||||
|
||||
|
||||
|
||||
changedKarmaText = "が関係を";
|
||||
_:
|
||||
changedKarmaText = tr("ui_karma_changes_attitude");
|
||||
|
||||
var value = str(event["operation"], event["set_value"]);
|
||||
|
||||
if event["operation"] == "=":
|
||||
match locale:
|
||||
"en":
|
||||
value = str("to ", event["set_value"])
|
||||
"ru":
|
||||
value = str("на ", event["set_value"]);
|
||||
"uk":
|
||||
value = str("до ", event["set_value"]);
|
||||
"ja":
|
||||
value = str(event["set_value"]);
|
||||
_:
|
||||
pass;
|
||||
|
||||
var attribute:String = "";
|
||||
match locale:
|
||||
"ja":
|
||||
|
||||
attribute = str(" ", changedKarmaText, value, "変えます。");
|
||||
_:
|
||||
attribute = str(" ", changedKarmaText, " ", value);
|
||||
|
||||
var inst = textScene.instance();
|
||||
inst.SetName(charName, color);
|
||||
inst.SetAttitude(attribute);
|
||||
add_child(inst);
|
||||
linesAmount += 1;
|
||||
inst.StartAppearing();
|
||||
var _t = inst.connect("Deleted", self, "LineDeleted", [inst]);
|
||||
|
||||
func LineDeleted(line):
|
||||
Resize();
|
||||
line.disconnect("Deleted", self, "LineDeleted");
|
||||
|
||||
|
||||
func Resize():
|
||||
linesAmount -= 1;
|
||||
rect_size = Vector2(600, linesAmount * 50);
|
Loading…
Add table
Add a link
Reference in a new issue