Skip to content

Commit

Permalink
Various enhancements
Browse files Browse the repository at this point in the history
- (WIP) Remove SQLiteCpp
- Display live voice availability in single mode race results
- Add il2cppFnMapPath option #16
- Change injection method #16
- Remove deprecated behavior
  • Loading branch information
Kimjio committed Dec 12, 2024
1 parent 46109d9 commit b50b1e5
Show file tree
Hide file tree
Showing 47 changed files with 2,816 additions and 1,370 deletions.
1 change: 0 additions & 1 deletion deps/SQLiteCpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function SQLiteCpp.project()
SQLiteCpp.includes()

files {
path.join(SQLiteCpp.source, "sqlite3/**.c"),
path.join(SQLiteCpp.source, "src/**.cpp")
}

Expand Down
2 changes: 1 addition & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ workspace "umamusume-localify"
dependencies.projects()

project "umamusume-localify"
targetname "version"
targetname "UnityPlayer"

language "C++"
kind "SharedLib"
Expand Down
74 changes: 44 additions & 30 deletions src/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ namespace config
wstring text_id_dict;

rapidjson::Document code_map;
rapidjson::Document fn_map;

bool has_json_parse_error = false;
wstring json_parse_error_msg;
Expand All @@ -93,6 +94,7 @@ namespace config
bool useDefaultFPS = false;
float ratioVertical = 0.5625f;
float ratioHorizontal = 1.7777778f;
bool allowStart = true;
}

void read_config_init()
Expand Down Expand Up @@ -145,35 +147,35 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
{
unlock_size = true;
}
);
);

GetValue("freeFormUiScalePortrait", Float, freeform_ui_scale_portrait,
if (freeform_ui_scale_portrait <= 0)
{
freeform_ui_scale_portrait = 0.5f;
}
);
);

GetValue("freeFormUiScaleLandscape", Float, freeform_ui_scale_landscape,
if (freeform_ui_scale_landscape <= 0)
{
freeform_ui_scale_landscape = 0.5f;
}
);
);

GetValue("initialWidth", Int, initial_width,
if (initial_width <= 72)
{
initial_width = -1;
}
);
);

GetValue("initialHeight", Int, initial_height,
if (initial_height <= 72)
{
initial_height = -1;
}
);
);

GetValue("uiAnimationScale", Float, resolution_3d_scale);

Expand All @@ -196,25 +198,25 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
{
graphics_quality = -1;
}
if (graphics_quality > 4)
{
graphics_quality = 3;
}
if (graphics_quality > 4)
{
graphics_quality = 3;
}
);

GetValue("antiAliasing", Int, anti_aliasing,
vector<int> options = { 0, 2, 4, 8, -1 };
anti_aliasing = options[find(options.begin(), options.end(), anti_aliasing) - options.begin()];
anti_aliasing = options[find(options.begin(), options.end(), anti_aliasing) - options.begin()];
);

GetValue("anisotropicFiltering", Int, anisotropic_filtering,
vector<int> options = { 0, 1, 2, -1 };
anisotropic_filtering = options[find(options.begin(), options.end(), anisotropic_filtering) - options.begin()];
anisotropic_filtering = options[find(options.begin(), options.end(), anisotropic_filtering) - options.begin()];
);

GetValue("vSyncCount", Int, vsync_count,
vector<int> options = { 0, 1, 2, 3, 4, -1 };
vsync_count = options[find(options.begin(), options.end(), vsync_count) - options.begin()];
vsync_count = options[find(options.begin(), options.end(), vsync_count) - options.begin()];
);

GetValue("uiLoadingShowOrientationGuide", Bool, ui_loading_show_orientation_guide);
Expand Down Expand Up @@ -244,7 +246,7 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
}
}
}
);
);

GetValue("replaceAssetBundleFilePath", String, replace_assetbundle_file_path);

Expand All @@ -257,7 +259,7 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
replace_assetbundle_file_paths.emplace_back(value);
}
}
);
);

