Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions objects/o_ui_menu_lw/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if instance_exists(get_leader())

yy = 0
state = 0
selection = 0
selection = global.menu_page
dialogue_overlay = false

ip_selection = 0
Expand Down Expand Up @@ -54,4 +54,5 @@ phone_cant_cutscene = function() {
])
cutscene_func(instance_destroy, o_ui_menu_lw)
cutscene_play()
}
}
audio_play(snd_ui_move)
16 changes: 10 additions & 6 deletions objects/o_ui_menu_lw/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,15 @@ if state == 3 { // stats
if state == 4 { // cell
ui_dialoguebox_create(188, 52, 346, 270)

for (var i = 0; i < array_length(phone_numbers); i ++) {
var __number = phone_numbers[i]
if array_equals(phone_numbers, [])
draw_sprite_ext(spr_ui_soul, 0, 232-24, 88, 2, 2, 0, c_red, 1)
else {
for (var i = 0; i < array_length(phone_numbers); i ++) {
var __number = phone_numbers[i]

if c_selection == i
draw_sprite_ext(spr_ui_soul, 0, 232-24, 88+i*32, 2, 2, 0, c_red, 1)
draw_text_transformed(232, 80 + i*32, __number.name, 2, 2, 0)
}
if c_selection == i
draw_sprite_ext(spr_ui_soul, 0, 232-24, 88+i*32, 2, 2, 0, c_red, 1)
draw_text_transformed(232, 80 + i*32, __number.name, 2, 2, 0)
}
}
}
98 changes: 61 additions & 37 deletions objects/o_ui_menu_lw/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ if dialogue_overlay {

if state == 0 {
if InputPressed(INPUT_VERB.DOWN) {
selection ++
audio_play(snd_ui_move)
if selection < array_length(options)-1 {
selection ++
audio_play(snd_ui_move)
}
}
else if InputPressed(INPUT_VERB.UP) {
selection --
audio_play(snd_ui_move)
if selection > 0 {
selection --
audio_play(snd_ui_move)
}
}
if selection > array_length(options)-1
selection = 0
if selection < 0
selection = array_length(options)-1

if InputPressed(INPUT_VERB.CANCEL) || InputPressed(INPUT_VERB.SPECIAL) {
global.menu_page = selection
instance_destroy()
}

if InputPressed(INPUT_VERB.SELECT) {
if selection == 0 {
if item_get_count(ITEM_TYPE.LIGHT) == 0 {
audio_play(snd_ui_cant_select)
exit
}

Expand All @@ -49,17 +49,20 @@ if state == 0 {
if state == 1 {
if InputPressed(INPUT_VERB.DOWN){
i_selection ++
audio_play(snd_ui_move)

if i_selection > item_get_count(ITEM_TYPE.LIGHT)-1
i_selection = item_get_count(ITEM_TYPE.LIGHT)-1
else
audio_play(snd_ui_move)
}
else if InputPressed(INPUT_VERB.UP){
i_selection --
audio_play(snd_ui_move)

if i_selection < 0
i_selection = 0
else
audio_play(snd_ui_move)
}

if i_selection > item_get_count(ITEM_TYPE.LIGHT)-1
i_selection = item_get_count(ITEM_TYPE.LIGHT)-1
if i_selection < 0
i_selection = 0

if InputPressed(INPUT_VERB.SELECT){
state = 2
Expand All @@ -69,25 +72,32 @@ if state == 1 {
}

if InputPressed(INPUT_VERB.CANCEL){
if i_selection != selection {
audio_play(snd_ui_move)
}
i_selection = 0
state = 0
exit
}
}
if state == 2 {
if InputPressed(INPUT_VERB.RIGHT) {
ip_selection ++
audio_play(snd_ui_move)

if ip_selection > 2
ip_selection = 2
else
audio_play(snd_ui_move)
}
else if InputPressed(INPUT_VERB.LEFT) {
ip_selection --
audio_play(snd_ui_move)

if ip_selection < 0
ip_selection = 0
else
audio_play(snd_ui_move)
}

if ip_selection > 2
ip_selection = 2
if ip_selection < 0
ip_selection = 0

if InputPressed(INPUT_VERB.SELECT) {
var _item = item_get_array(ITEM_TYPE.LIGHT)[i_selection]

Expand All @@ -108,34 +118,48 @@ if state == 2 {
}

if InputPressed(INPUT_VERB.CANCEL) {
if ip_selection != i_selection {
audio_play(snd_ui_move)
}
state = 1
exit
}
}
if state == 3 {
if InputPressed(INPUT_VERB.CANCEL){
audio_play(snd_ui_move)
state = 0
exit
}
}
if state == 4 {
if InputPressed(INPUT_VERB.DOWN){
c_selection ++
audio_play(snd_ui_move)
}
else if InputPressed(INPUT_VERB.UP){
c_selection --
audio_play(snd_ui_move)
}
c_selection = clamp(c_selection, 0, array_length(phone_numbers) - 1)
if !array_equals(phone_numbers, []) {
if InputPressed(INPUT_VERB.DOWN){
c_selection ++

if c_selection < array_length(phone_numbers) - 1
audio_play(snd_ui_move)
}
else if InputPressed(INPUT_VERB.UP){
c_selection --

if c_selection > 0
audio_play(snd_ui_move)
}

c_selection = clamp(c_selection, 0, array_length(phone_numbers) - 1)

if InputPressed(INPUT_VERB.SELECT) {
phone_numbers[c_selection].cutscene()
dialogue_overlay = true
if InputPressed(INPUT_VERB.SELECT) {
phone_numbers[c_selection].cutscene()
dialogue_overlay = true

exit
}
exit
}
}
if InputPressed(INPUT_VERB.CANCEL){
if c_selection != selection {
audio_play(snd_ui_move)
}
state = 0
exit
}
Expand Down