mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Merge branch 'develop' into sezz_target_highlighter
This commit is contained in:
commit
f0e4dc3b4b
7 changed files with 193 additions and 167 deletions
|
@ -16,6 +16,10 @@ Flow.SetTitleScreenImagePath("Screens\\main.jpg")
|
|||
|
||||
Flow.SetTotalSecretCount(5)
|
||||
|
||||
-- Enable/Disable bilinear filtering.
|
||||
|
||||
Flow.EnablePointFilter(false)
|
||||
|
||||
-- Disable/enable flycheat globally
|
||||
|
||||
Flow.EnableFlyCheat(true)
|
||||
|
|
|
@ -1,191 +1,68 @@
|
|||
--[[
|
||||
NOTE: It's possible to expand string entry tables with extra language variations
|
||||
corresponding to languages in the table at the end of this file.
|
||||
--]]
|
||||
|
||||
local strings =
|
||||
{
|
||||
actions_accelerate = { "Accelerate" },
|
||||
actions_reverse = { "Reverse" },
|
||||
actions_speed = { "Speed" },
|
||||
actions_slow = { "Slow" },
|
||||
actions_brake = { "Brake/Dismount" },
|
||||
actions_fire = { "Fire" },
|
||||
actions_action = { "Action" },
|
||||
actions_sprint = { "Sprint" },
|
||||
actions_draw = { "Draw" },
|
||||
actions_crouch = { "Crouch" },
|
||||
actions_inventory = { "Inventory" },
|
||||
actions_jump = { "Jump" },
|
||||
actions_look = { "Look" },
|
||||
actions_backward = { "Backward" },
|
||||
actions_forward = { "Forward" },
|
||||
actions_left = { "Left" },
|
||||
actions_right = { "Right" },
|
||||
actions_roll = { "Roll" },
|
||||
actions_step_left = { "Step Left" },
|
||||
actions_step_right = { "Step Right" },
|
||||
actions_pause = { "Pause" },
|
||||
actions_walk = { "Walk" },
|
||||
actions_save = { "Save" },
|
||||
actions_load = { "Load" },
|
||||
actions_select = { "Select" },
|
||||
actions_deselect = { "Deselect" },
|
||||
actions_large_medipack = { "Large Medipack" },
|
||||
actions_flare = { "Flare" },
|
||||
actions_next_weapon = { "Next Weapon" },
|
||||
actions_previous_weapon = { "Previous Weapon" },
|
||||
actions_small_medipack = { "Small Medipack" },
|
||||
actions_weapon_1 = { "Weapon 1" },
|
||||
actions_weapon_2 = { "Weapon 2" },
|
||||
actions_weapon_3 = { "Weapon 3" },
|
||||
actions_weapon_4 = { "Weapon 4" },
|
||||
actions_weapon_5 = { "Weapon 5" },
|
||||
actions_weapon_6 = { "Weapon 6" },
|
||||
actions_weapon_7 = { "Weapon 7" },
|
||||
actions_weapon_8 = { "Weapon 8" },
|
||||
actions_weapon_9 = { "Weapon 9" },
|
||||
actions_weapon_10 = { "Weapon 10" },
|
||||
window_title = { "TombEngine" },
|
||||
all = { "All" },
|
||||
apply = { "Apply" },
|
||||
automatic_targeting = { "Automatic Targeting" },
|
||||
back = { "Back" },
|
||||
--[[
|
||||
Level name strings
|
||||
--]]
|
||||
lara_home = { "Lara's Home" },
|
||||
test_level = { "Test Level" },
|
||||
title = { "Title" },
|
||||
|
||||
--[[
|
||||
Inventory item strings
|
||||
--]]
|
||||
binoculars = { "Binoculars" },
|
||||
close = { "Close" },
|
||||
cancel = { "Cancel" },
|
||||
caustics = { "Underwater Caustics" },
|
||||
choose_ammo = { "Choose Ammo" },
|
||||
choose_weapon = { "Choose Weapon" },
|
||||
combine = { "Combine" },
|
||||
combine_with = { "Combine With" },
|
||||
controls = { "Controls" },
|
||||
reset_to_defaults = { "Reset to Defaults" },
|
||||
crossbow = { "Crossbow" },
|
||||
crossbow_normal_ammo = { "Crossbow Normal Ammo" },
|
||||
crossbow_poison_ammo = { "Crossbow Poison Ammo" },
|
||||
crossbow_explosive_ammo = { "Crossbow Explosive Ammo" },
|
||||
crossbow_lasersight = { "Crossbow + Lasersight" },
|
||||
crossbow_normal_ammo = { "Crossbow Normal Ammo" },
|
||||
crossbow_poison_ammo = { "Crossbow Poison Ammo" },
|
||||
crowbar = { "Crowbar" },
|
||||
diary = { "Diary" },
|
||||
disabled = { "Disabled" },
|
||||
display = { "Display Settings" },
|
||||
display_adapter = { "Display Adapter" },
|
||||
distance_travelled = { "Distance Travelled" },
|
||||
enable_sound = { "Enable Sounds" },
|
||||
enabled = { "Enabled" },
|
||||
equip = { "Equip" },
|
||||
examine = { "Examine" },
|
||||
exit_game = { "Exit Game" },
|
||||
exit_to_title = { "Exit to Title" },
|
||||
flares = { "Flares" },
|
||||
general_actions = { "General Actions"},
|
||||
grenade_launcher = { "Grenade Launcher" },
|
||||
grenade_launcher_flash_ammo = { "Grenade Launcher Flash Ammo" },
|
||||
grenade_launcher_normal_ammo = { "Grenade Launcher Normal Ammo" },
|
||||
grenade_launcher_super_ammo = { "Grenade Launcher Super Ammo" },
|
||||
grenade_launcher_flash_ammo = { "Grenade Launcher Flash Ammo" },
|
||||
harpoon_gun = { "Harpoon Gun" },
|
||||
harpoon_gun_ammo = { "Harpoon Gun Ammo" },
|
||||
headset = { "Headset" },
|
||||
hk = { "HK" },
|
||||
hk_ammo = { "HK Ammo" },
|
||||
hk_burst_mode = { "Burst Mode" },
|
||||
hk_rapid_mode = { "Rapid Mode" },
|
||||
hk_lasersight = { "HK + Lasersight" },
|
||||
hk_rapid_mode = { "Rapid Mode" },
|
||||
hk_sniper_mode = { "Sniper Mode" },
|
||||
lara_home = { "Lara's Home" },
|
||||
large_medipack = { "Large Medipack" },
|
||||
lasersight = { "Lasersight" },
|
||||
menu_actions = { "Menu Actions" },
|
||||
music_volume = { "Music Volume" },
|
||||
new_game = { "New Game" },
|
||||
none = { "None" },
|
||||
ok = { "OK" },
|
||||
options = { "Options" },
|
||||
other_settings = { "Sound and Gameplay" },
|
||||
output_settings = { "Output Settings" },
|
||||
mechanical_scarab = { "Mechanical Scarab With Winding Key" },
|
||||
mechanical_scarab_1 = { "Mechanical Scarab (No Winding Key)" },
|
||||
mechanical_scarab_2 = { "Mechanical Scarab Winding Key" },
|
||||
passport = { "Passport" },
|
||||
pistol_ammo = { "Pistol Ammo" },
|
||||
pistols = { "Pistols" },
|
||||
player = { "Player" },
|
||||
render_options = { "Render Options" },
|
||||
reverb = { "Reverb" },
|
||||
revolver = { "Revolver" },
|
||||
revolver_ammo = { "Revolver Ammo" },
|
||||
revolver_lasersight = { "Revolver + Lasersight" },
|
||||
rocket_launcher_ammo = { "Rocket Launcher Ammo" },
|
||||
rocket_launcher = { "Rocket Launcher" },
|
||||
rumble = { "Rumble" },
|
||||
subtitles = { "Subtitles" },
|
||||
save_game = { "Save Game" },
|
||||
savegame_timestamp = { "%02d Days %02d:%02d:%02d" },
|
||||
screen_resolution = { "Screen Resolution" },
|
||||
level_secrets_found = { "Secrets Found in Level" },
|
||||
total_secrets_found = { "Secrets Found Total" },
|
||||
select_level = { "Select Level" },
|
||||
separate = { "Separate" },
|
||||
sfx_volume = { "SFX Volume" },
|
||||
shadows = { "Shadows" },
|
||||
rocket_launcher_ammo = { "Rocket Launcher Ammo" },
|
||||
shotgun = { "Shotgun" },
|
||||
shotgun_normal_ammo = { "Shotgun Normal Ammo" },
|
||||
shotgun_wideshot_ammo = { "Shotgun Wideshot Ammo" },
|
||||
small_medipack = { "Small Medipack" },
|
||||
sound = { "Sound" },
|
||||
silencer = { "Silencer" },
|
||||
view = { "View" },
|
||||
thumbstick_camera = { "Thumbstick Camera" },
|
||||
time_taken = { "Time Taken" },
|
||||
statistics = { "Statistics" },
|
||||
target_highlighter = { "Target Highlighter" },
|
||||
small_medipack = { "Small Medipack" },
|
||||
torch = { "Torch" },
|
||||
empty = { "Empty" },
|
||||
use = { "Use" },
|
||||
ammo_used = { "Ammo Used" },
|
||||
used_medipacks = { "Medipacks Used" },
|
||||
uzi_ammo = { "Uzi Ammo" },
|
||||
uzis = { "Uzis" },
|
||||
volumetric_fog = { "Volumetric Fog" },
|
||||
antialiasing = { "Antialiasing" },
|
||||
low = { "Low" },
|
||||
medium = { "Medium" },
|
||||
high = { "High" },
|
||||
waiting_for_input = { "Waiting For Input" },
|
||||
windowed = { "Windowed" },
|
||||
load_game = { "Load Game" },
|
||||
quick_actions = { "Quick Actions" },
|
||||
vehicle_actions = { "Vehicle Actions" },
|
||||
test_level = { "Test Level" },
|
||||
torch2 = { "Torch 2" },
|
||||
waterskin_small_empty = { "Small Waterskin (Empty)" },
|
||||
waterskin_small_1l = { "Small Waterskin (1L)" },
|
||||
waterskin_small_2l = { "Small Waterskin (2L)" },
|
||||
waterskin_small_3l = { "Small Waterskin (3L)" },
|
||||
waterskin_large_empty = { "Large Waterskin (Empty)" },
|
||||
waterskin_large_1l = { "Large Waterskin (1L)" },
|
||||
waterskin_large_2l = { "Large Waterskin (2L)" },
|
||||
waterskin_large_3l = { "Large Waterskin (3L)" },
|
||||
waterskin_large_4l = { "Large Waterskin (4L)" },
|
||||
waterskin_large_5l = { "Large Waterskin (5L)" },
|
||||
window_title = { "TombEngine" },
|
||||
mechanical_scarab = { "Mechanical Scarab With Winding Key" },
|
||||
mechanical_scarab_1 = { "Mechanical Scarab (No Winding Key)" },
|
||||
mechanical_scarab_2 = { "Mechanical Scarab Winding Key" },
|
||||
title = { "Title" }
|
||||
waterskin_large_empty = { "Large Waterskin (Empty)" },
|
||||
waterskin_small_1l = { "Small Waterskin (1L)" },
|
||||
waterskin_small_2l = { "Small Waterskin (2L)" },
|
||||
waterskin_small_3l = { "Small Waterskin (3L)" },
|
||||
waterskin_small_empty = { "Small Waterskin (Empty)" },
|
||||
}
|
||||
|
||||
TEN.Flow.SetStrings(strings)
|
||||
|
||||
local languages =
|
||||
{
|
||||
"English",
|
||||
"Italian",
|
||||
"German",
|
||||
"French",
|
||||
"Dutch",
|
||||
"Spanish",
|
||||
"Japanese",
|
||||
"Russian"
|
||||
}
|
||||
|
||||
TEN.Flow.SetLanguageNames(languages)
|
||||
|
||||
|
|
132
Scripts/SystemStrings.lua
Normal file
132
Scripts/SystemStrings.lua
Normal file
|
@ -0,0 +1,132 @@
|
|||
--[[
|
||||
NOTE: It's possible to expand string entry tables with extra language variations
|
||||
corresponding to languages in the table at the end of this file.
|
||||
--]]
|
||||
|
||||
local strings =
|
||||
{
|
||||
actions_accelerate = { "Accelerate" },
|
||||
actions_action = { "Action" },
|
||||
actions_backward = { "Backward" },
|
||||
actions_brake = { "Brake/Dismount" },
|
||||
actions_crouch = { "Crouch" },
|
||||
actions_deselect = { "Deselect" },
|
||||
actions_draw = { "Draw" },
|
||||
actions_fire = { "Fire" },
|
||||
actions_flare = { "Flare" },
|
||||
actions_forward = { "Forward" },
|
||||
actions_inventory = { "Inventory" },
|
||||
actions_jump = { "Jump" },
|
||||
actions_large_medipack = { "Large Medipack" },
|
||||
actions_left = { "Left" },
|
||||
actions_load = { "Load" },
|
||||
actions_look = { "Look" },
|
||||
actions_next_weapon = { "Next Weapon" },
|
||||
actions_pause = { "Pause" },
|
||||
actions_previous_weapon = { "Previous Weapon" },
|
||||
actions_reverse = { "Reverse" },
|
||||
actions_right = { "Right" },
|
||||
actions_roll = { "Roll" },
|
||||
actions_save = { "Save" },
|
||||
actions_select = { "Select" },
|
||||
actions_slow = { "Slow" },
|
||||
actions_small_medipack = { "Small Medipack" },
|
||||
actions_speed = { "Speed" },
|
||||
actions_sprint = { "Sprint" },
|
||||
actions_step_left = { "Step Left" },
|
||||
actions_step_right = { "Step Right" },
|
||||
actions_walk = { "Walk" },
|
||||
actions_weapon_1 = { "Weapon 1" },
|
||||
actions_weapon_10 = { "Weapon 10" },
|
||||
actions_weapon_2 = { "Weapon 2" },
|
||||
actions_weapon_3 = { "Weapon 3" },
|
||||
actions_weapon_4 = { "Weapon 4" },
|
||||
actions_weapon_5 = { "Weapon 5" },
|
||||
actions_weapon_6 = { "Weapon 6" },
|
||||
actions_weapon_7 = { "Weapon 7" },
|
||||
actions_weapon_8 = { "Weapon 8" },
|
||||
actions_weapon_9 = { "Weapon 9" },
|
||||
all = { "All" },
|
||||
ammo_used = { "Ammo Used" },
|
||||
antialiasing = { "Antialiasing" },
|
||||
apply = { "Apply" },
|
||||
auto_target = { "Automatic Targeting" },
|
||||
back = { "Back" },
|
||||
cancel = { "Cancel" },
|
||||
caustics = { "Underwater Caustics" },
|
||||
choose_ammo = { "Choose Ammo" },
|
||||
choose_weapon = { "Choose Weapon" },
|
||||
close = { "Close" },
|
||||
combine = { "Combine" },
|
||||
combine_with = { "Combine With" },
|
||||
controls = { "Controls" },
|
||||
disabled = { "Disabled" },
|
||||
display = { "Display Settings" },
|
||||
display_adapter = { "Display Adapter" },
|
||||
distance_travelled = { "Distance Travelled" },
|
||||
empty = { "Empty" },
|
||||
enable_sound = { "Enable Sounds" },
|
||||
enabled = { "Enabled" },
|
||||
equip = { "Equip" },
|
||||
examine = { "Examine" },
|
||||
exit_game = { "Exit Game" },
|
||||
exit_to_title = { "Exit to Title" },
|
||||
general_actions = { "General Actions"},
|
||||
high = { "High" },
|
||||
level_secrets_found = { "Secrets Found in Level" },
|
||||
load_game = { "Load Game" },
|
||||
low = { "Low" },
|
||||
medium = { "Medium" },
|
||||
menu_actions = { "Menu Actions" },
|
||||
music_volume = { "Music Volume" },
|
||||
new_game = { "New Game" },
|
||||
none = { "None" },
|
||||
ok = { "OK" },
|
||||
options = { "Options" },
|
||||
other_settings = { "Sound and Gameplay" },
|
||||
output_settings = { "Output Settings" },
|
||||
player = { "Player" },
|
||||
quick_actions = { "Quick Actions" },
|
||||
render_options = { "Render Options" },
|
||||
reset_to_defaults = { "Reset to Defaults" },
|
||||
reverb = { "Reverb" },
|
||||
rumble = { "Rumble" },
|
||||
save_game = { "Save Game" },
|
||||
savegame_timestamp = { "%02d Days %02d:%02d:%02d" },
|
||||
screen_resolution = { "Screen Resolution" },
|
||||
select_level = { "Select Level" },
|
||||
separate = { "Separate" },
|
||||
sfx_volume = { "SFX Volume" },
|
||||
shadows = { "Shadows" },
|
||||
sound = { "Sound" },
|
||||
statistics = { "Statistics" },
|
||||
subtitles = { "Subtitles" },
|
||||
target_highlighter = { "Target Highlighter" },
|
||||
thumbstick_camera = { "Thumbstick Camera" },
|
||||
time_taken = { "Time Taken" },
|
||||
total_secrets_found = { "Secrets Found Total" },
|
||||
use = { "Use" },
|
||||
used_medipacks = { "Medipacks Used" },
|
||||
vehicle_actions = { "Vehicle Actions" },
|
||||
view = { "View" },
|
||||
volumetric_fog = { "Volumetric Fog" },
|
||||
waiting_for_input = { "Waiting For Input" },
|
||||
window_title = { "TombEngine" },
|
||||
windowed = { "Windowed" },
|
||||
}
|
||||
|
||||
TEN.Flow.SetStrings(strings)
|
||||
|
||||
local languages =
|
||||
{
|
||||
"English",
|
||||
"Italian",
|
||||
"German",
|
||||
"French",
|
||||
"Dutch",
|
||||
"Spanish",
|
||||
"Japanese",
|
||||
"Russian"
|
||||
}
|
||||
|
||||
TEN.Flow.SetLanguageNames(languages)
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
#include "framework.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include "Scripting/Internal/LuaHandler.h"
|
||||
|
||||
LuaHandler::LuaHandler(sol::state* lua) : m_lua{ lua }
|
||||
|
@ -16,8 +18,11 @@ void LuaHandler::ResetGlobals()
|
|||
m_lua->set(sol::metatable_key, mt);
|
||||
}
|
||||
|
||||
void LuaHandler::ExecuteScript(const std::string& luaFilename)
|
||||
void LuaHandler::ExecuteScript(const std::string& luaFilename, bool isOptional)
|
||||
{
|
||||
if (isOptional && !std::filesystem::is_regular_file(luaFilename))
|
||||
return;
|
||||
|
||||
auto result = m_lua->safe_script_file(luaFilename, sol::script_pass_on_error);
|
||||
if (!result.valid())
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ public:
|
|||
LuaHandler& operator=(const LuaHandler&) = delete;
|
||||
~LuaHandler() = default;
|
||||
|
||||
void ExecuteScript(const std::string& luaFilename);
|
||||
void ExecuteScript(const std::string& luaFilename, bool isOptional = false);
|
||||
void ExecuteString(const std::string& command);
|
||||
|
||||
void ResetGlobals();
|
||||
|
|
|
@ -215,8 +215,8 @@ Specify which translations in the strings table correspond to which languages.
|
|||
|
||||
FlowHandler::~FlowHandler()
|
||||
{
|
||||
for (auto& lev : Levels)
|
||||
delete lev;
|
||||
for (auto& level : Levels)
|
||||
delete level;
|
||||
}
|
||||
|
||||
std::string FlowHandler::GetGameDir()
|
||||
|
@ -235,9 +235,17 @@ void FlowHandler::SetLanguageNames(sol::as_table_t<std::vector<std::string>> &&
|
|||
}
|
||||
|
||||
void FlowHandler::SetStrings(sol::nested<std::unordered_map<std::string, std::vector<std::string>>>&& src)
|
||||
{
|
||||
if (m_translationsMap.empty())
|
||||
{
|
||||
m_translationsMap = std::move(src);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto& stringPair : src.value())
|
||||
m_translationsMap.insert_or_assign(stringPair.first, stringPair.second);
|
||||
}
|
||||
}
|
||||
|
||||
void FlowHandler::SetSettings(Settings const & src)
|
||||
{
|
||||
|
@ -272,8 +280,9 @@ void FlowHandler::SetTotalSecretCount(int secretsNumber)
|
|||
void FlowHandler::LoadFlowScript()
|
||||
{
|
||||
m_handler.ExecuteScript(m_gameDir + "Scripts/Gameflow.lua");
|
||||
m_handler.ExecuteScript(m_gameDir + "Scripts/Strings.lua");
|
||||
m_handler.ExecuteScript(m_gameDir + "Scripts/Settings.lua");
|
||||
m_handler.ExecuteScript(m_gameDir + "Scripts/SystemStrings.lua");
|
||||
m_handler.ExecuteScript(m_gameDir + "Scripts/Strings.lua", true);
|
||||
m_handler.ExecuteScript(m_gameDir + "Scripts/Settings.lua", true);
|
||||
|
||||
SetScriptErrorMode(GetSettings()->ErrorMode);
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "Scripting/Internal/LanguageScript.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue