Skip to content

Commit

Permalink
custom creature level fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Nov 30, 2023
1 parent 8d020e3 commit 9ac01f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions Scenes/ThingInstance.gd
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ func _on_zoom_level_changed(zoom):
inventScale.x = clamp(zoom.x, 1.0, oUi.FONT_SIZE_CR_LVL_MAX)
inventScale.y = clamp(zoom.y, 1.0, oUi.FONT_SIZE_CR_LVL_MAX)
if zoom.x > oUi.FONT_SIZE_CR_LVL_MAX or oQuickMapPreview.visible == true:
$ThingTexture/CreatureLevel.self_modulate = Color(0,0,0,0)
$CreatureLevel.self_modulate = Color(0,0,0,0)
else:
$ThingTexture/CreatureLevel.self_modulate = Color(1,1,1,1)
$CreatureLevel.self_modulate = Color(1,1,1,1)

$ThingTexture/CreatureLevel.scale = inventScale * oUi.FONT_SIZE_CR_LVL_BASE
$CreatureLevel.scale = inventScale * oUi.FONT_SIZE_CR_LVL_BASE * 1.5

func set_ownership(setval):
ownership = setval
Expand Down Expand Up @@ -185,8 +185,8 @@ func set_doorOrientation(setval):
func set_creatureLevel(setval):
data14 = null
creatureLevel = setval
$ThingTexture/CreatureLevel.frame = creatureLevel-1
$ThingTexture/CreatureLevel.visible = true
$CreatureLevel.frame = creatureLevel-1
$CreatureLevel.visible = true

func set_boxNumber(setval):
data14 = null
Expand Down Expand Up @@ -268,8 +268,6 @@ func set_texture_based_on_thingtype():
else:
$TextNameLabel.grow_vertical = Control.GROW_DIRECTION_END



func set_grow_direction():
# Change Grow Direction so the art pokes out from the base.
var texpath = $ThingTexture.texture.get_path()
Expand Down
4 changes: 2 additions & 2 deletions Scenes/ThingInstance.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ size_flags_vertical = 3
texture = SubResource( 4 )
stretch_mode = 6

[node name="CreatureLevel" type="AnimatedSprite" parent="ThingTexture"]
[node name="CreatureLevel" type="AnimatedSprite" parent="."]
visible = false
position = Vector2( 15, 2 )
position = Vector2( -1, -21 )
z_index = 10
frames = SubResource( 3 )

Expand Down

0 comments on commit 9ac01f3

Please sign in to comment.