Merge branch 'master' of Jay39w/PD-Loader into master
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
[playerdata]
|
||||
#########################################
|
||||
# /!\ WARNING: DO NOT EDIT WITH NOTEPAD!#
|
||||
#########################################
|
||||
@@ -5,52 +6,59 @@
|
||||
# playerdata.ini
|
||||
# defines constant values to be loaded into the PlayerData struct
|
||||
# this file has to be encoded using utf-8
|
||||
|
||||
player_name = NO-NAME
|
||||
level_name = 忘れないでね私の声を
|
||||
player_name =NO-NAME
|
||||
level_name =忘れないでね私の声を
|
||||
level =1
|
||||
vocaloid_point=0
|
||||
|
||||
# IDs defined in rom/gm_plate_tbl.farc/gm_plate_id.bin
|
||||
level_plate_id = 0
|
||||
# Shows an effect on the level plate (-1=off, 0~2=different settings)
|
||||
level_plate_effect =-1
|
||||
|
||||
# IDs same as gam_skin%03d
|
||||
skin_equip = 0
|
||||
|
||||
level_plate_id =0
|
||||
level_plate_effect=1
|
||||
# IDs same as gam_skin%3d
|
||||
skin_equip =0
|
||||
# Allows for song specific skin settings which can be set in the file skins.ini
|
||||
use_pv_skin_equip =true
|
||||
# IDs defined in rom/gm_btn_se_tbl.farc/gm_btn_se_id.bin
|
||||
btn_se_equip = -1
|
||||
|
||||
btn_se_equip =-1
|
||||
# Allows for song specific sound effect settings which can be set in the file sfx.ini
|
||||
use_pv_sfx_equip =true
|
||||
# IDs defined in rom/gm_slide_se_tbl.farc/gm_slide_se_id.bin
|
||||
slide_se_equip = -1
|
||||
|
||||
slide_se_equip =-1
|
||||
# IDs defined in rom/gm_chainslide_se_tbl.farc/gm_chainslide_se_id.bin
|
||||
chainslide_se_equip = -1
|
||||
|
||||
# IDs defined in rom/gm_slidertouch_se_tbl.farc/gm_slidertouch_se_id.bin(?)
|
||||
slidertouch_se_equip =-1
|
||||
|
||||
# Enable button/slider sounds
|
||||
act_toggle = true
|
||||
|
||||
chainslide_se_equip =-1
|
||||
slidertouch_se_equip=-1
|
||||
# "Shared Set" or "Original" setting, works similarly to PSP series module selection (Updates when changed in-game)
|
||||
module_equip_cmn0=0
|
||||
module_equip_cmn1=0
|
||||
module_equip_cmn2=0
|
||||
module_equip_cmn3=0
|
||||
module_equip_cmn4=0
|
||||
module_equip_cmn5=0
|
||||
# Allows Song Specific module selections (values update when changed in-game in the file modules.ini) (May lag on song select and menu)
|
||||
use_pv_module_equip=true
|
||||
# Enable button/slider sounds & volume settings
|
||||
act_toggle =true
|
||||
act_vol =100
|
||||
act_slide_vol=100
|
||||
# Show clear borders on Progress Bar for:
|
||||
# Great
|
||||
border_great = true
|
||||
border_great =true
|
||||
# Excellent
|
||||
border_excellent = true
|
||||
# Rival score
|
||||
border_rival =false
|
||||
border_excellent =true
|
||||
# Rival
|
||||
border_rival=true
|
||||
|
||||
# Allows module selection safely (WARNING: It may cause lag in the main menu and other places)
|
||||
use_card = true
|
||||
# Allows module selection (WARNING: It may cause lag in the main menu and other places) (May be necessary for use_pv_equip settings!)
|
||||
use_card =true
|
||||
|
||||
# Attempts to disable module refresh when sliding in PV select to reduce CPU and IO load.
|
||||
module_card_workaround = false
|
||||
# Allows module selection without card and attempts to disable module refresh when sliding in PV select to reduce CPU and IO load.
|
||||
module_card_workaround =false
|
||||
|
||||
# Allows use of game mode modifiers (hi-speed, hidden, and sudden)
|
||||
gamemode_options = true
|
||||
gamemode_options =true
|
||||
|
||||
|
||||
|
||||
# Mylists
|
||||
# Make comma separated lists, like `mylist_A=1,2,3`
|
||||
mylist_A=
|
||||
mylist_B=
|
||||
mylist_C=
|
||||
mylist_C=
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
[modules]
|
||||
# Manual editing is NOT recommended as the game will save here during gameplay
|
||||
@@ -0,0 +1,4 @@
|
||||
[SFX]
|
||||
# INI Format = ' pv.xxx.btn = sfx id (ex. 5) '
|
||||
# pv.001.btn=2 for example
|
||||
# pv.xxx.btn, pv.xxx.chain, pv.xxx.slide & pv.xxx.touch can all be assigned using the format
|
||||
@@ -0,0 +1,3 @@
|
||||
[skins]
|
||||
# INI Format = ' pv.xxx.skin = skin ID (ex. 123) '
|
||||
# pv.001.skin=100 for example
|
||||
@@ -224,6 +224,9 @@ ConfigOptionBase* playerdataArray[] = {
|
||||
|
||||
new BooleanOption(L"use_card", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Use Card", L"Enables IC card. This allows module selection.", false, true),
|
||||
new BooleanOption(L"module_card_workaround", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Module Selection Workaround", L"Allows module selection without card and tries to improve menu performance.\n(BETA)", true, true),
|
||||
new BooleanOption(L"use_pv_module_equip ", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Song Specific Modules", L"Allows song-specific module selection.", false, true),
|
||||
new BooleanOption(L"use_pv_skin_equip ", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Song Specific Skins", L"Allows song-specific skin settings.\nValues stored in skins.ini", false, true),
|
||||
new BooleanOption(L"use_pv_sfx_equip ", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Song Specific Sound Effects", L"Allows song-specific sound effect settings.\nValues stored in sfx.ini", false, true),
|
||||
|
||||
new BooleanOption(L"gamemode_options", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Game Modifiers", L"Allows use of game mode modifiers (hi-speed, hidden, and sudden).", true, true),
|
||||
};
|
||||
|
||||
@@ -29,6 +29,11 @@ namespace TLAC::Components
|
||||
int ModuleEquipCmn3;
|
||||
int ModuleEquipCmn4;
|
||||
int ModuleEquipCmn5;
|
||||
int ActionVol;
|
||||
int ActionSlideVol;
|
||||
int UsePVEquip;
|
||||
int UsePVSFXEquip;
|
||||
int UsePVSkinEquip;
|
||||
bool ShowGreatClearBorder;
|
||||
bool ShowExcellentClearBorder;
|
||||
bool ShowRivalClearBorder;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
const std::string PLAYER_DATA_FILE_NAME = "playerdata.ini";
|
||||
static WCHAR configPath[256];
|
||||
int* headitemequip = (int*)0x0000000141804CDC;
|
||||
int customheaditemequip;
|
||||
namespace TLAC::Components
|
||||
{
|
||||
PlayerDataManager::PlayerDataManager()
|
||||
@@ -234,7 +236,7 @@ namespace TLAC::Components
|
||||
config.TryGetValue("player_name", &customPlayerData->PlayerName);
|
||||
config.TryGetValue("level_name", &customPlayerData->LevelName);
|
||||
|
||||
// ScoreSaver copies (can be improved?)
|
||||
// ScoreSaver copies & declaring non-playerdata values
|
||||
std::string utf8path = TLAC::framework::GetModuleDirectory() + "/playerdata.ini";
|
||||
MultiByteToWideChar(CP_UTF8, 0, utf8path.c_str(), -1, configPath, 256);
|
||||
|
||||
@@ -247,18 +249,17 @@ namespace TLAC::Components
|
||||
customPlayerData->SlideSeEquip = config.GetIntegerValue("slide_se_equip");
|
||||
customPlayerData->ChainslideSeEquip = config.GetIntegerValue("chainslide_se_equip");
|
||||
customPlayerData->SlidertouchSeEquip = config.GetIntegerValue("slidertouch_se_equip");
|
||||
//customPlayerData->ModuleEquip0 = config.GetIntegerValue("module_equip0"); See below for explanation
|
||||
//customPlayerData->ModuleEquip1 = config.GetIntegerValue("module_equip1");
|
||||
//customPlayerData->ModuleEquip2 = config.GetIntegerValue("module_equip2");
|
||||
//customPlayerData->ModuleEquip3 = config.GetIntegerValue("module_equip3");
|
||||
//customPlayerData->ModuleEquip4 = config.GetIntegerValue("module_equip4");
|
||||
//customPlayerData->ModuleEquip5 = config.GetIntegerValue("module_equip5");
|
||||
customPlayerData->ModuleEquipCmn0 = config.GetIntegerValue("module_equip_cmn0");
|
||||
customPlayerData->ModuleEquipCmn1 = config.GetIntegerValue("module_equip_cmn1");
|
||||
customPlayerData->ModuleEquipCmn2 = config.GetIntegerValue("module_equip_cmn2");
|
||||
customPlayerData->ModuleEquipCmn3 = config.GetIntegerValue("module_equip_cmn3");
|
||||
customPlayerData->ModuleEquipCmn4 = config.GetIntegerValue("module_equip_cmn4");
|
||||
customPlayerData->ModuleEquipCmn5 = config.GetIntegerValue("module_equip_cmn5");
|
||||
customPlayerData->ActionVol = config.GetIntegerValue("act_vol");
|
||||
customPlayerData->ActionSlideVol = config.GetIntegerValue("act_slide_vol");
|
||||
customPlayerData->UsePVSFXEquip = config.GetBooleanValue("use_pv_sfx_equip");
|
||||
customPlayerData->UsePVSkinEquip = config.GetBooleanValue("use_pv_skin_equip");
|
||||
customPlayerData->UsePVEquip = config.GetBooleanValue("use_pv_module_equip");
|
||||
customPlayerData->ShowExcellentClearBorder = config.GetBooleanValue("border_excellent");
|
||||
customPlayerData->ShowGreatClearBorder = config.GetBooleanValue("border_great");
|
||||
customPlayerData->ShowRivalClearBorder = config.GetBooleanValue("border_rival");
|
||||
@@ -274,15 +275,22 @@ namespace TLAC::Components
|
||||
* target = value;
|
||||
};
|
||||
|
||||
// only need to run this line once on startup, otherwise cannot increase/decrease in-game
|
||||
// only need to run this line once on startup, otherwise cannot increase/decrease in-game (or use per-song settings!)
|
||||
setIfNotEqual(&playerData->vocaloid_point, customPlayerData->VocaloidPoints, 0);
|
||||
// run once to check if module setting is invalid
|
||||
setIfNotEqual(&playerData->skin_equip_cmn, customPlayerData->SkinEquip, 0);
|
||||
setIfNotEqual(&playerData->module_equip_cmn0, customPlayerData->ModuleEquipCmn0, 0);
|
||||
setIfNotEqual(&playerData->module_equip_cmn1, customPlayerData->ModuleEquipCmn1, 0);
|
||||
setIfNotEqual(&playerData->module_equip_cmn2, customPlayerData->ModuleEquipCmn2, 0);
|
||||
setIfNotEqual(&playerData->module_equip_cmn3, customPlayerData->ModuleEquipCmn3, 0);
|
||||
setIfNotEqual(&playerData->module_equip_cmn4, customPlayerData->ModuleEquipCmn4, 0);
|
||||
setIfNotEqual(&playerData->module_equip_cmn5, customPlayerData->ModuleEquipCmn5, 0);
|
||||
setIfNotEqual(&playerData->act_vol, customPlayerData->ActionVol, 100);
|
||||
setIfNotEqual(&playerData->act_slide_vol, customPlayerData->ActionSlideVol, 100);
|
||||
setIfNotEqual(&playerData->btn_se_equip, customPlayerData->BtnSeEquip, -1);
|
||||
setIfNotEqual(&playerData->slide_se_equip, customPlayerData->SlideSeEquip, -1);
|
||||
setIfNotEqual(&playerData->chainslide_se_equip, customPlayerData->ChainslideSeEquip, -1);
|
||||
setIfNotEqual(&playerData->slidertouch_se_equip, customPlayerData->SlidertouchSeEquip, -1);
|
||||
setIfNotEqual(&playerData->act_toggle, customPlayerData->ActionSE, 1);
|
||||
|
||||
std::string* mylistString;
|
||||
std::vector<std::string> mylistStringVec;
|
||||
@@ -434,22 +442,40 @@ namespace TLAC::Components
|
||||
swprintf(val, 32, L"%d", playerData->module_equip_cmn5);
|
||||
WritePrivateProfileStringW(L"playerdata", L"module_equip_cmn5", val, configPath);
|
||||
}
|
||||
if (customPlayerData->ActionVol != playerData->act_vol)
|
||||
{
|
||||
customPlayerData->ActionVol = playerData->act_vol;
|
||||
WCHAR val[32];
|
||||
swprintf(val, 32, L"%d", playerData->act_vol);
|
||||
WritePrivateProfileStringW(L"playerdata", L"act_vol", val, configPath);
|
||||
}
|
||||
if (customPlayerData->ActionSlideVol != playerData->act_slide_vol)
|
||||
{
|
||||
customPlayerData->ActionSlideVol = playerData->act_slide_vol;
|
||||
WCHAR val[32];
|
||||
swprintf(val, 32, L"%d", playerData->act_slide_vol);
|
||||
WritePrivateProfileStringW(L"playerdata", L"act_slide_vol", val, configPath);
|
||||
}
|
||||
if (customPlayerData->UsePVEquip != playerData->use_pv_module_equip)
|
||||
{
|
||||
playerData->use_pv_module_equip = 1;
|
||||
}
|
||||
if (customPlayerData->UsePVSFXEquip != playerData->use_pv_btn_se_equip)
|
||||
{
|
||||
playerData->use_pv_btn_se_equip = 1;
|
||||
playerData->use_pv_chainslide_se_equip = 1;
|
||||
playerData->use_pv_slidertouch_se_equip = 1;
|
||||
playerData->use_pv_slide_se_equip = 1;
|
||||
}
|
||||
if (customPlayerData->UsePVSkinEquip != playerData->use_pv_skin_equip)
|
||||
{
|
||||
playerData->use_pv_skin_equip = 1;
|
||||
}
|
||||
|
||||
|
||||
setIfNotEqual(&playerData->level, customPlayerData->LevelNum, 1);
|
||||
setIfNotEqual(&playerData->level_plate_id, customPlayerData->LevelPlateId, 0);
|
||||
setIfNotEqual(&playerData->level_plate_effect, customPlayerData->LevelPlateEffect, 0);
|
||||
setIfNotEqual(&playerData->skin_equip, customPlayerData->SkinEquip, 0);
|
||||
setIfNotEqual(&playerData->btn_se_equip, customPlayerData->BtnSeEquip, -1);
|
||||
setIfNotEqual(&playerData->slide_se_equip, customPlayerData->SlideSeEquip, -1);
|
||||
setIfNotEqual(&playerData->chainslide_se_equip, customPlayerData->ChainslideSeEquip, -1);
|
||||
setIfNotEqual(&playerData->slidertouch_se_equip, customPlayerData->SlidertouchSeEquip, -1);
|
||||
setIfNotEqual(&playerData->act_toggle, customPlayerData->ActionSE, 1);
|
||||
//setIfNotEqual(&playerData->module_equip0, customPlayerData->ModuleEquip0, 0); Do NOT recommend using this
|
||||
//setIfNotEqual(&playerData->module_equip1, customPlayerData->ModuleEquip1, 0);
|
||||
//setIfNotEqual(&playerData->module_equip2, customPlayerData->ModuleEquip2, 0);
|
||||
//setIfNotEqual(&playerData->module_equip3, customPlayerData->ModuleEquip3, 0);
|
||||
//setIfNotEqual(&playerData->module_equip4, customPlayerData->ModuleEquip4, 0);
|
||||
//setIfNotEqual(&playerData->module_equip5, customPlayerData->ModuleEquip5, 0);
|
||||
|
||||
// Display clear borders on the progress bar
|
||||
playerData->clear_border = (customPlayerData->ShowRivalClearBorder << 2) | (customPlayerData->ShowExcellentClearBorder << 1) | (customPlayerData->ShowGreatClearBorder);
|
||||
|
||||
@@ -13,12 +13,22 @@ namespace TLAC::Components
|
||||
{
|
||||
WCHAR ScoreSaver::configPath[256];
|
||||
WCHAR ScoreSaver::rival_configPath[256];
|
||||
WCHAR ScoreSaver::modules_configPath[256];
|
||||
WCHAR ScoreSaver::skins_configPath[256];
|
||||
WCHAR ScoreSaver::sfx_configPath[256];
|
||||
ScoreSaver::ScoreSaver()
|
||||
{
|
||||
std::string utf8path = TLAC::framework::GetModuleDirectory() + "/scores.ini";
|
||||
MultiByteToWideChar(CP_UTF8, 0, utf8path.c_str(), -1, configPath, 256);
|
||||
utf8path = TLAC::framework::GetModuleDirectory() + "/rivalscores.ini";
|
||||
MultiByteToWideChar(CP_UTF8, 0, utf8path.c_str(), -1, rival_configPath, 256);
|
||||
utf8path = TLAC::framework::GetModuleDirectory() + "/pv_equip/modules.ini";
|
||||
MultiByteToWideChar(CP_UTF8, 0, utf8path.c_str(), -1, modules_configPath, 256);
|
||||
utf8path = TLAC::framework::GetModuleDirectory() + "/pv_equip/skins.ini";
|
||||
MultiByteToWideChar(CP_UTF8, 0, utf8path.c_str(), -1, skins_configPath, 256);
|
||||
utf8path = TLAC::framework::GetModuleDirectory() + "/pv_equip/sfx.ini";
|
||||
MultiByteToWideChar(CP_UTF8, 0, utf8path.c_str(), -1, sfx_configPath, 256);
|
||||
|
||||
}
|
||||
|
||||
ScoreSaver::~ScoreSaver()
|
||||
@@ -354,12 +364,16 @@ namespace TLAC::Components
|
||||
// update score begin and end vars from game
|
||||
FixScoreCacheAddresses(diff);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
UpdateSingleScoreCacheModulesEntry;
|
||||
}
|
||||
currentPv = pvNum;
|
||||
currentDifficulty = diff;
|
||||
currentDifficultyIsEx = diffIsEx;
|
||||
currentInsurance = insurance;
|
||||
}
|
||||
ModuleCheck(pvNum, diff, diffIsEx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -541,6 +555,189 @@ namespace TLAC::Components
|
||||
}
|
||||
}
|
||||
|
||||
void ScoreSaver::UpdateSingleScoreCacheModulesEntry(int pvNum, int diff, int exDiff)
|
||||
{
|
||||
if (pvNum < 0 || diff < 0 || exDiff < 0 || pvNum > 999 || diff > 3 || exDiff > 1)
|
||||
return;
|
||||
|
||||
|
||||
WCHAR keyBase[32]; // needs to be big enough to store pv.999
|
||||
WCHAR key[32]; // needs to be big enough to store pv.999.module5
|
||||
|
||||
const WCHAR section[] = L"modules";
|
||||
swprintf(keyBase, 32, L"pv.%03d", pvNum);
|
||||
swprintf(key, 32, L"%ls.skin", keyBase);
|
||||
int INISkin = GetPrivateProfileIntW(section, key, 0, skins_configPath);
|
||||
if (INISkin > 0)
|
||||
{
|
||||
DivaScore* cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
if (cachedScore == nullptr)
|
||||
{
|
||||
ScoreCache[diff].push_back(DivaScore(pvNum, exDiff));
|
||||
cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
}
|
||||
if (cachedScore != nullptr)
|
||||
{
|
||||
cachedScore->per_skin_equip = INISkin;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; ++i)
|
||||
{
|
||||
swprintf(key, 32, L"%ls.module%d", keyBase, i);
|
||||
int INImodule = GetPrivateProfileIntW(section, key, 0, modules_configPath);
|
||||
|
||||
if (INImodule > 0)
|
||||
{
|
||||
DivaScore* cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
if (cachedScore == nullptr)
|
||||
{
|
||||
ScoreCache[diff].push_back(DivaScore(pvNum, exDiff));
|
||||
cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
}
|
||||
if (cachedScore != nullptr)
|
||||
{
|
||||
cachedScore->per_module_equip[i] = INImodule;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ScoreSaver::ModuleCheck(int pvNum, int diff, int exDiff)
|
||||
{
|
||||
if (pvNum < 0 || diff < 0 || exDiff < 0 || pvNum > 999 || diff > 3 || exDiff > 1)
|
||||
return;
|
||||
|
||||
WCHAR keyBase[32]; // needs to be big enough to store pv.999
|
||||
WCHAR key[32]; // needs to be big enough to store pv.999.module5
|
||||
const WCHAR section[] = L"modules";
|
||||
swprintf(keyBase, 32, L"pv.%03d", pvNum);
|
||||
DivaScore* cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
for (int i = 0; i < 6; ++i)
|
||||
{
|
||||
swprintf(key, 32, L"%ls.module%d", keyBase, i);
|
||||
int INImodule = GetPrivateProfileIntW(section, key, 0, modules_configPath);
|
||||
if (INImodule != cachedScore->per_module_equip[0] || INImodule != cachedScore->per_module_equip[1] || INImodule != cachedScore->per_module_equip[2] || INImodule != cachedScore->per_module_equip[3] || INImodule != cachedScore->per_module_equip[4] || INImodule != cachedScore->per_module_equip[5])
|
||||
{
|
||||
INImodule = *cachedScore->per_module_equip;
|
||||
WCHAR val[32];
|
||||
swprintf(val, 32, L"%d", cachedScore->per_module_equip[i]);
|
||||
WritePrivateProfileStringW(L"modules", key, val, modules_configPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ScoreSaver::UpdateSingleScoreCacheSkinsEntry(int pvNum, int diff, int exDiff)
|
||||
{
|
||||
if (pvNum < 0 || diff < 0 || exDiff < 0 || pvNum > 999 || diff > 3 || exDiff > 1)
|
||||
return;
|
||||
|
||||
|
||||
WCHAR keyBase[32]; // needs to be big enough to store pv.999
|
||||
WCHAR key[32]; // needs to be big enough to store pv.999.module5
|
||||
|
||||
const WCHAR section[] = L"skins";
|
||||
swprintf(keyBase, 32, L"pv.%03d", pvNum);
|
||||
swprintf(key, 32, L"%ls.skin", keyBase);
|
||||
int INISkin = GetPrivateProfileIntW(section, key, 0, skins_configPath);
|
||||
if (INISkin > 0)
|
||||
{
|
||||
DivaScore* cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
if (cachedScore == nullptr)
|
||||
{
|
||||
ScoreCache[diff].push_back(DivaScore(pvNum, exDiff));
|
||||
cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
}
|
||||
if (cachedScore != nullptr)
|
||||
{
|
||||
cachedScore->per_skin_equip = INISkin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScoreSaver::UpdateSingleScoreCacheSFXEntry(int pvNum, int diff, int exDiff)
|
||||
{
|
||||
if (pvNum < 0 || diff < 0 || exDiff < 0 || pvNum > 999 || diff > 3 || exDiff > 1)
|
||||
return;
|
||||
|
||||
|
||||
WCHAR keyBase[32]; // needs to be big enough to store pv.999
|
||||
WCHAR key[32]; // needs to be big enough to store pv.999.module5
|
||||
|
||||
const WCHAR section[] = L"SFX";
|
||||
swprintf(keyBase, 32, L"pv.%03d", pvNum);
|
||||
swprintf(key, 32, L"%ls.btn", keyBase);
|
||||
int INIBtn = GetPrivateProfileIntW(section, key, 0, sfx_configPath);
|
||||
if (INIBtn > 0)
|
||||
{
|
||||
DivaScore* cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
if (cachedScore == nullptr)
|
||||
{
|
||||
ScoreCache[diff].push_back(DivaScore(pvNum, exDiff));
|
||||
cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
}
|
||||
if (cachedScore != nullptr)
|
||||
{
|
||||
cachedScore->per_btn_se_equip = INIBtn;
|
||||
}
|
||||
}
|
||||
swprintf(keyBase, 32, L"pv.%03d", pvNum);
|
||||
swprintf(key, 32, L"%ls.chain", keyBase);
|
||||
int INIChain = GetPrivateProfileIntW(section, key, 0, sfx_configPath);
|
||||
if (INIChain > 0)
|
||||
{
|
||||
DivaScore* cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
if (cachedScore == nullptr)
|
||||
{
|
||||
ScoreCache[diff].push_back(DivaScore(pvNum, exDiff));
|
||||
cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
}
|
||||
if (cachedScore != nullptr)
|
||||
{
|
||||
cachedScore->per_chainslide_se_equip = INIChain;
|
||||
}
|
||||
}
|
||||
swprintf(keyBase, 32, L"pv.%03d", pvNum);
|
||||
swprintf(key, 32, L"%ls.slide", keyBase);
|
||||
int INISlide = GetPrivateProfileIntW(section, key, 0, sfx_configPath);
|
||||
if (INISlide > 0)
|
||||
{
|
||||
DivaScore* cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
if (cachedScore == nullptr)
|
||||
{
|
||||
ScoreCache[diff].push_back(DivaScore(pvNum, exDiff));
|
||||
cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
}
|
||||
if (cachedScore != nullptr)
|
||||
{
|
||||
cachedScore->per_slide_se_equip = INISlide;
|
||||
}
|
||||
}
|
||||
swprintf(keyBase, 32, L"pv.%03d", pvNum);
|
||||
swprintf(key, 32, L"%ls.touch", keyBase);
|
||||
int INITouch = GetPrivateProfileIntW(section, key, 0, sfx_configPath);
|
||||
if (INITouch > 0)
|
||||
{
|
||||
DivaScore* cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
if (cachedScore == nullptr)
|
||||
{
|
||||
ScoreCache[diff].push_back(DivaScore(pvNum, exDiff));
|
||||
cachedScore = GetCachedScore(pvNum, diff, exDiff);
|
||||
}
|
||||
if (cachedScore != nullptr)
|
||||
{
|
||||
cachedScore->per_slidertouch_se_equip = INITouch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScoreSaver::FixScoreCacheAddresses(int diff)
|
||||
{
|
||||
// update score begin and end vars from game
|
||||
@@ -558,6 +755,9 @@ namespace TLAC::Components
|
||||
{
|
||||
UpdateSingleScoreCacheEntry(pvNum, diff, exDiff, false);
|
||||
UpdateSingleScoreCacheRivalEntry(pvNum, diff, exDiff);
|
||||
UpdateSingleScoreCacheModulesEntry(pvNum, diff, exDiff);
|
||||
UpdateSingleScoreCacheSkinsEntry(pvNum, diff, exDiff);
|
||||
UpdateSingleScoreCacheSFXEntry(pvNum, diff, exDiff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,13 @@ namespace TLAC::Components
|
||||
{
|
||||
int pvNum;
|
||||
int exDifficulty;
|
||||
byte padding08[0xa4]; // ??? -- seems to be 6*6 ints (0x90 bytes) for modules + 5 ints (0x14 bytes) for skin and button se
|
||||
int per_module_equip[6];
|
||||
int other_module_shit[30]; // ??? -- seems to be 6*6 ints (0x90 bytes) for modules + 5 ints (0x14 bytes) for skin and button se
|
||||
int per_skin_equip;
|
||||
int per_btn_se_equip;
|
||||
int per_slide_se_equip;
|
||||
int per_chainslide_se_equip;
|
||||
int per_slidertouch_se_equip;
|
||||
int clearRank; // +0xac: clear rank
|
||||
int score; // +0xb0: score
|
||||
int percent; // +0xb4: best percent
|
||||
@@ -104,9 +110,13 @@ namespace TLAC::Components
|
||||
static void UpdateScoreCache();
|
||||
static void UpdateSingleScoreCacheEntry(int pvNum, int diff, int exDiff, bool doDefaultsReset);
|
||||
static void UpdateSingleScoreCacheRivalEntry(int pvNum, int diff, int exDiff);
|
||||
static void UpdateSingleScoreCacheModulesEntry(int pvNum, int diff, int exDiff);
|
||||
static void UpdateSingleScoreCacheSkinsEntry(int pvNum, int diff, int exDiff);
|
||||
static void UpdateSingleScoreCacheSFXEntry(int pvNum, int diff, int exDiff);
|
||||
static void FixScoreCacheAddresses(int diff); // only call this from the main thread
|
||||
static DivaScore* GetCachedScore(int pvNum, int diff, int exDiff);
|
||||
static void UpdateClearCounts();
|
||||
static void ModuleCheck(int pvNum, int diff, int exDiff);
|
||||
|
||||
private:
|
||||
static bool(__stdcall* divaInitResults)(void* cls);
|
||||
@@ -118,6 +128,9 @@ namespace TLAC::Components
|
||||
|
||||
static WCHAR configPath[256];
|
||||
static WCHAR rival_configPath[256];
|
||||
static WCHAR modules_configPath[256];
|
||||
static WCHAR skins_configPath[256];
|
||||
static WCHAR sfx_configPath[256];
|
||||
static std::thread initThread;
|
||||
|
||||
int currentPv;
|
||||
|
||||
Reference in New Issue
Block a user