diff --git a/resources/config2/interactive_objects_uni_interior.json b/resources/config2/interactive_objects_uni_interior.json index 45d0332..2f1b015 100644 --- a/resources/config2/interactive_objects_uni_interior.json +++ b/resources/config2/interactive_objects_uni_interior.json @@ -151,7 +151,7 @@ "positionX": 1.5, "positionY": 0.975, "positionZ": 6.965, - "approachRadius": 0.7, + "approachRadius": 0.8, "boundsMaxX": 0.067857146263122559, "boundsMaxY": 1.0, "boundsMaxZ": 0.49353456497192383, diff --git a/resources/config2/interactive_objects_uni_interior_x.json b/resources/config2/interactive_objects_uni_interior_x.json index 2a29076..0bcb099 100644 --- a/resources/config2/interactive_objects_uni_interior_x.json +++ b/resources/config2/interactive_objects_uni_interior_x.json @@ -151,7 +151,7 @@ "positionX": 1.5, "positionY": 0.975, "positionZ": 6.965, - "approachRadius": 0.7, + "approachRadius": 0.8, "boundsMaxX": 0.06785714626312256, "boundsMaxY": 1.0, "boundsMaxZ": 0.49353456497192383, diff --git a/resources/config2/npcs_uni_interior.json b/resources/config2/npcs_uni_interior.json index fe2e011..b0a6e14 100644 --- a/resources/config2/npcs_uni_interior.json +++ b/resources/config2/npcs_uni_interior.json @@ -28,9 +28,9 @@ "meshTextures": { "Girl_Low": "resources/w/girlfriend/Girl_Base_color.png" }, - "positionX": 1.0, + "positionX": 0.799619, "positionY": 0.0, - "positionZ": -7.525, + "positionZ": -9.55679, "facingAngle" : 180, "walkSpeed": 1.66, "rotationSpeed": 8.0, diff --git a/resources/config2/teleports_dorm.json b/resources/config2/teleports_dorm.json index 67647c8..702e6a1 100644 --- a/resources/config2/teleports_dorm.json +++ b/resources/config2/teleports_dorm.json @@ -7,6 +7,8 @@ "positionZ": 0.0, "radius": 1.5, "active": false, + "automatic": true, + "automaticRadius": 1.4, "destinationLocation": "uni_exterior", "destinationPositionX": -14.8449, "destinationPositionY": 0.0, diff --git a/resources/config2/trigger_zones_uni_interior.json b/resources/config2/trigger_zones_uni_interior.json index 70df7f6..e2f928b 100644 --- a/resources/config2/trigger_zones_uni_interior.json +++ b/resources/config2/trigger_zones_uni_interior.json @@ -33,7 +33,7 @@ "positionY": 0.0, "positionZ": 6.17516, "radius": 2.5, - "hysteresis": 0.2, + "hysteresis": 0.3, "enabled": true } ] diff --git a/resources/dialogue/cutscenes004.json b/resources/dialogue/cutscenes004.json index 99f1622..a62ca23 100644 --- a/resources/dialogue/cutscenes004.json +++ b/resources/dialogue/cutscenes004.json @@ -659,10 +659,10 @@ { "id": "game_complete_cutscene001", "skippable": true, - "durationMs": 5000, + "durationMs": 12000, "fadeOutMs": 0, "fadeInMs": 500, - "endFadeOutMs": 500, + "endFadeOutMs": 0, "endFadeInMs": 500, "onFadeInCallback": "", "imageSegments": [ @@ -671,7 +671,7 @@ "width": 1280, "height": 720, "startMs": 0, - "endMs": 12500, + "endMs": 13500, "fadeInMs": 0, "fadeOutMs": 0, "easing": "Linear", diff --git a/resources/dialogue/uni_exterior_dialogues.json b/resources/dialogue/uni_exterior_dialogues.json index 23747a4..9de8492 100644 --- a/resources/dialogue/uni_exterior_dialogues.json +++ b/resources/dialogue/uni_exterior_dialogues.json @@ -35,6 +35,24 @@ "type": "End" } ] + }, + { + "id": "dialog_contaier003", + "start": "line_1", + "nodes": [ + { + "id": "line_1", + "type": "Line", + "speaker": "Бекзат", + "portrait": "resources/dialogue/portrait_hero_neutral.png", + "text": "Я уже забрал курсовую работу Бегимай, больше мне незачем сюда лезть.", + "next": "end_1" + }, + { + "id": "end_1", + "type": "End" + } + ] }, { "id": "dialog_contaier002", @@ -62,6 +80,7 @@ "speaker": "Бекзат", "portrait": "resources/dialogue/portrait_hero_neutral.png", "text": "Ага, нашел! Вот и она!", + "luaCallback": "dialog_contaier002_get_coursework", "next": "end_1" }, { diff --git a/resources/dialogue/uni_interior_dialogues_004.json b/resources/dialogue/uni_interior_dialogues_004.json index 7afa36d..6fbb359 100644 --- a/resources/dialogue/uni_interior_dialogues_004.json +++ b/resources/dialogue/uni_interior_dialogues_004.json @@ -1,5 +1,57 @@ { "dialogues": [ + { + "id": "darklands_day_dialog001", + "start": "line_1", + "nodes": [ + { + "id": "line_1", + "type": "Line", + "speaker": "Бекзат", + "portrait": "resources/dialogue/portrait_hero_neutral.png", + "text": "Это заклинание не работает днем.", + "next": "line_2" + }, + { + "id": "line_2", + "type": "Line", + "speaker": "Бекзат", + "portrait": "resources/dialogue/portrait_hero_neutral.png", + "text": "Чтобы перейти в теневой мир, мне нужно дождаться ночи.", + "next": "line_3" + }, + { + "id": "line_3", + "type": "Line", + "speaker": "Бекзат", + "portrait": "resources/dialogue/portrait_hero_neutral.png", + "text": "Чтобы время пролетело быстро, я могу посидеть в телефоне и позалипать в короткие видео.", + "next": "end_1" + }, + { + "id": "end_1", + "type": "End" + } + ] + }, + { + "id": "darklands_morning_dialog001", + "start": "line_1", + "nodes": [ + { + "id": "line_1", + "type": "Line", + "speaker": "Бекзат", + "portrait": "resources/dialogue/portrait_hero_neutral.png", + "text": "У меня силы закончились и мне спать хочется. Достаточно теневого мира на сегодня, поехали в общагу.", + "next": "end_1" + }, + { + "id": "end_1", + "type": "End" + } + ] + }, { "id": "knife_dialog001", "start": "line_1", @@ -310,7 +362,7 @@ "type": "Line", "speaker": "Бекзат", "portrait": "resources/dialogue/portrait_hero_neutral.png", - "text": "Хорошо что эти двери открываются изнутри.", + "text": "Хорошо, что у меня уже есть ключ от этой двери.", "next": "end_1" }, { @@ -1079,6 +1131,24 @@ } ] }, + { + "id": "computer_dialog004", + "start": "line_1", + "nodes": [ + { + "id": "line_1", + "type": "Line", + "speaker": "Бекзат", + "portrait": "resources/dialogue/portrait_hero_neutral.png", + "text": "Похоже, компьютеры в теневом режиме не функционируют никак.", + "next": "end_1" + }, + { + "id": "end_1", + "type": "End" + } + ] + }, { "id": "dialog_report_card001", "start": "line_1", diff --git a/resources/start_uni_exterior.lua b/resources/start_uni_exterior.lua index 26c3460..89d4d3a 100644 --- a/resources/start_uni_exterior.lua +++ b/resources/start_uni_exterior.lua @@ -22,29 +22,38 @@ end function on_container_clicked() local player_container_aware = game_api.getIntValue("player_container_aware") -if player_container_aware == 1 then +local player_has_coursework = game_api.getIntValue("player_has_coursework") +if (player_has_coursework == 1) then +game_api.start_dialogue("dialog_contaier003") +elseif player_container_aware == 1 then game_api.start_dialogue("dialog_contaier002") -game_api.pickup_item("coursework") -game_api.setIntValue("player_has_coursework", 1) -game_api.quest_set_objective_completed("ghost_coursework", "ghost_coursework_find") else game_api.start_dialogue("dialog_contaier001") end end +function dialog_contaier002_get_coursework() +game_api.pickup_item("coursework") +game_api.quest_set_objective_completed("ghost_coursework", "ghost_coursework_find") +game_api.quest_set_objective_completed("ghost_coursework", "ghost_coursework_find") +end + game_api.set_enter_night_callback( function() game_api.start_dialogue("dialog_video001") end ) +function on_darklands_over() + game_api.set_player_hp(10) +end + game_api.set_darklands_callbacks( nil, function() game_api.start_cutscene("darklands_exit001") + print("Setting to day 1----") game_api.setIntValue("day", 1) - game_api.setIntValue("need_sleep", 1) - game_api.set_player_hp(10) game_api.set_dawn() end ) diff --git a/resources/start_uni_interior.lua b/resources/start_uni_interior.lua index 2d8c305..b5ede81 100644 --- a/resources/start_uni_interior.lua +++ b/resources/start_uni_interior.lua @@ -10,7 +10,9 @@ teacher_told_about_book = false night_time = false -player_left_darklands = false +--player_left_darklands = false + +was_darklands = false morning_can_open_door_index = 0 morning_did_open_door_index = 0 @@ -153,18 +155,6 @@ function on_npc_interact(npc_index) end else game_api.start_dialogue("dialog_aiperi_morning001") - --[[ - if (player_ghost_aware) then - local player_alik_aware = game_api.getIntValue("player_alik_aware") - if player_alik_aware == 1 then - game_api.start_dialogue("aiperi_dialog002") - else - game_api.start_dialogue("aiperi_dialog001") - game_api.setIntValue("player_alik_aware", 1) - end - else - game_api.start_dialogue("aiperi_dialog003") - end]] end end if npc_index == 0 then @@ -292,82 +282,98 @@ function on_teachers_door_click() game_api.start_dialogue("door_teacher_dialog001") end else - print("morning_can_open_door_index is") - print(morning_can_open_door_index) + + if (game_api.is_dawn()) then + print("morning_can_open_door_index is") + print(morning_can_open_door_index) + + if (teacher_door_opened == false) then + teacher_door_opened = true + if (morning_can_open_door_index == 3) then + morning_did_open_door_index = 3 + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_Corridor_001") + end) + game_api.switch_navigation(10) + else + if (morning_did_open_door_index == 1) then + --s1 + s3 + + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(16) + + elseif (morning_did_open_door_index == 2) then + --s2 + s3 + + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(15) + elseif (morning_did_open_door_index == 5) then + --n3 + s3 + + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(13) + elseif (morning_did_open_door_index == 4) then + --n2 + s3 + + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(14) + elseif (morning_did_open_door_index == 6) then + --hall + s3 + + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(12) + else + --Player was in corridor, but tries to open the teacher's door + --s3 only + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(10) + end + end + end - --game_api.start_dialogue("door_unlock_dialog001") - - - if (morning_can_open_door_index == 3) then - morning_did_open_door_index = 3 - game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) - game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() - game_api.deactivate_interactive_object("Room_Cover_Corridor_001") - end) - game_api.switch_navigation(10) - else - if (morning_did_open_door_index == 1) then - --s1 + s3 + elseif (game_api.is_night()) then + if (teacher_door_opened == false) then + teacher_door_opened = true - game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) - game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() - game_api.deactivate_interactive_object("Room_Cover_South_3_001") - end) - game_api.switch_navigation(16) + if (morning_can_open_door_index == 3) then + morning_did_open_door_index = 3 + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_Corridor_001") + end) + else + game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + end - elseif (morning_did_open_door_index == 2) then - --s2 + s3 + game_api.switch_navigation(10) - game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) - game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() - game_api.deactivate_interactive_object("Room_Cover_South_3_001") - end) - game_api.switch_navigation(15) - elseif (morning_did_open_door_index == 5) then - --n3 + s3 - game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) - game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() - game_api.deactivate_interactive_object("Room_Cover_South_3_001") - end) - game_api.switch_navigation(13) - elseif (morning_did_open_door_index == 4) then - --n2 + s3 - game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) - game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() - game_api.deactivate_interactive_object("Room_Cover_South_3_001") - end) - game_api.switch_navigation(14) - elseif (morning_did_open_door_index == 6) then - --hall + s3 - game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) - game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() - game_api.deactivate_interactive_object("Room_Cover_South_3_001") - end) - game_api.switch_navigation(12) end end - - - --[[ - if (morning_can_open_door_index == 3) then - print("morning_did_open_door_index is") - print(morning_did_open_door_index) - if (morning_did_open_door_index == 0) then - morning_did_open_door_index = 3 - game_api.start_dialogue("door_unlock_dialog001") - - game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil) - game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() - game_api.deactivate_interactive_object("Room_Cover_Corridor_001") - end) - game_api.switch_navigation(10) - end - else - game_api.start_dialogue("door_dialog001") - end]] end end @@ -458,8 +464,8 @@ end function on_n2_door_click() - print("player_left_darklands") - print(player_left_darklands) + --print("player_left_darklands") + --print(player_left_darklands) print("morning_can_open_door_index") print(morning_can_open_door_index) print("morning_did_open_door_index") @@ -507,9 +513,9 @@ function book_dialog_zone001_enter_callback() print("book_dialog_zone001_enter_callback step 3") if (player_hold_book) and (night_time == false) then print("book_dialog_zone001_enter_callback step 4") - game_api.player_stop() game_api.start_dialogue("book_dialog001") game_api.switch_navigation(0) + game_api.player_stop() end end end @@ -530,25 +536,29 @@ function on_computer_clicked() print("on_computer_clicked--1") game_api.start_dialogue("computer_dialog003") else - if teacher_told_about_book then - print("on_computer_clicked--2") - if (night_time == false) then - print("on_computer_clicked--3") - if (player_hold_book) then - print("on_computer_clicked--4") - game_api.quest_set_objective_completed("study_project", "study_project_write") - game_api.start_cutscene("computer_cutscene001") + if game_api.is_darklands() then + game_api.start_dialogue("computer_dialog004") + else + if teacher_told_about_book then + print("on_computer_clicked--2") + if (night_time == false) then + print("on_computer_clicked--3") + if (player_hold_book) then + print("on_computer_clicked--4") + game_api.quest_set_objective_completed("study_project", "study_project_write") + game_api.start_cutscene("computer_cutscene001") + else + print("on_computer_clicked--5") + game_api.start_dialogue("book_dialog002") + end else - print("on_computer_clicked--5") - game_api.start_dialogue("book_dialog002") + print("on_computer_clicked--6") + game_api.start_dialogue("computer_dialog002") end else - print("on_computer_clicked--6") - game_api.start_dialogue("computer_dialog002") + print("on_computer_clicked--7") + game_api.start_dialogue("computer_dialog001") end - else - print("on_computer_clicked--7") - game_api.start_dialogue("computer_dialog001") end end end @@ -576,6 +586,8 @@ function on_sleep_cutscene() game_api.set_object_alpha("Room_Cover_North_1_001", 1) game_api.set_object_alpha("Room_Cover_Main_Hall_001", 1) game_api.activate_interactive_object("Note001") + + teacher_door_opened = false end function on_teacher_arrived_intermediate() @@ -675,8 +687,9 @@ game_api.set_darklands_callbacks( game_api.set_npc_enabled(4, false) game_api.set_npc_enabled(5, false) game_api.setIntValue("day", 1) - game_api.setIntValue("need_sleep", 1) - player_left_darklands = true + print("Setting to day 1----x") + --game_api.setIntValue("need_sleep", 1) + --player_left_darklands = true morning_did_open_door_index = 0 setDay1MorningSetup() game_api.set_dawn() @@ -694,9 +707,14 @@ game_api.set_darklands_callbacks( game_api.deactivate_interactive_object("Room_Cover_North_3_001") morning_can_open_door_index = 5 elseif (pz <= 8.0) and (pz > 0) and (px <= -1.5) then - game_api.activate_interactive_object("Room_Cover_Corridor_001") + if (teacher_door_opened) then + game_api.deactivate_interactive_object("Room_Cover_Corridor_001") + else + game_api.activate_interactive_object("Room_Cover_Corridor_001") + end game_api.deactivate_interactive_object("Room_Cover_South_3_001") morning_can_open_door_index = 3 + elseif (pz <= 0.0) and (pz > -8) and (px >= 1.5) then game_api.activate_interactive_object("Room_Cover_Corridor_001") game_api.deactivate_interactive_object("Room_Cover_North_2_001") @@ -711,7 +729,11 @@ game_api.set_darklands_callbacks( morning_can_open_door_index = 1 else --All set before + if (teacher_door_opened) then + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end morning_can_open_door_index = 0 + end @@ -761,6 +783,7 @@ function setDay0setup() end function setDay1setup() + print("Enter setDay1setup") game_api.set_object_alpha("Room_Cover_North_1_001", 1) game_api.set_object_alpha("Room_Cover_North_2_001", 1) game_api.set_object_alpha("Room_Cover_North_3_001", 1) @@ -802,7 +825,11 @@ function setDay1MorningSetup() game_api.activate_interactive_object("Room_Cover_South_1_001") game_api.activate_interactive_object("Room_Cover_South_2_001") - game_api.activate_interactive_object("Room_Cover_South_3_001") + --[[if (teacher_door_opened) then + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + else]] + game_api.activate_interactive_object("Room_Cover_South_3_001") + --end game_api.deactivate_interactive_object("Room_Cover_Corridor_001") game_api.activate_interactive_object("Room_Cover_Main_Hall_001") @@ -811,7 +838,11 @@ function setDay1MorningSetup() game_api.set_object_rotation("Room_N_2_Leaf001", 0) game_api.set_object_rotation("Room_S_0_Leaf001", 0) game_api.set_object_rotation("Room_S_1_Leaf001", 0) - game_api.set_object_rotation("Room_S_2_Leaf001", 0) + if (teacher_door_opened) then + game_api.set_object_rotation("Room_S_2_Leaf001", 90) + else + game_api.set_object_rotation("Room_S_2_Leaf001", 0) + end game_api.set_object_rotation("Hall_Leaf001", 0) game_api.set_object_alpha("Room_Cover_North_1_001", 1) @@ -822,6 +853,8 @@ function setDay1MorningSetup() game_api.set_object_alpha("Room_Cover_South_3_001", 1) game_api.set_object_alpha("Room_Cover_Corridor_001", 1) game_api.set_object_alpha("Room_Cover_Main_Hall_001", 1) + + -- TODO: Make check for teacher_door_opened false or true game_api.set_npc_enabled(0, false) game_api.set_npc_enabled(1, false) @@ -833,34 +866,61 @@ function setDay1MorningSetup() if morning_did_open_door_index == 1 then game_api.deactivate_interactive_object("Room_Cover_South_1_001") game_api.set_object_rotation("Room_S_0_Leaf001", 90) - game_api.switch_navigation(8) + if (teacher_door_opened) then + game_api.switch_navigation(16) + else + game_api.switch_navigation(8) + end elseif morning_did_open_door_index == 2 then game_api.deactivate_interactive_object("Room_Cover_South_2_001") game_api.set_object_rotation("Room_S_1_Leaf001", 90) - game_api.switch_navigation(9) + if (teacher_door_opened) then + game_api.switch_navigation(15) + else + game_api.switch_navigation(9) + end elseif morning_did_open_door_index == 3 then game_api.deactivate_interactive_object("Room_Cover_South_3_001") game_api.set_object_rotation("Room_S_2_Leaf001", 90) + game_api.switch_navigation(10) + elseif morning_did_open_door_index == 4 then game_api.deactivate_interactive_object("Room_Cover_North_2_001") game_api.set_object_rotation("Room_N_1_Leaf001", -90) - game_api.switch_navigation(11) + if (teacher_door_opened) then + game_api.switch_navigation(14) + else + game_api.switch_navigation(11) + end elseif morning_did_open_door_index == 5 then game_api.deactivate_interactive_object("Room_Cover_North_3_001") game_api.set_object_rotation("Room_N_2_Leaf001", -90) - game_api.switch_navigation(7) + if (teacher_door_opened) then + game_api.switch_navigation(13) + else + game_api.switch_navigation(7) + end elseif morning_did_open_door_index == 6 then game_api.deactivate_interactive_object("Room_Cover_Main_Hall_001") game_api.set_object_rotation("Hall_Leaf001", 90) - game_api.switch_navigation(6) + if (teacher_door_opened) then + game_api.switch_navigation(12) + else + game_api.switch_navigation(6) + end else + if (teacher_door_opened) then + game_api.switch_navigation(10) + else game_api.switch_navigation(17) + end end end function setDay1NightSetup() night_time = true + teacher_door_opened = false print("setDay1NightSetup") morning_did_open_door_index = 0 @@ -985,7 +1045,15 @@ function on_aiperi_opens_door() game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() game_api.deactivate_interactive_object("Room_Cover_Corridor_001") end) - game_api.switch_navigation(6) + + if (teacher_door_opened) then + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(12) + else + game_api.switch_navigation(6) + end --Aiperi incoming game_api.npc_set_position(1, 0, 0, 6.5) @@ -1003,7 +1071,15 @@ function on_aiperi_opens_door() game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() game_api.deactivate_interactive_object("Room_Cover_Corridor_001") end) - game_api.switch_navigation(7) + + if (teacher_door_opened) then + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(13) + else + game_api.switch_navigation(7) + end --Aiperi incoming game_api.npc_set_position(1, 0.0, 0, 6.43818) @@ -1022,7 +1098,14 @@ function on_aiperi_opens_door() game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() game_api.deactivate_interactive_object("Room_Cover_Corridor_001") end) - game_api.switch_navigation(11) + if (teacher_door_opened) then + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(14) + else + game_api.switch_navigation(11) + end --Aiperi incoming game_api.npc_set_position(1, 0, 0, -1.7911) @@ -1042,7 +1125,15 @@ function on_aiperi_opens_door() game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() game_api.deactivate_interactive_object("Room_Cover_Corridor_001") end) - game_api.switch_navigation(9) + + if (teacher_door_opened) then + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(15) + else + game_api.switch_navigation(9) + end --Aiperi incoming game_api.npc_set_position(1, 0, 0, -1.7911) game_api.set_npc_enabled(1, true) @@ -1062,7 +1153,14 @@ function on_aiperi_opens_door() game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function() game_api.deactivate_interactive_object("Room_Cover_Corridor_001") end) - game_api.switch_navigation(8) + if (teacher_door_opened) then + game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function() + game_api.deactivate_interactive_object("Room_Cover_South_3_001") + end) + game_api.switch_navigation(16) + else + game_api.switch_navigation(8) + end --Aiperi incoming game_api.npc_set_position(1, 0, 0, -9.77948) @@ -1081,10 +1179,31 @@ end game_api.set_location_callbacks( function() - print("Enter location uni interior") - player_left_darklands = false + print("Enter location uni interior-") + --player_left_darklands = false local hp = game_api.getFloatValue("player_hp") game_api.set_player_hp(hp) + local day = game_api.getIntValue("day") + + print("day is:") + print(day) + + if (day > 0) and (game_api.is_night()==false) then + print("entered day setup") + setDay1setup() + game_api.switch_navigation(3) + end + + print("entered exited-") + + if (was_darklands) and (game_api.is_darklands() == false) and game_api.is_dawn() then + --Player died in exterior and then in the morning returned back + print("setDay1MorningSetup entered-") + setDay1MorningSetup() + + end + + --[[ local need_sleep = game_api.getIntValue("need_sleep") local day = game_api.getIntValue("day") @@ -1095,13 +1214,15 @@ game_api.set_location_callbacks( game_api.switch_navigation(3) else --Do nothing, it should have been already set up - end + end]] end, function() print("Exit location uni interior") - player_left_darklands = false + --player_left_darklands = false local hp = game_api.get_player_hp() game_api.setFloatValue("player_hp", hp) + + was_darklands = game_api.is_darklands() end ) diff --git a/src/Game.cpp b/src/Game.cpp index 2953217..147d79d 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -247,6 +247,7 @@ namespace ZL "resources/navigation/uni_interior4_locked.json" //17 }; + /* uniInteriorParams.navigationJsonPaths = { "resources/navigation/uni_interior3_darklands_all_open.json", @@ -310,7 +311,16 @@ namespace ZL locations["uni_exterior"]->setup(uniExteriorParams, &menuManager.questJournal); locations["uni_exterior"]->scriptEngine.setGlobalStore(&globalInts); locations["uni_exterior"]->scriptEngine.setGlobalFloatStore(&globalFloats); - locations["uni_exterior"]->requestNightDayTransition = [this](bool isNight, bool isDawn) { this->menuManager.isNight = isNight; this->menuManager.isDawn = isDawn; }; + locations["uni_exterior"]->requestNightDayTransition = [this](bool isNight, bool isDawn) { + this->menuManager.isNight = isNight; + this->menuManager.isDawn = isDawn; + /*for (auto& locPair : locations) { + if (locPair.second) { + locPair.second->isNight = isNight; + locPair.second->isDawn = isDawn; + } + }*/ + }; locations["uni_exterior"]->requestDarklandsTransition = [this]() { return startDarklandsTransition(); }; locations["uni_exterior"]->requestClosePhone = [this]() { menuManager.closePhoneEntirely(); }; locations["uni_exterior"]->requestReturnToMainMenu = [this]() { menuManager.showMainMenu(); }; @@ -407,7 +417,12 @@ namespace ZL currentLocation->player->targetFacingAngle = destRotY; } currentLocation->cameraAzimuth = destRotY; + currentLocation->isDarklands = isDarklands; + currentLocation->isNight = menuManager.isNight; + currentLocation->isDawn = menuManager.isDawn; currentLocation->scriptEngine.callLocationEnterCallback(); + + menuManager.onLocationChanged(destName); }; @@ -863,6 +878,7 @@ namespace ZL currentLocation->dialogueSystem.startCutscene("lection_cutscene001"); //.startDialogue("test_cutscene_pan_dialogue"); break; + case SDLK_n: if (editorMode == EditorMode::None) editorMode = EditorMode::Navigation; @@ -1239,6 +1255,18 @@ namespace ZL bool Game::startDarklandsTransition() { + if (!menuManager.isNight) + { + currentLocation->dialogueSystem.startDialogue("darklands_day_dialog001"); + return false; + } + + if (menuManager.isDawn) + { + currentLocation->dialogueSystem.startDialogue("darklands_morning_dialog001"); + return false; + } + if (darklandsFlashActive) return false; darklandsFlashActive = true; darklandsFlashFadingIn = true; @@ -1271,6 +1299,7 @@ namespace ZL if (currentLocation) { //currentLocation->dialogueSystem.startDialogue("dialog_video001"); + currentLocation->isNight = menuManager.isNight; currentLocation->scriptEngine.callTriggerNightEnterCallback(); } } else { @@ -1280,6 +1309,7 @@ namespace ZL menuManager.setDarklandsMode(isDarklands); if (currentLocation) { + currentLocation->isDarklands = isDarklands; if (isDarklands) currentLocation->scriptEngine.callDarklandsEnterCallback(); else diff --git a/src/MenuManager.cpp b/src/MenuManager.cpp index dd36b23..b5c2226 100644 --- a/src/MenuManager.cpp +++ b/src/MenuManager.cpp @@ -572,6 +572,7 @@ namespace ZL { refreshChatUnreadIndicators(); } + void MenuManager::closePhoneEntirely() { activeChatIndex_ = -1; state = GameState::Gameplay; @@ -583,6 +584,9 @@ namespace ZL { { uiManager.setNodeVisible("hint7", true); uiManager.setNodeVisible("hint7arrow", true); + + uiManager.setNodeVisible("hint6a", false); + uiManager.setNodeVisible("hint6aarrow", false); } else { diff --git a/src/ScriptEngine.cpp b/src/ScriptEngine.cpp index d8989db..1b0266c 100644 --- a/src/ScriptEngine.cpp +++ b/src/ScriptEngine.cpp @@ -33,7 +33,7 @@ namespace ZL { ScriptEngine::ScriptEngine() = default; ScriptEngine::~ScriptEngine() = default; - void ScriptEngine::init(Location* game, Inventory* inventory, const std::string& scriptPath) { + void ScriptEngine::init(Location* loc, Inventory* inventory, const std::string& scriptPath) { impl = std::make_unique(); sol::state& lua = impl->lua; @@ -45,8 +45,8 @@ namespace ZL { // on_arrived is an optional Lua function called when the NPC reaches the target. // It can call npc_walk_to again (or anything else) to chain behaviour. api.set_function("npc_walk_to", - [game](int index, float x, float y, float z, sol::object on_arrived) { - auto& npcs = game->npcs; + [loc](int index, float x, float y, float z, sol::object on_arrived) { + auto& npcs = loc->npcs; if (index < 0 || index >= static_cast(npcs.size())) { std::cerr << "[script] npc_walk_to: index " << index << " out of range (0.." << npcs.size() - 1 << ")\n"; @@ -68,7 +68,7 @@ namespace ZL { }); api.set_function("player_walk_to", - [game](float x, float y, float z, sol::object on_arrived) { + [loc](float x, float y, float z, sol::object on_arrived) { std::function cb; if (on_arrived.is()) { @@ -81,8 +81,8 @@ namespace ZL { } }; } - game->player->homePosition = Eigen::Vector3f(x, 0.f, z); - game->player->setTarget(Eigen::Vector3f(x, y, z), std::move(cb)); + loc->player->homePosition = Eigen::Vector3f(x, 0.f, z); + loc->player->setTarget(Eigen::Vector3f(x, y, z), std::move(cb)); }); @@ -117,14 +117,14 @@ namespace ZL { }); // remove_item(item_id) - api.set_function("remove_item", [game, inventory](const std::string& id) { + api.set_function("remove_item", [loc, inventory](const std::string& id) { std::cout << "[script] remove_item: " << id << std::endl; inventory->removeItem(id); }); // deactivate_interactive_object(object_name) - api.set_function("deactivate_interactive_object", [game](const std::string& objectName) { - for (auto& intObj : game->interactiveObjects) { + api.set_function("deactivate_interactive_object", [loc](const std::string& objectName) { + for (auto& intObj : loc->interactiveObjects) { if (intObj.loadedObject.name == objectName) { intObj.isActive = false; std::cout << "[script] deactivate_interactive_object: " << objectName << std::endl; @@ -135,8 +135,8 @@ namespace ZL { }); // activate_interactive_object(object_name) - api.set_function("activate_interactive_object", [game](const std::string& objectName) { - for (auto& intObj : game->interactiveObjects) { + api.set_function("activate_interactive_object", [loc](const std::string& objectName) { + for (auto& intObj : loc->interactiveObjects) { if (intObj.loadedObject.name == objectName) { intObj.isActive = true; std::cout << "[script] activate_interactive_object: " << objectName << std::endl; @@ -146,8 +146,8 @@ namespace ZL { std::cerr << "[script] activate_interactive_object: not found: " << objectName << std::endl; }); - api.set_function("set_object_rotation", [game](const std::string& objectName, float value) { - for (auto& intObj : game->interactiveObjects) { + api.set_function("set_object_rotation", [loc](const std::string& objectName, float value) { + for (auto& intObj : loc->interactiveObjects) { if (intObj.loadedObject.name == objectName) { intObj.rotationY = value * static_cast(M_PI) / 180.f; std::cout << "[script] set_object_rotation: " << objectName << " " << value << std::endl; @@ -157,8 +157,8 @@ namespace ZL { std::cerr << "[script] set_object_rotation: not found: " << objectName << std::endl; }); - api.set_function("set_object_alpha", [game](const std::string& objectName, float value) { - for (auto& intObj : game->interactiveObjects) { + api.set_function("set_object_alpha", [loc](const std::string& objectName, float value) { + for (auto& intObj : loc->interactiveObjects) { if (intObj.loadedObject.name == objectName) { intObj.alpha = value; std::cout << "[script] set_object_alpha: " <requestDialogueStart(dialogueId)) { + [loc](const std::string& dialogueId) { + if (!loc->requestDialogueStart(dialogueId)) { std::cerr << "[script] start_dialogue failed for id: " << dialogueId << "\n"; } }); // start_cutscene(cutscene_id) api.set_function("start_cutscene", - [game](const std::string& cutsceneId) { - if (!game->requestCutsceneStart(cutsceneId)) + [loc](const std::string& cutsceneId) { + if (!loc->requestCutsceneStart(cutsceneId)) std::cerr << "[script] start_cutscene failed for id: " << cutsceneId << "\n"; }); @@ -201,26 +201,26 @@ namespace ZL { }); api.set_function("set_dialogue_flag", - [game](const std::string& flag, int value) { - game->setDialogueFlag(flag, value); + [loc](const std::string& flag, int value) { + loc->setDialogueFlag(flag, value); }); api.set_function("get_dialogue_flag", - [game](const std::string& flag) { - return game->getDialogueFlag(flag); + [loc](const std::string& flag) { + return loc->getDialogueFlag(flag); }); api.set_function("set_navigation_area_available", - [game](const std::string& areaName, bool available) { - if (!game->setNavigationAreaAvailable(areaName, available)) { + [loc](const std::string& areaName, bool available) { + if (!loc->setNavigationAreaAvailable(areaName, available)) { std::cerr << "[script] set_navigation_area_available: area not found: " << areaName << "\n"; } }); api.set_function("switch_navigation", - [game](int index) { - if (!game->switchNavigation(index)) { + [loc](int index) { + if (!loc->switchNavigation(index)) { std::cerr << "[script] switch_navigation: index " << index << " out of range\n"; } }); @@ -240,47 +240,47 @@ namespace ZL { // Triggers the white-flash transition to toggle darklands mode. // Does nothing if a transition is already in progress. api.set_function("start_darklands_transition", - [game]() { - if (game->requestDarklandsTransition) - game->requestDarklandsTransition(); + [loc]() { + if (loc->requestDarklandsTransition) + loc->requestDarklandsTransition(); }); api.set_function("set_day", - [game]() { - game->requestNightDayTransition(false, false); + [loc]() { + loc->requestNightDayTransition(false, false); }); api.set_function("set_night", - [game]() { - game->requestNightDayTransition(true, false); + [loc]() { + loc->requestNightDayTransition(true, false); std::cout << "Set night called" << std::endl; }); api.set_function("set_dawn", - [game]() { - game->requestNightDayTransition(true, true); + [loc]() { + loc->requestNightDayTransition(true, true); std::cout << "Set dawn called" << std::endl; }); api.set_function("is_night", - [game]() { - return game->isNight; + [loc]() { + return loc->isNight; }); api.set_function("is_dawn", - [game]() { - return game->isDawn; + [loc]() { + return loc->isDawn; }); // advance_darklands_hud() // Advances the uni_interior darklands HUD from step12 to step13. // Call when the player enters the ghost trigger zone in darklands. api.set_function("advance_darklands_hud", - [game]() { - if (game->requestAdvanceDarklandsHud) - game->requestAdvanceDarklandsHud(); + [loc]() { + if (loc->requestAdvanceDarklandsHud) + loc->requestAdvanceDarklandsHud(); }); // set_location_callbacks(on_enter, on_exit) @@ -296,7 +296,7 @@ namespace ZL { // is_darklands() → bool api.set_function("is_darklands", - [game]() { return game->isDarklands; }); + [loc]() { return loc->isDarklands; }); api.set_function("setFloatValue", [this_impl = impl.get()](const std::string& key, float value) { @@ -311,31 +311,31 @@ namespace ZL { }); api.set_function("get_player_x", - [game]() -> float { - return game->player ? game->player->position.x() : 0.0f; + [loc]() -> float { + return loc->player ? loc->player->position.x() : 0.0f; }); api.set_function("get_player_z", - [game]() -> float { - return game->player ? game->player->position.z() : 0.0f; + [loc]() -> float { + return loc->player ? loc->player->position.z() : 0.0f; }); // set_player_hp(value) — sets the player's current HP directly. api.set_function("set_player_hp", - [game](float value) { - if (game->player) + [loc](float value) { + if (loc->player) { - game->player->hp = value; - if (game->player->currentState == AnimationState::ACTION_TO_DEATH || game->player->currentState == AnimationState::DEATH_IDLE) + loc->player->hp = value; + if (loc->player->currentState == AnimationState::ACTION_TO_DEATH || loc->player->currentState == AnimationState::DEATH_IDLE) { - game->player->currentState = AnimationState::STAND; - game->player->resetAnim = true; + loc->player->currentState = AnimationState::STAND; + loc->player->resetAnim = true; } } }); // get_player_hp() → float (0 if no player) api.set_function("get_player_hp", - [game]() -> float { - return game->player ? game->player->hp : 0.0f; + [loc]() -> float { + return loc->player ? loc->player->hp : 0.0f; }); // Global integer store — shared across all location scripts. @@ -365,15 +365,15 @@ namespace ZL { }); api.set_function("close_phone", - [game]() { - if (game->requestClosePhone) - game->requestClosePhone(); + [loc]() { + if (loc->requestClosePhone) + loc->requestClosePhone(); }); api.set_function("return_to_main_menu", - [game]() { - if (game->requestReturnToMainMenu) - game->requestReturnToMainMenu(); + [loc]() { + if (loc->requestReturnToMainMenu) + loc->requestReturnToMainMenu(); }); api.set_function("set_chat_callbacks", @@ -396,8 +396,8 @@ namespace ZL { }); api.set_function("set_trigger_zone_enabled", - [game](int index, bool value) { - auto& triggerZones = game->triggerZones; + [loc](int index, bool value) { + auto& triggerZones = loc->triggerZones; if (index < 0 || index >= static_cast(triggerZones.size())) { std::cerr << "[script] set_trigger_zone_enabled: index " << index << " out of range\n"; return; @@ -408,8 +408,8 @@ namespace ZL { // set_teleport_active(index, active) — activates or deactivates a teleport zone by index. // Swaps the particle effect texture to match the new state. api.set_function("set_teleport_active", - [game](int index, bool value) { - auto& zones = game->teleportZones; + [loc](int index, bool value) { + auto& zones = loc->teleportZones; if (index < 0 || index >= static_cast(zones.size())) { std::cerr << "[script] set_teleport_active: index " << index << " out of range\n"; return; @@ -419,8 +419,8 @@ namespace ZL { // is_teleport_active(index) → bool api.set_function("is_teleport_active", - [game](int index) -> bool { - auto& zones = game->teleportZones; + [loc](int index) -> bool { + auto& zones = loc->teleportZones; if (index < 0 || index >= static_cast(zones.size())) { std::cerr << "[script] is_teleport_active: index " << index << " out of range\n"; return false; @@ -431,8 +431,8 @@ namespace ZL { // npc_set_hp(index, value) — sets an NPC's current HP directly. api.set_function("npc_set_hp", - [game](int index, float value) { - auto& npcs = game->npcs; + [loc](int index, float value) { + auto& npcs = loc->npcs; if (index < 0 || index >= static_cast(npcs.size())) { std::cerr << "[script] npc_set_hp: index " << index << " out of range\n"; return; @@ -442,8 +442,8 @@ namespace ZL { // npc_set_position(index, x, y, z) — teleports an NPC instantly, no walking. api.set_function("npc_set_position", - [game](int index, float x, float y, float z) { - auto& npcs = game->npcs; + [loc](int index, float x, float y, float z) { + auto& npcs = loc->npcs; if (index < 0 || index >= static_cast(npcs.size())) { std::cerr << "[script] npc_set_position: index " << index << " out of range\n"; return; @@ -456,8 +456,8 @@ namespace ZL { // npc_set_rotation(index, angle) — sets NPC facing angle around Y axis (degrees). api.set_function("npc_set_rotation", - [game](int index, float angle) { - auto& npcs = game->npcs; + [loc](int index, float angle) { + auto& npcs = loc->npcs; if (index < 0 || index >= static_cast(npcs.size())) { std::cerr << "[script] npc_set_rotation: index " << index << " out of range\n"; return; @@ -469,8 +469,8 @@ namespace ZL { // set_npc_enabled(index, enabled) api.set_function("set_npc_enabled", - [game](int index, bool value) { - auto& npcs = game->npcs; + [loc](int index, bool value) { + auto& npcs = loc->npcs; if (index < 0 || index >= static_cast(npcs.size())) { std::cerr << "[script] set_npc_enabled: index " << index << " out of range\n"; return; @@ -481,16 +481,16 @@ namespace ZL { npcs[index]->currentState = AnimationState::STAND; if (npcs[index]->canAttack) { - npcs[index]->attackTarget = game->player.get(); + npcs[index]->attackTarget = loc->player.get(); } npcs[index]->battle_state = 0; }); // move_object(name, x, y, z, duration_sec [, on_complete]) api.set_function("move_object", - [game](const std::string& name, float x, float y, float z, + [loc](const std::string& name, float x, float y, float z, float durationSec, sol::object onComplete) { - for (auto& intObj : game->interactiveObjects) { + for (auto& intObj : loc->interactiveObjects) { if (intObj.loadedObject.name != name) continue; if (intObj.isAnimating) { std::cerr << "[script] move_object: '" << name << "' is already animating\n"; @@ -515,9 +515,9 @@ namespace ZL { // rotate_object(name, angle_deg, duration_sec [, on_complete]) api.set_function("rotate_object", - [game](const std::string& name, float angleDeg, + [loc](const std::string& name, float angleDeg, float durationSec, sol::object onComplete) { - for (auto& intObj : game->interactiveObjects) { + for (auto& intObj : loc->interactiveObjects) { if (intObj.loadedObject.name != name) continue; if (intObj.isAnimating) { std::cerr << "[script] rotate_object: '" << name << "' is already animating\n"; @@ -543,9 +543,9 @@ namespace ZL { // fade_object(name, target_alpha, duration_sec [, on_complete]) api.set_function("fade_object", - [game](const std::string& name, float targetAlpha, + [loc](const std::string& name, float targetAlpha, float durationSec, sol::object onComplete) { - for (auto& intObj : game->interactiveObjects) { + for (auto& intObj : loc->interactiveObjects) { if (intObj.loadedObject.name != name) continue; if (intObj.isAnimating) { std::cerr << "[script] fade_object: '" << name << "' is already animating\n"; @@ -570,9 +570,9 @@ namespace ZL { // scale_object(name, target_scale, duration_sec [, on_complete]) api.set_function("scale_object", - [game](const std::string& name, float targetScale, + [loc](const std::string& name, float targetScale, float durationSec, sol::object onComplete) { - for (auto& intObj : game->interactiveObjects) { + for (auto& intObj : loc->interactiveObjects) { if (intObj.loadedObject.name != name) continue; if (intObj.isAnimating) { std::cerr << "[script] scale_object: '" << name << "' is already animating\n"; @@ -596,20 +596,20 @@ namespace ZL { }); api.set_function("resetPlayerAfterDeath", - [game]() { - if (game->player) game->player->resetPlayerAfterDeath(); + [loc]() { + if (loc->player) loc->player->resetPlayerAfterDeath(); }); // player_stop() — cancels the player's current walk target and stops them immediately. api.set_function("player_stop", - [game]() { - if (game->player) game->player->stopInPlace(); + [loc]() { + if (loc->player) loc->player->stopInPlace(); }); // npc_stop(index) — cancels an NPC's current walk target and stops them immediately. api.set_function("npc_stop", - [game](int index) { - auto& npcs = game->npcs; + [loc](int index) { + auto& npcs = loc->npcs; if (index < 0 || index >= static_cast(npcs.size())) { std::cerr << "[script] npc_stop: index " << index << " out of range (0.." << npcs.size() - 1 << ")\n"; @@ -694,11 +694,11 @@ namespace ZL { }); api.set_function("call_tutorial_taxi_required", - [game]() -> void { - if (game->onPlayerTaxiRequired) + [loc]() -> void { + if (loc->onPlayerTaxiRequired) { - game->onPlayerTaxiRequired(); - game->onPlayerTaxiRequired = nullptr; + loc->onPlayerTaxiRequired(); + loc->onPlayerTaxiRequired = nullptr; } else { std::cerr << "[script] call_tutorial_taxi_required: function is empty\n"; diff --git a/src/dialogue/DialogueOverlay.cpp b/src/dialogue/DialogueOverlay.cpp index 45078e6..93b09a4 100644 --- a/src/dialogue/DialogueOverlay.cpp +++ b/src/dialogue/DialogueOverlay.cpp @@ -48,6 +48,7 @@ void DialogueOverlay::update(const PresentationModel& model, int deltaMs) { } } + void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) { if (model.mode != PresentationMode::Dialogue && model.mode != PresentationMode::Choice) { lastChoiceRects.clear(); @@ -59,7 +60,7 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) { UiRect portraitRect{ 24.0f + 90, 24.0f + 16, 176.0f, 176.0f }; UiRect textboxRect{ 30.f, -48.f, 1222.f, 340.0f }; - UiRect textboxChoiceRect{ 30.f, -48.f, 1200.f, 619.5f }; + UiRect textboxChoiceRect{ 30.f, -90.f, 1200.f, 619.5f }; lastDialogueAdvanceRect = { portraitRect.x, portraitRect.y, textboxRect.x + textboxRect.w - portraitRect.x, textboxRect.h }; @@ -87,7 +88,7 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) { if (model.mode == PresentationMode::Choice) { - glBindTexture(GL_TEXTURE_2D, textboxTexture->getTexID()); + glBindTexture(GL_TEXTURE_2D, textboxChoiceTexture->getTexID()); renderer.DrawVertexRenderStruct(textboxChoiceQuad.mesh); } else @@ -101,7 +102,7 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) { if (model.mode == PresentationMode::Choice) { - renderer.TranslateMatrix(Vector3f{ 0, 230, 0 }); + renderer.TranslateMatrix(Vector3f{ 20, 230, 0 }); } auto portrait = loadTextureCached(model.portraitPath); @@ -128,12 +129,12 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) { if (model.mode == PresentationMode::Choice) { - nameRenderer->drawText(model.speaker, nameX+x, nameY+230, 1.0f, false, { 1.0f, 0.88f, 0.45f, 1.0f }); + nameRenderer->drawText(model.speaker, nameX+20, nameY+230, 1.0f, false, { 1.0f, 0.88f, 0.45f, 1.0f }); } else { - nameRenderer->drawText(model.speaker, nameX+x, nameY, 1.0f, false, { 1.0f, 0.88f, 0.45f, 1.0f }); + nameRenderer->drawText(model.speaker, nameX, nameY, 1.0f, false, { 1.0f, 0.88f, 0.45f, 1.0f }); } } @@ -164,7 +165,7 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) { for (size_t i = 0; i < model.choices.size(); ++i) { const float cy = choiceStartY + (choiceHeight + choiceSpacing) * static_cast(model.choices.size() - 1 - i); - UiRect rect{ 300.f, cy, choiceWidth, choiceHeight }; + UiRect rect{ 320.f, cy, choiceWidth, choiceHeight }; lastChoiceRects.push_back(rect); choiceQuads[i].rebuild(rect);