GetValue("replaceTextDBPath", String, replace_text_db_path);

Expand All @@ -280,7 +282,7 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
GetValue("characterSystemTextCaptionPositionY", Float, character_system_text_caption_position_y);

GetValue("liveSliderAlwaysShow", Bool, live_slider_always_show);

GetValue("livePlaybackLoop", Bool, live_playback_loop);

GetValue("championsLiveShowText", Bool, champions_live_show_text);
Expand All @@ -290,18 +292,18 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
{
champions_live_resource_id = 1;
}
);
);

GetValue("championsLiveYear", Int, champions_live_year);

GetValue("cySpringUpdateMode", Int, cyspring_update_mode,
vector<int> options = { 0, 1, 2, 3, -1 };
cyspring_update_mode = options[find(options.begin(), options.end(), cyspring_update_mode) - options.begin()];
cyspring_update_mode = options[find(options.begin(), options.end(), cyspring_update_mode) - options.begin()];
)
else if (max_fps > 30)
{
cyspring_update_mode = 1;
}
else if (max_fps > 30)
{
cyspring_update_mode = 1;
}

GetValue("hideNowLoading", Bool, hide_now_loading);

Expand All @@ -313,13 +315,25 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
GetValue("codeMapPath", String, auto path,
ifstream code_map_stream{ path };

if (code_map_stream.is_open())
{
rapidjson::IStreamWrapper wrapper{ code_map_stream };
code_map.ParseStream(wrapper);
if (code_map_stream.is_open())
{
rapidjson::IStreamWrapper wrapper{ code_map_stream };
code_map.ParseStream(wrapper);

code_map_stream.close();
}
code_map_stream.close();
}
);

GetValue("il2cppFnMapPath", String, auto path,
ifstream fn_map_stream{ path };

if (fn_map_stream.is_open())
{
rapidjson::IStreamWrapper wrapper{ fn_map_stream };
fn_map.ParseStream(wrapper);

fn_map_stream.close();
}
);

GetValue("discordRichPresence", Bool, discord_rich_presence);
Expand All @@ -332,7 +346,7 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\

GetValue("dumpMsgPackRequest", Bool, dump_msgpack_request);

#ifdef _DEBUG
#ifdef EXPERIMENTS
GetValue("unlockLiveChara", Bool, unlock_live_chara);
#endif

Expand Down Expand Up @@ -361,7 +375,7 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
dicts.emplace_back(value);
}
}
);
);

GetValue("externalDlls", Array, auto array,
for (auto it = array.Begin(); it != array.End(); it++)
Expand All @@ -372,7 +386,7 @@ if (document.HasMember(L##_name_) && document[L##_name_].Is##_type_())\
external_dlls_path.emplace_back(value);
}
}
);
);
}
else
{
Expand Down
4 changes: 4 additions & 0 deletions src/config/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "il2cpp/il2cpp_symbols.hpp"

#define _EXPERIMENTS

typedef rapidjson::GenericDocument<rapidjson::UTF16<>> WDocument;
typedef rapidjson::GenericValue<rapidjson::UTF16<>> WValue;
typedef rapidjson::GenericStringBuffer<rapidjson::UTF16<>> WStringBuffer;
Expand Down Expand Up @@ -108,6 +110,7 @@ namespace config
extern wstring text_id_dict;

extern rapidjson::Document code_map;
extern rapidjson::Document fn_map;

extern bool has_json_parse_error;
extern wstring json_parse_error_msg;
Expand All @@ -123,6 +126,7 @@ namespace config
extern bool useDefaultFPS;
extern float ratioVertical;
extern float ratioHorizontal;
extern bool allowStart;
}

void read_config_init();
Expand Down
74 changes: 0 additions & 74 deletions src/dllproxy/proxy.cpp

This file was deleted.

4 changes: 0 additions & 4 deletions src/dllproxy/proxy.hpp

This file was deleted.

Loading

0 comments on commit b50b1e5

Please sign in to comment.