Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
32
scripts/CustomControls/ChangeKarma/ChangeKarma.gd
Normal file
32
scripts/CustomControls/ChangeKarma/ChangeKarma.gd
Normal file
|
@ -0,0 +1,32 @@
|
|||
extends HBoxContainer
|
||||
|
||||
signal Deleted;
|
||||
|
||||
var defaultFont = null;
|
||||
|
||||
func SetName(charName:String, color:String):
|
||||
if charName == tr("ui_name_black"):
|
||||
var font = $Name.get("custom_fonts/normal_font").duplicate();
|
||||
font.outline_color = Color(1, 1, 1, 1);
|
||||
font.outline_size = 1;
|
||||
$Name.set("custom_fonts/normal_font", font);
|
||||
|
||||
defaultFont = $Attitude.get("custom_fonts/normal_font");
|
||||
|
||||
$Name.bbcode_text = str("[color=", color, "] ", charName, "[/color]");
|
||||
$Name.rect_min_size = Vector2(Resize(str(" ", charName)), 50);
|
||||
|
||||
func SetAttitude(attribute:String):
|
||||
$Attitude.bbcode_text = attribute;
|
||||
$Attitude.rect_min_size = Vector2(Resize(attribute), 50);
|
||||
|
||||
func Resize(temp:String)->float:
|
||||
return defaultFont.get_string_size(temp).x;
|
||||
|
||||
func StartAppearing():
|
||||
self_modulate = Color(1, 1, 1, 1);
|
||||
$AnimationPlayer.play("ChangeKarmaAnimation");
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(_anim_name):
|
||||
emit_signal("Deleted");
|
||||
queue_free();
|
Loading…
Add table
Add a link
Reference in a new issue