Working on night mode and how player goes in
This commit is contained in:
parent
1d3bea452c
commit
9221ab68ac
@ -1,17 +1,88 @@
|
|||||||
{
|
{
|
||||||
"lights": [
|
"lights": [
|
||||||
{
|
{
|
||||||
"id": "lamp_library",
|
"id": "lamp_library",
|
||||||
"positionX": 3.76222,
|
"positionX": 3.76222,
|
||||||
"positionY": 5.0,
|
"positionY": 5.0,
|
||||||
"positionZ": 4.16035,
|
"positionZ": 4.16035,
|
||||||
"directionX": 0.0,
|
"directionX": 0.0,
|
||||||
"directionY": -1.0,
|
"directionY": -1.0,
|
||||||
"directionZ": 0.0,
|
"directionZ": 0.0,
|
||||||
"colorR": 4.0,
|
"colorR": 4.0,
|
||||||
"colorG": 3.2,
|
"colorG": 3.2,
|
||||||
"colorB": 2.4,
|
"colorB": 2.4,
|
||||||
"autoLight": false
|
"autoLight": true,
|
||||||
}
|
"autoLightDistance": 6.0
|
||||||
]
|
},
|
||||||
}
|
{
|
||||||
|
"id": "lamp_teacher_room",
|
||||||
|
"positionX": -4.15666,
|
||||||
|
"positionY": 5.0,
|
||||||
|
"positionZ": 4.27091,
|
||||||
|
"directionX": 0.0,
|
||||||
|
"directionY": -1.0,
|
||||||
|
"directionZ": 0.0,
|
||||||
|
"colorR": 4.0,
|
||||||
|
"colorG": 3.2,
|
||||||
|
"colorB": 2.4,
|
||||||
|
"autoLight": true,
|
||||||
|
"autoLightDistance": 6.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lamp_student_room",
|
||||||
|
"positionX": 3.60541,
|
||||||
|
"positionY": 5.0,
|
||||||
|
"positionZ": -4.36552,
|
||||||
|
"directionX": 0.0,
|
||||||
|
"directionY": -1.0,
|
||||||
|
"directionZ": 0.0,
|
||||||
|
"colorR": 4.0,
|
||||||
|
"colorG": 3.2,
|
||||||
|
"colorB": 2.4,
|
||||||
|
"autoLight": true,
|
||||||
|
"autoLightDistance": 6.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lamp_s1_room",
|
||||||
|
"positionX": -3.90337,
|
||||||
|
"positionY": 5.0,
|
||||||
|
"positionZ": -4.00563,
|
||||||
|
"directionX": 0.0,
|
||||||
|
"directionY": -1.0,
|
||||||
|
"directionZ": 0.0,
|
||||||
|
"colorR": 4.0,
|
||||||
|
"colorG": 3.2,
|
||||||
|
"colorB": 2.4,
|
||||||
|
"autoLight": true,
|
||||||
|
"autoLightDistance": 6.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lamp_s0_room",
|
||||||
|
"positionX": -3.90337,
|
||||||
|
"positionY": 5.0,
|
||||||
|
"positionZ": -12.485,
|
||||||
|
"directionX": 0.0,
|
||||||
|
"directionY": -1.0,
|
||||||
|
"directionZ": 0.0,
|
||||||
|
"colorR": 4.0,
|
||||||
|
"colorG": 3.2,
|
||||||
|
"colorB": 2.4,
|
||||||
|
"autoLight": true,
|
||||||
|
"autoLightDistance": 6.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lamp_hall_room",
|
||||||
|
"positionX": 0.0,
|
||||||
|
"positionY": 5.0,
|
||||||
|
"positionZ": 11.7949,
|
||||||
|
"directionX": 0.0,
|
||||||
|
"directionY": -1.0,
|
||||||
|
"directionZ": 0.0,
|
||||||
|
"colorR": 4.0,
|
||||||
|
"colorG": 3.2,
|
||||||
|
"colorB": 2.4,
|
||||||
|
"autoLight": true,
|
||||||
|
"autoLightDistance": 6.0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -192,6 +192,12 @@ function on_player_door_click()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
game_api.set_enter_night_callback(
|
||||||
|
function()
|
||||||
|
game_api.start_dialogue("dialog_video001")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
game_api.set_location_callbacks(
|
game_api.set_location_callbacks(
|
||||||
function()
|
function()
|
||||||
print("Enter location dorm")
|
print("Enter location dorm")
|
||||||
@ -207,14 +213,6 @@ game_api.set_location_callbacks(
|
|||||||
|
|
||||||
game_api.deactivate_interactive_object("Room_Cover_LivingRoom_W_N_2_001")
|
game_api.deactivate_interactive_object("Room_Cover_LivingRoom_W_N_2_001")
|
||||||
|
|
||||||
--debug
|
|
||||||
--game_api.deactivate_interactive_object("Room_Cover_Bath_W_N_2_001")
|
|
||||||
|
|
||||||
--game_api.deactivate_interactive_object("Room_Cover_LivingRoom_W_S_2_001")
|
|
||||||
--game_api.deactivate_interactive_object("Room_Cover_Main_Hall_And_Corridors_002")
|
|
||||||
--game_api.deactivate_interactive_object("Room_Cover_Utility_W_N_3_001")
|
|
||||||
--game_api.deactivate_interactive_object("Room_Cover_Utility_W_S_3_001")
|
|
||||||
--debug end
|
|
||||||
game_api.rotate_object("Door_Utility_-1_1_2_Leaf_001", 90, 0.01, nil)
|
game_api.rotate_object("Door_Utility_-1_1_2_Leaf_001", 90, 0.01, nil)
|
||||||
game_api.rotate_object("Door_Utility_-1_-1_2_Leaf_001", -90, 0.01, nil)
|
game_api.rotate_object("Door_Utility_-1_-1_2_Leaf_001", -90, 0.01, nil)
|
||||||
|
|
||||||
|
|||||||
@ -32,6 +32,12 @@ game_api.start_dialogue("dialog_contaier001")
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
game_api.set_enter_night_callback(
|
||||||
|
function()
|
||||||
|
game_api.start_dialogue("dialog_video001")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
game_api.set_darklands_callbacks(
|
game_api.set_darklands_callbacks(
|
||||||
nil,
|
nil,
|
||||||
function()
|
function()
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef EMSCRIPTEN
|
#ifdef EMSCRIPTEN
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
#endif
|
#endif
|
||||||
@ -1191,7 +1190,11 @@ namespace ZL
|
|||||||
if (darklandsFlashAlpha >= 1.0f) {
|
if (darklandsFlashAlpha >= 1.0f) {
|
||||||
if (isNightTransition) {
|
if (isNightTransition) {
|
||||||
menuManager.isNight = !menuManager.isNight;
|
menuManager.isNight = !menuManager.isNight;
|
||||||
if (currentLocation) currentLocation->dialogueSystem.startDialogue("dialog_video001");
|
if (currentLocation)
|
||||||
|
{
|
||||||
|
//currentLocation->dialogueSystem.startDialogue("dialog_video001");
|
||||||
|
currentLocation->scriptEngine.callTriggerNightEnterCallback();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
isDarklands = !isDarklands;
|
isDarklands = !isDarklands;
|
||||||
|
|
||||||
|
|||||||
@ -362,6 +362,7 @@ namespace ZL {
|
|||||||
money_ -= amount;
|
money_ -= amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MenuManager::openPhoneBank() {
|
void MenuManager::openPhoneBank() {
|
||||||
uiManager.pushMenuFromSavedRoot(phoneBankRoot);
|
uiManager.pushMenuFromSavedRoot(phoneBankRoot);
|
||||||
uiManager.setText("balanceText", formatMoney(money_));
|
uiManager.setText("balanceText", formatMoney(money_));
|
||||||
|
|||||||
@ -25,6 +25,7 @@ namespace ZL {
|
|||||||
sol::protected_function locationExitCallback;
|
sol::protected_function locationExitCallback;
|
||||||
sol::protected_function darklandsEnterCallback;
|
sol::protected_function darklandsEnterCallback;
|
||||||
sol::protected_function darklandsExitCallback;
|
sol::protected_function darklandsExitCallback;
|
||||||
|
sol::protected_function triggerNightEnterCallback;
|
||||||
};
|
};
|
||||||
|
|
||||||
ScriptEngine::ScriptEngine() = default;
|
ScriptEngine::ScriptEngine() = default;
|
||||||
@ -318,6 +319,12 @@ namespace ZL {
|
|||||||
this_impl->darklandsExitCallback = onExit.as<sol::protected_function>();
|
this_impl->darklandsExitCallback = onExit.as<sol::protected_function>();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
api.set_function("set_enter_night_callback",
|
||||||
|
[this_impl = impl.get()](sol::object onEnter) {
|
||||||
|
if (onEnter.is<sol::protected_function>())
|
||||||
|
this_impl->triggerNightEnterCallback = onEnter.as<sol::protected_function>();
|
||||||
|
});
|
||||||
|
|
||||||
api.set_function("set_trigger_zone_enabled",
|
api.set_function("set_trigger_zone_enabled",
|
||||||
[game](int index, bool value) {
|
[game](int index, bool value) {
|
||||||
auto& triggerZones = game->triggerZones;
|
auto& triggerZones = game->triggerZones;
|
||||||
@ -742,6 +749,15 @@ namespace ZL {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptEngine::callTriggerNightEnterCallback() {
|
||||||
|
if (!impl || !impl->triggerNightEnterCallback.valid()) return;
|
||||||
|
auto result = impl->triggerNightEnterCallback();
|
||||||
|
if (!result.valid()) {
|
||||||
|
sol::error err = result;
|
||||||
|
std::cerr << "[SCRIPT] trigger night enter callback error: " << err.what() << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptEngine::callDarklandsExitCallback() {
|
void ScriptEngine::callDarklandsExitCallback() {
|
||||||
if (!impl || !impl->darklandsExitCallback.valid()) return;
|
if (!impl || !impl->darklandsExitCallback.valid()) return;
|
||||||
auto result = impl->darklandsExitCallback();
|
auto result = impl->darklandsExitCallback();
|
||||||
|
|||||||
@ -44,6 +44,8 @@ public:
|
|||||||
void callDarklandsEnterCallback();
|
void callDarklandsEnterCallback();
|
||||||
void callDarklandsExitCallback();
|
void callDarklandsExitCallback();
|
||||||
|
|
||||||
|
void callTriggerNightEnterCallback();
|
||||||
|
|
||||||
void callCutsceneCompleteCallback(const std::string& cutsceneId);
|
void callCutsceneCompleteCallback(const std::string& cutsceneId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user