-
Notifications
You must be signed in to change notification settings - Fork 3
/
IDE.gd
168 lines (152 loc) · 4.8 KB
/
IDE.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
extends Sprite
signal generated
var color = "Blue"
var style = "Cool"
var object = "Room"
var currentRoom = "Blue"
var colorMatchesGood = {
"Red":[ "Red", "Orange", "Green", "Blue", "Violet", "Pink", "Black"],
"Orange":["Orange", "Yellow", "Violet", "Blue"],
"Yellow":["Red", "Orange", "Green", "Blue", "Pink"],
"Green":[ "Green", "Blue", "Violet", "Pink"],
"Blue":[ "Red", "Orange", "Yellow", "Green", "Blue", "Pink"],
"Violet":[ "Red", "Orange", "Yellow", "Green", "Violet", "Black", "Pink"],
"Pink":["Red", "Orange", "Green", "Blue", "Violet","Black", "Pink"],
"Black":["Blue", "Violet", "Pink","White"],
"White":["Green", "Blue","Violet","Black"]
}
func reset():
$select.text = UniversalFunctions.dialogueJson["select"]
$ScreenOccluder.position = Vector2(67,64)
$ColorRect.rect_size = Vector2(0,2)
$Screen.play("default")
$ScreenOverlay.play("default")
object = null
style = null
color = "Blue"
$loading.visible = false
func _on_Color_pressed(colorName, palette):
if UniversalFunctions.generating == true:
return
if UniversalFunctions.locked == true:
return
var paletteLoad = load(palette)
color = colorName
if object != null:
if style != null:
$select.text = UniversalFunctions.dialogueJson[color]+"+"+UniversalFunctions.dialogueJson[style]+"+"+UniversalFunctions.dialogueJson[object]
else:
$select.text = UniversalFunctions.dialogueJson[color]+"+???+"+UniversalFunctions.dialogueJson[object]
elif style != null:
if object != null:
$select.text = UniversalFunctions.dialogueJson[color]+"+"+UniversalFunctions.dialogueJson[style]+"+"+UniversalFunctions.dialogueJson[object]
else:
$select.text = UniversalFunctions.dialogueJson[color]+"+"+UniversalFunctions.dialogueJson[style]+"+???"
$Screen.get_material().set_shader_param("palette_out", paletteLoad)
$ScreenOverlay.get_material().set_shader_param("palette_out", paletteLoad)
change_model($Screen.frame)
func _on_Style_pressed(nodeName):
if UniversalFunctions.generating == true:
return
if UniversalFunctions.locked == true:
return
style = nodeName
if object != null:
$select.text = UniversalFunctions.dialogueJson[color]+"+"+UniversalFunctions.dialogueJson[style]+"+"+UniversalFunctions.dialogueJson[object]
else:
$select.text = UniversalFunctions.dialogueJson[color]+"+"+UniversalFunctions.dialogueJson[style]+"+???"
change_model($Screen.frame)
func _on_Object_pressed(nodeName):
if UniversalFunctions.generating == true:
return
if UniversalFunctions.locked == true:
return
object = nodeName
if style != null:
$select.text = UniversalFunctions.dialogueJson[color]+"+"+UniversalFunctions.dialogueJson[style]+"+"+UniversalFunctions.dialogueJson[object]
else:
$select.text = UniversalFunctions.dialogueJson[color]+"+???+"+UniversalFunctions.dialogueJson[object]
change_model($Screen.frame)
func change_model(screenFrame):
if style != null and object != null:
$Screen.play(str(style+object))
$ScreenOverlay.play(str(style+object))
$Screen.frame = screenFrame
$ScreenOverlay.frame = screenFrame
func _on_Generate_pressed():
if UniversalFunctions.generating == true:
return
if UniversalFunctions.locked == true:
return
if style == null:
return
if object == null:
return
var value = 5
if object == "Room":
currentRoom = color
if style == "Cool":
value+=0
if color == "Orange":
value = 25
elif color == "Violet" or color == "Red":
value +=10
elif color == "Green" or color == "Blue":
value +=5
elif color == "Yellow" or color == "Pink" or color == "White" or color == "Black":
value +=0
elif style == "Cozy":
value+=3
if color == "Blue":
value = 25
elif color == "Red" or color == "Orange" or color == "Blue" or color == "Violet" or color == "Pink":
value +=10
elif color == "Yellow" or color == "White":
value +=5
elif color == "Black":
value +=0
elif style == "Cute":
value+=6
if color == "Blue":
value = 25
elif color == "Red" or color == "Violet" or color == "Pink" or color == "White":
value +=10
elif color == "Yellow" or color == "Orange" or color == "Black":
value +=5
elif color == "Green":
value +=0
else:
if object == "Chair":
if style == "Cool":
value +=10
elif style == "Cute":
value +=0
elif style == "Cozy":
value +=5
elif object == "Bed":
if style == "Cool":
value +=0
elif style == "Cute":
value +=5
elif style == "Cozy":
value +=10
elif object == "Decor":
value +=10
for i in colorMatchesGood[currentRoom]:
if i == color:
value += 10
var data = {
"color": color,
"style": style,
"object": object,
"value": value
}
emit_signal("generated", data)
func _on_Screen_animation_finished():
if style == null:
return
if object != null:
return
$ScreenOverlay.frame = $Screen.frame
func _on_Screen_frame_changed():
$ScreenOverlay.frame = $Screen.frame