-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tools.gd
99 lines (83 loc) · 2.69 KB
/
Tools.gd
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
extends Node2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if GlobalVar.jumBenih > 0:
get_node('Bibit/bibit').play('av')
elif GlobalVar.jumBenih == 0:
get_node('Bibit/bibit').play('unv')
if GlobalVar.benih:
Input.set_custom_mouse_cursor(null)
GlobalVar.benih = false
if GlobalVar.jumPupuk > 0:
get_node('pupuk/Pupuk').play('av')
elif GlobalVar.jumPupuk == 0:
get_node('pupuk/Pupuk').play('unv')
if GlobalVar.pupuk:
Input.set_custom_mouse_cursor(null)
GlobalVar.pupuk = false
if GlobalVar.jumPestisida > 0:
get_node('pestisida/Pestisida').play('av')
elif GlobalVar.jumPestisida == 0:
get_node('pestisida/Pestisida').play('unv')
if GlobalVar.pestisida:
Input.set_custom_mouse_cursor(null)
GlobalVar.pestisida = false
pass
func _on_Bibit_pressed():
if GlobalVar.jumBenih > 0:
Input.set_custom_mouse_cursor(load('res://Assets/benih cursor.png'))
GlobalVar.benih = true
GlobalVar.sabit = false
GlobalVar.siraman = false
GlobalVar.pestisida = false
GlobalVar.pupuk = false
pass # Replace with function body.
func _on_Siraman_pressed():
Input.set_custom_mouse_cursor(load('res://Assets/siraman cursor.png'))
GlobalVar.siraman = true
GlobalVar.benih = false
GlobalVar.sabit = false
GlobalVar.pestisida = false
GlobalVar.pupuk = false
pass # Replace with function body.
func _input(event):
if event is InputEventMouseButton:
if event.get_button_index()== BUTTON_RIGHT and event.is_pressed():
Input.set_custom_mouse_cursor(null)
GlobalVar.benih = false
GlobalVar.siraman = false
GlobalVar.sabit = false
GlobalVar.pestisida = false
GlobalVar.pupuk = false
func _on_Sabit_pressed():
Input.set_custom_mouse_cursor(load('res://Assets/sabit cursor.png'))
GlobalVar.sabit = true
GlobalVar.siraman = false
GlobalVar.benih = false
GlobalVar.pestisida = false
GlobalVar.pupuk = false
pass # Replace with function body.
func _on_pupuk_pressed():
if GlobalVar.jumPupuk > 0:
Input.set_custom_mouse_cursor(load('res://Assets/pupuk cursor.png'))
GlobalVar.pupuk = true
GlobalVar.pestisida = false
GlobalVar.sabit = false
GlobalVar.siraman = false
GlobalVar.benih = false
pass # Replace with function body.
func _on_pestisida_pressed():
if GlobalVar.jumPestisida > 0:
Input.set_custom_mouse_cursor(load('res://Assets/pestisida cursor.png'))
GlobalVar.pestisida = true
GlobalVar.pupuk = false
GlobalVar.sabit = false
GlobalVar.siraman = false
GlobalVar.benih = false
pass # Replace with function body.