Merge pull request #34 from elizagamedev/gir/locAndDebug

Loc changes and debug items:
This commit is contained in:
Eliza 2022-02-05 19:27:40 -08:00 committed by GitHub
commit c9ffa05df7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 83 additions and 46 deletions

View file

@ -115,7 +115,7 @@
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -143,7 +143,7 @@
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>

View file

@ -161,13 +161,13 @@ DWORD WINAPI ipc_thread(LPVOID lpParam)
void init_check_save(WCHAR* save_path) {
FILE* savefile = _wfopen(save_path, L"rb");
char imgfile[16] = {0};
char langbuf[9] = {0};
char langbuf[17] = {0};
char* openbrace = 0;
char* closebrace = 0;
if (savefile) {
strcpy(imgfile, "save");
fseek(savefile, -8, SEEK_END);
fread(langbuf, 1, 8, savefile);
fseek(savefile, -16, SEEK_END);
fread(langbuf, 1, 16, savefile);
fclose(savefile);
openbrace = strchr(langbuf, '[');

View file

@ -42,23 +42,18 @@ module Wallpaper
end
Graphics.update
end
if (name == 'save_w32')
case $persistent.langcode
when 'fr'
name = $persistent.langcode + "/" + name
when 'pt_BR'
name = $persistent.langcode + "/" + name
when 'es'
name = $persistent.langcode + "/" + name
when 'ja'
name = $persistent.langcode + "/" + name
when 'ko'
name = $persistent.langcode + "/" + name
when 'zh_CN'
name = $persistent.langcode + "/" + name
end
locWallpaper = $persistent.langcode + "/" + name
if (name == 'save_w32')
locWallpaperFullPath = "Wallpaper/" + locWallpaper + ".bmp"
else
locWallpaperFullPath = "Wallpaper/" + locWallpaper + ".png"
end
if File.exists?(locWallpaperFullPath)
name = locWallpaper
end
$game_oneshot.wallpaper = name
$game_oneshot.wallpaper_color = color
Wallpaper.set(name, color)

View file

@ -21,12 +21,13 @@ class Scene_File
@help_window.set_text(@help_text)
# Make save file window
@savefile_windows = []
for i in 0..3
for i in 0..99
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
end
# Select last file to be operated
@file_index = $game_temp.last_file_index
@savefile_windows[@file_index].selected = true
updateVisibleSavefileWindows
# Execute transition
Graphics.transition
# Main loop
@ -76,13 +77,17 @@ class Scene_File
if Input.repeat?(Input::DOWN)
# If the down directional button pressed down is not a repeat,
# or cursor position is more in front than 3
if Input.trigger?(Input::DOWN) or @file_index < 3
if Input.trigger?(Input::DOWN) or @file_index < 99
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Move cursor down
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 1) % 4
@file_index = (@file_index + 1)
if @file_index > 99
@file_index = 0
end
@savefile_windows[@file_index].selected = true
updateVisibleSavefileWindows
return
end
end
@ -95,8 +100,12 @@ class Scene_File
$game_system.se_play($data_system.cursor_se)
# Move cursor up
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 3) % 4
@file_index = (@file_index - 1)
if @file_index < 0
@file_index = 99
end
@savefile_windows[@file_index].selected = true
updateVisibleSavefileWindows
return
end
end
@ -108,4 +117,15 @@ class Scene_File
def make_filename(file_index)
return "Save#{file_index + 1}.rxdata"
end
def updateVisibleSavefileWindows
for i in 0..99
@savefile_windows[i].visible = false
end
screen_start_index = @file_index - (@file_index % 4)
for i in screen_start_index..(screen_start_index + 3)
@savefile_windows[i].visible = true
end
end
end

View file

@ -14,7 +14,7 @@ class Scene_Load < Scene_File
# Timestamp selects new file
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
for i in 0..99
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
@ -58,7 +58,7 @@ class Scene_Load < Scene_File
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to title screen
$scene = Scene_Title.new
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Read Save Data
@ -101,6 +101,16 @@ class Scene_Load < Scene_File
f.moveto($game_player.x, $game_player.y)
f_prev = f
end
# check for debug file to add debug items
if File.exists?("debug_tester.dat")
# debug save
$game_party.gain_item(54, 1)
# plight skip
$game_party.gain_item(82, 1)
end
load_perma_flags
end
end

View file

@ -279,7 +279,7 @@ class Scene_Map
end
end
# If debug mode is ON and F5 key was pressed
if $debug and Input.press?(Input::F5)
if $debug and Input.press?(Input::F5) and
# Set transferring player flag
$game_temp.player_transferring = true
# Set player move destination
@ -288,23 +288,23 @@ class Scene_Map
$game_temp.player_new_y = $data_system.start_y
end
# debug && F6
if $debug and Input.press?(Input::F6) and $lastpress != 6
$lastpress = 6
Chroma.playAnim("chroma/blank_keyboard.chroma", false);
end
if $debug and Input.press?(Input::F7) and $lastpress != 7
$lastpress = 7
Chroma.playAnim("chroma/Fire_Keyboard.chroma", true);
end
if $debug and Input.press?(Input::F9) and $lastpress != 9
$lastpress = 9
Chroma.playAnim("chroma/Random_Keyboard.chroma", false);
end
#if $debug and Input.press?(Input::F6) and $lastpress != 6
# $lastpress = 6
# Chroma.playAnim("chroma/blank_keyboard.chroma", false);
#end
#if $debug and Input.press?(Input::F7) and $lastpress != 7
# $lastpress = 7
# Chroma.playAnim("chroma/Fire_Keyboard.chroma", true);
#end
#if $debug and Input.press?(Input::F9) and $lastpress != 9
# $lastpress = 9
# Chroma.playAnim("chroma/Random_Keyboard.chroma", false);
#end
# If debug mode is ON and F9 key was pressed
# if $debug and Input.press?(Input::F9)
# # Set debug calling flag
# $game_temp.debug_calling = true
# end
if Input.press?(Input::F9) && File.exists?("debug_tester.dat")
# Set debug calling flag
$game_temp.debug_calling = true
end
# If player is not moving
unless $game_player.moving?
# Run calling of each screen

View file

@ -54,6 +54,14 @@ class Scene_Title
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
end
# check for debug file to add debug items
if File.exists?("debug_tester.dat")
# debug save
$game_party.gain_item(54, 1)
# plight skip
$game_party.gain_item(82, 1)
end
@sprite.zoom_x = 2.0
@sprite.zoom_y = 2.0
# Create/render menu options

View file

@ -71,12 +71,16 @@ module Script
end
def self.skip_bruteforce
$game_oneshot.bruteforce_start -= 62800*2*60
$game_oneshot.bruteforce_start -= 63014*2*60
end
def self.lose_all_items
for i in 1..99
$game_party.lose_item(i, 99)
#skip debug testing items
if i == 54 or i == 81 or i == 82
next
end
$game_party.lose_item(i, 99)
end
end