It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
48
UI/MenuBar/Skills/LevelDisplay.gd
Normal file
48
UI/MenuBar/Skills/LevelDisplay.gd
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
extends HSplitContainer
|
||||
|
||||
class_name LevelDisplay
|
||||
|
||||
var currentSkill:Skill
|
||||
|
||||
var skillIconDisplay:TextureRect
|
||||
var skillNameDisplay:Label
|
||||
var skillLevelDisplay:Label
|
||||
var skillXPBar:ProgressBar
|
||||
|
||||
func _ready():
|
||||
skillIconDisplay = get_node("SkillIcon")
|
||||
skillNameDisplay = get_node("VSplitContainer/HSplitContainer/SkillName")
|
||||
skillLevelDisplay = get_node("VSplitContainer/HSplitContainer/SkillLevel")
|
||||
skillXPBar = get_node("VSplitContainer/XPBar")
|
||||
|
||||
func _process(_delta):
|
||||
if currentSkill != null:
|
||||
update_xp_bar()
|
||||
update_level()
|
||||
update_skill_info(currentSkill)
|
||||
|
||||
func update_xp_bar():
|
||||
skillXPBar.value = currentSkill.currentXP
|
||||
skillXPBar.max_value = LevelManager.get_XP_to_next_level(currentSkill.currentLevel)
|
||||
var currentXPString = XpDisplayUtils.xpFormater(currentSkill.currentXP, true)
|
||||
|
||||
if skillXPBar.max_value <= 9999999:
|
||||
var maxXPString = XpDisplayUtils.xpFormater(skillXPBar.max_value, true)
|
||||
skillXPBar.get_node("XPLabel").text = currentXPString + "/" + maxXPString + "XP"
|
||||
else:
|
||||
skillXPBar.get_node("XPLabel").text = currentXPString + "XP"
|
||||
|
||||
func update_level():
|
||||
skillLevelDisplay.text = "Lv. " + str(currentSkill.currentLevel)
|
||||
|
||||
func update_skill_info(skill:Skill):
|
||||
if !skill.hidden:
|
||||
skillIconDisplay.texture = currentSkill.get_icon()
|
||||
skillNameDisplay.text = currentSkill.skillName
|
||||
else:
|
||||
skillIconDisplay.texture = currentSkill.hiddenIcon
|
||||
skillNameDisplay.text = "???"
|
||||
|
||||
func set_skill(skill:Skill):
|
||||
currentSkill = skill
|
||||
update_skill_info(currentSkill)
|
||||
68
UI/MenuBar/Skills/LevelDisplay.tscn
Normal file
68
UI/MenuBar/Skills/LevelDisplay.tscn
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://baij4wsgpcd31"]
|
||||
|
||||
[ext_resource type="Script" path="res://UI/MenuBar/Skills/LevelDisplay.gd" id="1_7bb3j"]
|
||||
[ext_resource type="Texture2D" uid="uid://ot8vppthxuwx" path="res://Skills/Arson/arsonIcon.png" id="1_v5m46"]
|
||||
|
||||
[sub_resource type="Theme" id="Theme_tw8r0"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1kgag"]
|
||||
bg_color = Color(0.0980392, 0.580392, 0.305882, 1)
|
||||
corner_radius_top_left = 6
|
||||
corner_radius_bottom_left = 6
|
||||
|
||||
[node name="LevelDisplay" type="HSplitContainer"]
|
||||
offset_right = 267.0
|
||||
offset_bottom = 46.0
|
||||
script = ExtResource("1_7bb3j")
|
||||
|
||||
[node name="SkillIcon" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
theme = SubResource("Theme_tw8r0")
|
||||
texture = ExtResource("1_v5m46")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="VSplitContainer" type="VSplitContainer" parent="."]
|
||||
layout_mode = 2
|
||||
dragger_visibility = 2
|
||||
|
||||
[node name="HSplitContainer" type="HSplitContainer" parent="VSplitContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
dragger_visibility = 2
|
||||
|
||||
[node name="SkillName" type="Label" parent="VSplitContainer/HSplitContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "Arson"
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="SkillLevel" type="Label" parent="VSplitContainer/HSplitContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "Lv. 10"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="XPBar" type="ProgressBar" parent="VSplitContainer"]
|
||||
custom_minimum_size = Vector2(0, 20)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 2
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_1kgag")
|
||||
value = 30.0
|
||||
show_percentage = false
|
||||
|
||||
[node name="XPLabel" type="Label" parent="VSplitContainer/XPBar"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_top = -13.0
|
||||
offset_bottom = 13.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "4.3/6XP"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
14
UI/MenuBar/Skills/SkillsMenu.gd
Normal file
14
UI/MenuBar/Skills/SkillsMenu.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
extends PanelContainer
|
||||
|
||||
var levelDisplayScene = preload("res://UI/MenuBar/Skills/LevelDisplay.tscn")
|
||||
|
||||
func _ready():
|
||||
spawn_level_displays()
|
||||
|
||||
func spawn_level_displays():
|
||||
var skills = LevelManager.get_all_skills()
|
||||
for skill in skills:
|
||||
var newLevelDisplay = levelDisplayScene.instantiate()
|
||||
%LevelDisplayHolder.add_child(newLevelDisplay)
|
||||
newLevelDisplay.set_skill(skill)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue