Add one-time spawn camera pan

This commit is contained in:
Kelsi 2026-02-05 18:06:52 -08:00
parent 8bd60c3320
commit 5401683a8d
5 changed files with 81 additions and 7 deletions

View file

@ -204,9 +204,12 @@ struct SinglePlayerSqlite {
" music_volume INTEGER,"
" sfx_volume INTEGER,"
" mouse_sensitivity REAL,"
" invert_mouse INTEGER"
" invert_mouse INTEGER,"
" intro_seen INTEGER"
");";
return exec(kSchema);
bool ok = exec(kSchema);
exec("ALTER TABLE character_settings ADD COLUMN intro_seen INTEGER DEFAULT 0;");
return ok;
}
};
@ -1636,7 +1639,7 @@ bool GameHandler::loadSinglePlayerCharacterState(uint64_t guid) {
spLastDirtyOrientation_ = movementInfo.orientation;
const char* sqlSettings =
"SELECT fullscreen, vsync, shadows, res_w, res_h, music_volume, sfx_volume, mouse_sensitivity, invert_mouse "
"SELECT fullscreen, vsync, shadows, res_w, res_h, music_volume, sfx_volume, mouse_sensitivity, invert_mouse, intro_seen "
"FROM character_settings WHERE guid=?;";
if (sqlite3_prepare_v2(sp.db, sqlSettings, -1, &stmt, nullptr) == SQLITE_OK) {
sqlite3_bind_int64(stmt, 1, static_cast<sqlite3_int64>(guid));
@ -1650,6 +1653,7 @@ bool GameHandler::loadSinglePlayerCharacterState(uint64_t guid) {
spSettings_.sfxVolume = sqlite3_column_int(stmt, 6);
spSettings_.mouseSensitivity = static_cast<float>(sqlite3_column_double(stmt, 7));
spSettings_.invertMouse = sqlite3_column_int(stmt, 8) != 0;
spSettings_.introSeen = sqlite3_column_int(stmt, 9) != 0;
spSettingsLoaded_ = true;
}
sqlite3_finalize(stmt);
@ -1810,13 +1814,13 @@ void GameHandler::saveSinglePlayerCharacterState(bool force) {
if (spSettingsLoaded_ && (force || (spDirtyFlags_ & SP_DIRTY_SETTINGS))) {
const char* upsertSettings =
"INSERT INTO character_settings "
"(guid, fullscreen, vsync, shadows, res_w, res_h, music_volume, sfx_volume, mouse_sensitivity, invert_mouse) "
"VALUES (?,?,?,?,?,?,?,?,?,?) "
"(guid, fullscreen, vsync, shadows, res_w, res_h, music_volume, sfx_volume, mouse_sensitivity, invert_mouse, intro_seen) "
"VALUES (?,?,?,?,?,?,?,?,?,?,?) "
"ON CONFLICT(guid) DO UPDATE SET "
"fullscreen=excluded.fullscreen, vsync=excluded.vsync, shadows=excluded.shadows, "
"res_w=excluded.res_w, res_h=excluded.res_h, music_volume=excluded.music_volume, "
"sfx_volume=excluded.sfx_volume, mouse_sensitivity=excluded.mouse_sensitivity, "
"invert_mouse=excluded.invert_mouse;";
"invert_mouse=excluded.invert_mouse, intro_seen=excluded.intro_seen;";
if (sqlite3_prepare_v2(sp.db, upsertSettings, -1, &stmt, nullptr) == SQLITE_OK) {
sqlite3_bind_int64(stmt, 1, static_cast<sqlite3_int64>(activeCharacterGuid_));
sqlite3_bind_int(stmt, 2, spSettings_.fullscreen ? 1 : 0);
@ -1828,6 +1832,7 @@ void GameHandler::saveSinglePlayerCharacterState(bool force) {
sqlite3_bind_int(stmt, 8, spSettings_.sfxVolume);
sqlite3_bind_double(stmt, 9, spSettings_.mouseSensitivity);
sqlite3_bind_int(stmt, 10, spSettings_.invertMouse ? 1 : 0);
sqlite3_bind_int(stmt, 11, spSettings_.introSeen ? 1 : 0);
sqlite3_step(stmt);
sqlite3_finalize(stmt);
}