-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWeaponInfoPanel.cs
More file actions
42 lines (33 loc) · 1.17 KB
/
WeaponInfoPanel.cs
File metadata and controls
42 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using Godot;
using System;
public class WeaponInfoPanel : Panel
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
private Panel startButton;
private Label nameLabel;
private Label costLabel;
private bool needToBuy;
private int cost;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
nameLabel = GetNode<Label>("VBoxContainer/WeaponName");
costLabel = GetNode<Label>("VBoxContainer/MarginContainer/BuyPanel/VBoxContainer/HBoxContainer/MoneyCount");
startButton = GetNode<Panel>("VBoxContainer/StartButtonContainer/StartButton");
}
public void SetInfo(WeaponInfo info)
{
GD.Print("SHOP: Set current weapon to " + info.name);
nameLabel.Text = info.name;
costLabel.Text = info.cost.ToString();
GetNode<Panel>("VBoxContainer/MarginContainer/BuyPanel").Visible = !info.inPossesion;
startButton.Visible = info.inPossesion;
}
// // Called every frame. 'delta' is the elapsed time since the previous frame.
// public override void _Process(float delta)
// {
//
// }
}