1 |
var main_shop_screen_number = global.main_shop_screen_number |
2 |
script_execute(gml_Script_scr_controls_shop_main) |
3 |
if key_select |
4 |
{ |
5 |
audio_play_sound(snd_confirm, 1, 0) |
6 |
if (main_shop_screen_number == 1) |
7 |
{ |
8 |
global.buy_shop_screen_number = 1 |
9 |
global.player_response = 0 |
10 |
global.able_to_buy = 0 |
11 |
instance_create(0, 0, obj_dialogue_buy_talk_shop) |
12 |
instance_create(0, 0, obj_text_item_buy_shop) |
13 |
instance_create((obj_main_screen_shop.x + 19), (obj_main_screen_shop.y + 19), obj_heart_buy_screen_shop) |
14 |
event_user(0) |
15 |
return; |
16 |
} |
17 |
else if (main_shop_screen_number == 2) |
18 |
{ |
19 |
switch global.shop_name |
20 |
{ |
21 |
case "Wild East Gunshop": |
22 |
instance_create(0, 0, obj_text_item_sell_shop) |
23 |
instance_create(obj_main_screen_shop.x, obj_main_screen_shop.y, obj_talk_screen_shop) |
24 |
instance_create((obj_main_screen_shop.x + 19), (obj_main_screen_shop.y + 19), obj_heart_sell_screen_shop) |
25 |
instance_destroy(obj_main_screen_shop) |
26 |
break |
27 |
default: |
28 |
instance_create(0, 120, obj_talk_screen_shop) |
29 |
instance_create(0, 0, obj_dialogue_sell_shop) |
30 |
instance_destroy(obj_main_screen_shop) |
31 |
break |
32 |
} |
33 |
|
34 |
with (obj_item_description_screen_shop) |
35 |
instance_destroy() |
36 |
event_user(0) |
37 |
return; |
38 |
} |
39 |
else if (main_shop_screen_number == 3) |
40 |
{ |
41 |
global.buy_shop_screen_number = 1 |
42 |
global.player_response = 0 |
43 |
global.able_to_buy = 0 |
44 |
instance_create(0, 0, obj_dialogue_buy_talk_shop) |
45 |
instance_create(0, 0, obj_text_item_talk_shop) |
46 |
instance_create((obj_main_screen_shop.x + 19), (obj_main_screen_shop.y + 19), obj_heart_buy_screen_shop) |
47 |
if (global.dunes_flag[20] >= 9 && global.dunes_flag[24] == 0) |
48 |
{ |
49 |
if (global.shop_name == "Wild East Saloon" || global.shop_name == "Wild East Gunshop") |
50 |
{ |
51 |
instance_create(0, 120, obj_talk_screen_shop) |
52 |
instance_create(0, 0, obj_dialogue_talk_shop) |
53 |
with (obj_heart_buy_screen_shop) |
54 |
{ |
55 |
event_user(1) |
56 |
event_user(0) |
57 |
} |
58 |
} |
59 |
} |
60 |
if (global.route == 1 && global.sworks_flag[0] > 0) |
61 |
{ |
62 |
if (global.shop_name == "Wild East Saloon") |
63 |
{ |
64 |
instance_create(0, 120, obj_talk_screen_shop) |
65 |
instance_create(0, 0, obj_dialogue_talk_shop) |
66 |
with (obj_heart_buy_screen_shop) |
67 |
{ |
68 |
event_user(1) |
69 |
event_user(0) |
70 |
} |
71 |
} |
72 |
} |
73 |
if (global.party_member != -4) |
74 |
{ |
75 |
if (global.shop_name == "Hotel Shop") |
76 |
{ |
77 |
instance_create(0, 120, obj_talk_screen_shop) |
78 |
instance_create(0, 0, obj_dialogue_talk_shop) |
79 |
with (obj_heart_buy_screen_shop) |
80 |
{ |
81 |
event_user(1) |
82 |
event_user(0) |
83 |
} |
84 |
} |
85 |
} |
86 |
event_user(0) |
87 |
return; |
88 |
} |
89 |
else if (main_shop_screen_number == 4) |
90 |
{ |
91 |
instance_create(0, 120, obj_talk_screen_shop) |
92 |
instance_create(0, 0, obj_dialogue_exit_shop) |
93 |
with (obj_main_screen_shop) |
94 |
instance_destroy() |
95 |
with (obj_item_description_screen_shop) |
96 |
instance_destroy() |
97 |
event_user(0) |
98 |
return; |
99 |
} |
100 |
} |
101 |
if (key_select == 0) |
102 |
{ |
103 |
if (key_down && key_up == 0) |
104 |
{ |
105 |
if (main_shop_screen_number == 4) |
106 |
{ |
107 |
global.main_shop_screen_number = 1 |
108 |
main_shop_screen_number = global.main_shop_screen_number |
109 |
} |
110 |
else |
111 |
global.main_shop_screen_number += 1 |
112 |
audio_play_sound(snd_mainmenu_select, 1, 0) |
113 |
} |
114 |
if (key_up && key_down == 0) |
115 |
{ |
116 |
if (main_shop_screen_number == 1) |
117 |
{ |
118 |
global.main_shop_screen_number = 4 |
119 |
main_shop_screen_number = global.main_shop_screen_number |
120 |
} |
121 |
else |
122 |
global.main_shop_screen_number -= 1 |
123 |
audio_play_sound(snd_mainmenu_select, 1, 0) |
124 |
} |
125 |
} |
126 |
main_shop_screen_number = global.main_shop_screen_number |
127 |
if (main_shop_screen_number == 1) |
128 |
{ |
129 |
x = obj_main_screen_shop.x + 229 |
130 |
y = obj_main_screen_shop.y + 19 |
131 |
} |
132 |
else if (main_shop_screen_number == 2) |
133 |
{ |
134 |
x = obj_main_screen_shop.x + 229 |
135 |
y = obj_main_screen_shop.y + 39 |
136 |
} |
137 |
else if (main_shop_screen_number == 3) |
138 |
{ |
139 |
x = obj_main_screen_shop.x + 229 |
140 |
y = obj_main_screen_shop.y + 59 |
141 |
} |
142 |
else if (main_shop_screen_number == 4) |
143 |
{ |
144 |
x = obj_main_screen_shop.x + 229 |
145 |
y = obj_main_screen_shop.y + 79 |
146 |
} |