Merge remote-tracking branch 'mathewv/master'
This commit is contained in:
commit
c7faab99f6
|
|
@ -63,7 +63,7 @@ win32 {
|
||||||
w32/niko.c \
|
w32/niko.c \
|
||||||
w32/journal.c
|
w32/journal.c
|
||||||
|
|
||||||
LIBS += -lgdi32 -lshlwapi
|
LIBS += -lgdi32 -lshell32 -luuid -lole32
|
||||||
|
|
||||||
RC_FILE = w32/resources.rc
|
RC_FILE = w32/resources.rc
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
|
#define WINVER 0x0600
|
||||||
|
#define _WIN32_WINNT 0x0600
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlwapi.h>
|
#include <stdio.h>
|
||||||
|
#include <objbase.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
|
||||||
#define DEFAULT_WIDTH 800
|
#define DEFAULT_WIDTH 800
|
||||||
|
|
@ -67,7 +70,6 @@ LRESULT CALLBACK journal_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IPC thread
|
// IPC thread
|
||||||
#include <stdio.h>
|
|
||||||
DWORD WINAPI ipc_thread(LPVOID lpParam)
|
DWORD WINAPI ipc_thread(LPVOID lpParam)
|
||||||
{
|
{
|
||||||
(void)lpParam;
|
(void)lpParam;
|
||||||
|
|
@ -110,20 +112,53 @@ DWORD WINAPI ipc_thread(LPVOID lpParam)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if the file "My Documents/My Games/Oneshot/save_progress.oneshot" exist
|
||||||
|
// if not, load the "default" image background
|
||||||
|
// if it does exist, try to read the last 8.. or so.. bytes from the file.
|
||||||
|
// this (should) contain a string like [XX_XX] or [XX] indicating the user's
|
||||||
|
// language code. This will be apended with an underscore to "save"
|
||||||
|
// to give the localized image file IFF the lang str exists
|
||||||
|
void init_check_save(WCHAR* save_path) {
|
||||||
|
FILE* savefile = _wfopen(save_path, L"rb");
|
||||||
|
char imgfile[16] = {0};
|
||||||
|
char langbuf[9] = {0};
|
||||||
|
char* openbrace = 0;
|
||||||
|
char* closebrace = 0;
|
||||||
|
if (savefile) {
|
||||||
|
strcpy(imgfile, "save");
|
||||||
|
fseek(savefile, -8, SEEK_END);
|
||||||
|
fread(langbuf, 1, 8, savefile);
|
||||||
|
fclose(savefile);
|
||||||
|
|
||||||
|
openbrace = strchr(langbuf, '[');
|
||||||
|
closebrace = strchr(langbuf, ']');
|
||||||
|
if (openbrace && closebrace && openbrace < closebrace) {
|
||||||
|
//we very probably have a language code here.
|
||||||
|
//so, lets do some hacky string manipulation to
|
||||||
|
//name our image file
|
||||||
|
imgfile[4] = '_';
|
||||||
|
strncpy(imgfile+5, openbrace+1, closebrace-(openbrace+1));
|
||||||
|
}
|
||||||
|
|
||||||
|
loadImage(imgfile);
|
||||||
|
} else {
|
||||||
|
loadImage("default");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int do_journal()
|
int do_journal()
|
||||||
{
|
{
|
||||||
// Create
|
// Create
|
||||||
HINSTANCE module = GetModuleHandleW(NULL);
|
HINSTANCE module = GetModuleHandleW(NULL);
|
||||||
|
|
||||||
// Default image
|
// Default image
|
||||||
WCHAR save_path[MAX_PATH];
|
WCHAR save_path[MAX_PATH];
|
||||||
SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, 0, save_path);
|
PWSTR folder_path = NULL;
|
||||||
|
SHGetKnownFolderPath((REFKNOWNFOLDERID)&FOLDERID_Documents, 0, NULL, &folder_path);
|
||||||
|
wcscpy(save_path, folder_path);
|
||||||
wcscat(save_path, L"\\My Games\\Oneshot\\save_progress.oneshot");
|
wcscat(save_path, L"\\My Games\\Oneshot\\save_progress.oneshot");
|
||||||
if (PathFileExistsW(save_path)) {
|
CoTaskMemFree(folder_path);
|
||||||
loadImage("save");
|
init_check_save(save_path);
|
||||||
} else {
|
|
||||||
loadImage("default");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initial image
|
// Initial image
|
||||||
char message[IN_BUFFER_SIZE];
|
char message[IN_BUFFER_SIZE];
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,26 @@ class Doc_Message
|
||||||
def initialize
|
def initialize
|
||||||
@viewport = Viewport.new(0, 0, 640, 480)
|
@viewport = Viewport.new(0, 0, 640, 480)
|
||||||
@sprite_bg = Sprite.new(@viewport)
|
@sprite_bg = Sprite.new(@viewport)
|
||||||
if $game_switches[124] == true
|
@sprite_scroll_up = Sprite.new(@viewport)
|
||||||
@sprite_bg.bitmap = RPG::Cache.picture('lined_paper_red')
|
@sprite_scroll_down = Sprite.new(@viewport)
|
||||||
else
|
if $game_switches[124] == true
|
||||||
|
@sprite_bg.bitmap = RPG::Cache.picture('lined_paper_red')
|
||||||
|
@sprite_scroll_up.bitmap = RPG::Cache.picture('scroll_up_red')
|
||||||
|
@sprite_scroll_down.bitmap = RPG::Cache.picture('scroll_down_red')
|
||||||
|
else
|
||||||
@sprite_bg.bitmap = RPG::Cache.picture('lined_paper_blue') #Bitmap.new(640, 480)
|
@sprite_bg.bitmap = RPG::Cache.picture('lined_paper_blue') #Bitmap.new(640, 480)
|
||||||
end
|
@sprite_scroll_up.bitmap = RPG::Cache.picture('scroll_up_blue')
|
||||||
|
@sprite_scroll_down.bitmap = RPG::Cache.picture('scroll_down_blue')
|
||||||
|
end
|
||||||
@sprite_bg.zoom_x = @sprite_bg.zoom_y = 2
|
@sprite_bg.zoom_x = @sprite_bg.zoom_y = 2
|
||||||
@sprite_bg.x = 120
|
@sprite_bg.x = 120
|
||||||
@sprite_bg.y = 24
|
@sprite_bg.y = 24
|
||||||
|
@sprite_scroll_up.zoom_x = @sprite_scroll_up.zoom_y = 2
|
||||||
|
@sprite_scroll_up.x = 524
|
||||||
|
@sprite_scroll_up.y = 24
|
||||||
|
@sprite_scroll_down.zoom_x = @sprite_scroll_down.zoom_y = 2
|
||||||
|
@sprite_scroll_down.x = 524
|
||||||
|
@sprite_scroll_down.y = 424
|
||||||
#@sprite_bg.bitmap.fill_rect(0, 0, 640, 480, Color.new(0, 0, 0, 128))
|
#@sprite_bg.bitmap.fill_rect(0, 0, 640, 480, Color.new(0, 0, 0, 128))
|
||||||
@sprite_text = Sprite.new(@viewport)
|
@sprite_text = Sprite.new(@viewport)
|
||||||
@contents = Bitmap.new(200, 216)
|
@contents = Bitmap.new(200, 216)
|
||||||
|
|
@ -33,6 +45,11 @@ class Doc_Message
|
||||||
|
|
||||||
@sprite_bg.opacity = 0
|
@sprite_bg.opacity = 0
|
||||||
@sprite_text.opacity = 0
|
@sprite_text.opacity = 0
|
||||||
|
@sprite_scroll_down.opacity = 0
|
||||||
|
@sprite_scroll_up.opacity = 0
|
||||||
|
|
||||||
|
@y_offset = 0
|
||||||
|
@scroll_limit = 0
|
||||||
|
|
||||||
# Animation flags
|
# Animation flags
|
||||||
@fade_in = false
|
@fade_in = false
|
||||||
|
|
@ -59,6 +76,7 @@ class Doc_Message
|
||||||
$game_temp.message_proc = nil
|
$game_temp.message_proc = nil
|
||||||
end
|
end
|
||||||
$game_temp.message_doc_text = nil
|
$game_temp.message_doc_text = nil
|
||||||
|
@y_offset = 0
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Refresh: Load new message text and pre-process it
|
# * Refresh: Load new message text and pre-process it
|
||||||
|
|
@ -68,11 +86,11 @@ class Doc_Message
|
||||||
text = ''
|
text = ''
|
||||||
y = -1
|
y = -1
|
||||||
|
|
||||||
if $game_switches[124] == true
|
if $game_switches[124] == true
|
||||||
@sprite_bg.bitmap = RPG::Cache.picture('lined_paper_red')
|
@sprite_bg.bitmap = RPG::Cache.picture('lined_paper_red')
|
||||||
else
|
else
|
||||||
@sprite_bg.bitmap = RPG::Cache.picture('lined_paper_blue') #Bitmap.new(640, 480)
|
@sprite_bg.bitmap = RPG::Cache.picture('lined_paper_blue') #Bitmap.new(640, 480)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Pre-process text
|
# Pre-process text
|
||||||
text_raw = $game_temp.message_doc_text.to_str
|
text_raw = $game_temp.message_doc_text.to_str
|
||||||
|
|
@ -92,7 +110,8 @@ class Doc_Message
|
||||||
text_raw.gsub!("\\\\", "\\")
|
text_raw.gsub!("\\\\", "\\")
|
||||||
|
|
||||||
# Now split text into lines by measuring text metrics
|
# Now split text into lines by measuring text metrics
|
||||||
x = y = 0
|
x = 0
|
||||||
|
y = 1
|
||||||
maxwidth = @contents.width - HORIZ_MARGIN * 2
|
maxwidth = @contents.width - HORIZ_MARGIN * 2
|
||||||
spacesize = @contents.text_size(' ')
|
spacesize = @contents.text_size(' ')
|
||||||
for i in text_raw.split(/ /)
|
for i in text_raw.split(/ /)
|
||||||
|
|
@ -126,6 +145,11 @@ class Doc_Message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@scroll_limit = 11 - y
|
||||||
|
if @scroll_limit > 0
|
||||||
|
@scroll_limit = 0
|
||||||
|
end
|
||||||
|
|
||||||
# Prepare renderer
|
# Prepare renderer
|
||||||
@contents.clear
|
@contents.clear
|
||||||
@contents.font.color = Color.new(100, 92, 255, 255)
|
@contents.font.color = Color.new(100, 92, 255, 255)
|
||||||
|
|
@ -133,7 +157,7 @@ class Doc_Message
|
||||||
@contents.font.color = Color.new(255, 92, 100, 255)
|
@contents.font.color = Color.new(255, 92, 100, 255)
|
||||||
end
|
end
|
||||||
x = 0
|
x = 0
|
||||||
y = 0
|
y = 1
|
||||||
|
|
||||||
# Get 1 text character in c (loop until unable to get text)
|
# Get 1 text character in c (loop until unable to get text)
|
||||||
while ((c = text.slice!(/./m)) != nil)
|
while ((c = text.slice!(/./m)) != nil)
|
||||||
|
|
@ -155,7 +179,7 @@ class Doc_Message
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
# Draw text
|
# Draw text
|
||||||
@contents.draw_text(HORIZ_MARGIN + x, VERT_MARGIN + (y + 1) * 18 - spacesize.height, 40, 18, c)
|
@contents.draw_text(HORIZ_MARGIN + x, VERT_MARGIN + (y + @y_offset) * 18 - spacesize.height, 40, 18, c)
|
||||||
# Add x to drawn text width
|
# Add x to drawn text width
|
||||||
x += @contents.text_size(c).width
|
x += @contents.text_size(c).width
|
||||||
end
|
end
|
||||||
|
|
@ -176,7 +200,6 @@ class Doc_Message
|
||||||
@viewport.visible = false
|
@viewport.visible = false
|
||||||
$game_temp.message_window_showing = false
|
$game_temp.message_window_showing = false
|
||||||
end
|
end
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Handle fade-in effect
|
# Handle fade-in effect
|
||||||
|
|
@ -189,6 +212,23 @@ class Doc_Message
|
||||||
@fade_in = false
|
@fade_in = false
|
||||||
$game_temp.message_window_showing = true
|
$game_temp.message_window_showing = true
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# set the scroll indicators to the opacity of the bg,
|
||||||
|
# or 0 if they cannot scroll further
|
||||||
|
if @y_offset < 0
|
||||||
|
@sprite_scroll_up.opacity = @sprite_bg.opacity
|
||||||
|
else
|
||||||
|
@sprite_scroll_up.opacity = 0
|
||||||
|
end
|
||||||
|
if @y_offset > @scroll_limit
|
||||||
|
@sprite_scroll_down.opacity = @sprite_bg.opacity
|
||||||
|
else
|
||||||
|
@sprite_scroll_down.opacity = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
# don't perform control actions while fading msg box
|
||||||
|
if @fade_in || @fade_out
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -197,6 +237,14 @@ class Doc_Message
|
||||||
terminate_message
|
terminate_message
|
||||||
@fade_out = true
|
@fade_out = true
|
||||||
end
|
end
|
||||||
|
if Input.trigger?(Input::UP) && @y_offset < 0
|
||||||
|
@y_offset += 1
|
||||||
|
refresh()
|
||||||
|
end
|
||||||
|
if Input.trigger?(Input::DOWN) && @y_offset > @scroll_limit
|
||||||
|
@y_offset -= 1
|
||||||
|
refresh()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Message is over and should be hidden or advanced to next
|
# Message is over and should be hidden or advanced to next
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,11 @@ class Interpreter
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def command_101
|
def command_101
|
||||||
# If other text has been set to message_text
|
# If other text has been set to message_text
|
||||||
if $game_temp.message_text != nil || $game_temp.message_ed_text != nil || $game_temp.message_doc_text != nil || $game_temp.message_desktop_text != nil || $game_temp.message_credits_text != nil
|
if $game_temp.message_text != nil ||
|
||||||
|
$game_temp.message_ed_text != nil ||
|
||||||
|
$game_temp.message_doc_text != nil ||
|
||||||
|
$game_temp.message_desktop_text != nil ||
|
||||||
|
$game_temp.message_credits_text != nil
|
||||||
# End
|
# End
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,16 @@
|
||||||
module RPG
|
module RPG
|
||||||
module Cache
|
module Cache
|
||||||
def self.character(filename, hue)
|
def self.character(filename, hue)
|
||||||
|
filename = filename.downcase
|
||||||
if $game_switches[160] && filename.start_with?("niko")
|
if $game_switches[160] && filename.start_with?("niko")
|
||||||
filename.gsub!(/niko/, "en")
|
filename.gsub!(/niko/, "en")
|
||||||
end
|
end
|
||||||
self.load_bitmap("Graphics/Characters/", filename, hue)
|
self.load_bitmap("Graphics/Characters/", filename, hue)
|
||||||
end
|
end
|
||||||
def self.face(filename)
|
def self.face(filename)
|
||||||
|
#lowercasing facepic name to be more case insensitive
|
||||||
|
#to catch the few instances where we use "Niko" instead of "niko"
|
||||||
|
filename = filename.downcase
|
||||||
if $game_switches[160] && filename.start_with?("niko")
|
if $game_switches[160] && filename.start_with?("niko")
|
||||||
filename.gsub!(/niko/, "en")
|
filename.gsub!(/niko/, "en")
|
||||||
end
|
end
|
||||||
|
|
@ -42,17 +46,3 @@ class Tone
|
||||||
self.red == 0 && self.green == 0 && self.blue == 0 && self.gray == 0
|
self.red == 0 && self.green == 0 && self.blue == 0 && self.gray == 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module Graphics
|
|
||||||
class << self
|
|
||||||
alias_method :update_native, :update
|
|
||||||
def update
|
|
||||||
#if $game_map.map_id == 97
|
|
||||||
# Oneshot.allow_exit false
|
|
||||||
#elsif $game_system.map_interpreter
|
|
||||||
# Oneshot.allow_exit ($scene == nil)
|
|
||||||
#end
|
|
||||||
update_native
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ def fake_save
|
||||||
Marshal.dump($game_oneshot, file)
|
Marshal.dump($game_oneshot, file)
|
||||||
Marshal.dump($game_fasttravel, file)
|
Marshal.dump($game_fasttravel, file)
|
||||||
Marshal.dump($game_temp.footstep_sfx , file)
|
Marshal.dump($game_temp.footstep_sfx , file)
|
||||||
|
file.puts('HeyNoxidHeresTheLanguage[' + $persistent.langcode + ']')
|
||||||
end
|
end
|
||||||
write_perma_flags(PERMA_FLAGS_NAME)
|
write_perma_flags(PERMA_FLAGS_NAME)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ class Scene_Title
|
||||||
end
|
end
|
||||||
load_perma_flags
|
load_perma_flags
|
||||||
Window_Settings.load_settings
|
Window_Settings.load_settings
|
||||||
|
|
||||||
|
@window_settings_title = Window_Settings.new
|
||||||
# Make title graphic
|
# Make title graphic
|
||||||
@sprite = Sprite.new
|
@sprite = Sprite.new
|
||||||
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
|
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
|
||||||
|
|
@ -51,12 +53,14 @@ class Scene_Title
|
||||||
@menu.z += 1
|
@menu.z += 1
|
||||||
@menu.bitmap = Bitmap.new(640, 480)
|
@menu.bitmap = Bitmap.new(640, 480)
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 25, 150, 24, tr("Settings"))
|
||||||
if !$GDC
|
if !$GDC
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y + 28, 150, 24, tr("Exit"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
||||||
end
|
end
|
||||||
if $game_switches[160] && $game_switches[152]
|
if $game_switches[160] && $game_switches[152]
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y + 56, 150, 24, tr("..."))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
||||||
end
|
end
|
||||||
|
Language.register_text_sprite(self.class.name + "_contents", @menu.bitmap)
|
||||||
# Make cursor graphic
|
# Make cursor graphic
|
||||||
@cursor = Sprite.new
|
@cursor = Sprite.new
|
||||||
@cursor.zoom_x = @cursor.zoom_y = 2
|
@cursor.zoom_x = @cursor.zoom_y = 2
|
||||||
|
|
@ -82,6 +86,7 @@ class Scene_Title
|
||||||
Input.update
|
Input.update
|
||||||
# Frame update
|
# Frame update
|
||||||
update
|
update
|
||||||
|
@window_settings_title.update
|
||||||
# Abort loop if screen is changed
|
# Abort loop if screen is changed
|
||||||
if $scene != self
|
if $scene != self
|
||||||
break
|
break
|
||||||
|
|
@ -96,6 +101,7 @@ class Scene_Title
|
||||||
@menu.dispose
|
@menu.dispose
|
||||||
@cursor.bitmap.dispose
|
@cursor.bitmap.dispose
|
||||||
@cursor.dispose
|
@cursor.dispose
|
||||||
|
@window_settings_title.dispose
|
||||||
Audio.bgm_fade(60)
|
Audio.bgm_fade(60)
|
||||||
Graphics.transition(60)
|
Graphics.transition(60)
|
||||||
# Run automatic change for BGM and BGS set with map
|
# Run automatic change for BGM and BGS set with map
|
||||||
|
|
@ -105,8 +111,17 @@ class Scene_Title
|
||||||
# * Frame Update
|
# * Frame Update
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def update
|
def update
|
||||||
# Handle cursor movement
|
@menu.bitmap.clear
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 25, 150, 24, tr("Settings"))
|
||||||
if !$GDC
|
if !$GDC
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
||||||
|
end
|
||||||
|
if $game_switches[160] && $game_switches[152]
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
||||||
|
end
|
||||||
|
# Handle cursor movement
|
||||||
|
if !@window_settings_title.visible
|
||||||
update_cursor = false
|
update_cursor = false
|
||||||
if Input.trigger?(Input::UP)
|
if Input.trigger?(Input::UP)
|
||||||
if @cursor_pos > 0
|
if @cursor_pos > 0
|
||||||
|
|
@ -116,12 +131,12 @@ class Scene_Title
|
||||||
elsif Input.trigger?(Input::DOWN)
|
elsif Input.trigger?(Input::DOWN)
|
||||||
|
|
||||||
if $game_switches[160] && $game_switches[152]
|
if $game_switches[160] && $game_switches[152]
|
||||||
if @cursor_pos < 2
|
if @cursor_pos < 3
|
||||||
@cursor_pos += 1
|
@cursor_pos += 1
|
||||||
update_cursor = true
|
update_cursor = true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if @cursor_pos < 1
|
if @cursor_pos < 2
|
||||||
@cursor_pos += 1
|
@cursor_pos += 1
|
||||||
update_cursor = true
|
update_cursor = true
|
||||||
end
|
end
|
||||||
|
|
@ -138,23 +153,27 @@ class Scene_Title
|
||||||
end
|
end
|
||||||
if update_cursor
|
if update_cursor
|
||||||
Audio.se_play('Audio/SE/title_cursor.wav', 40)
|
Audio.se_play('Audio/SE/title_cursor.wav', 40)
|
||||||
@cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 + 24 * @cursor_pos
|
@cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 + 25 * @cursor_pos
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Handle confirmation
|
if !@window_settings_title.visible
|
||||||
if Input.trigger?(Input::ACTION)
|
# Handle confirmation
|
||||||
case @cursor_pos
|
if Input.trigger?(Input::ACTION)
|
||||||
when 0 # Continue
|
case @cursor_pos
|
||||||
$game_switches[157] = false
|
when 0 # Continue
|
||||||
command_continue
|
$game_switches[157] = false
|
||||||
when 1 # Shutdown
|
command_continue
|
||||||
command_shutdown
|
when 1 # Settings
|
||||||
when 2 # memory
|
command_settings
|
||||||
$game_switches[157] = true
|
when 2 # Shutdown
|
||||||
command_continue
|
command_shutdown
|
||||||
|
when 3 # memory
|
||||||
|
$game_switches[157] = true
|
||||||
|
command_continue
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * initialize a new game
|
# * initialize a new game
|
||||||
|
|
@ -210,4 +229,9 @@ class Scene_Title
|
||||||
Oneshot.exiting true
|
Oneshot.exiting true
|
||||||
$scene = nil
|
$scene = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def command_settings
|
||||||
|
$game_system.se_play($data_system.decision_se)
|
||||||
|
@window_settings_title.open
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -459,15 +459,15 @@ module Script
|
||||||
when 1
|
when 1
|
||||||
copy_file("Graphics/Characters/blue_npc_prototype.png", portal_path + "/blue_npc_prototype.png")
|
copy_file("Graphics/Characters/blue_npc_prototype.png", portal_path + "/blue_npc_prototype.png")
|
||||||
copy_file("Graphics/Faces/proto1.png", portal_path + "/proto1.png")
|
copy_file("Graphics/Faces/proto1.png", portal_path + "/proto1.png")
|
||||||
write_key(portal_path + "/keyB.txt", PROTO_TEXT)
|
write_key(portal_path + "/keyB.txt", tr(PROTO_TEXT))
|
||||||
when 2
|
when 2
|
||||||
copy_file("Graphics/Characters/green_npc_cedric.png", portal_path + "/green_npc_cedric.png")
|
copy_file("Graphics/Characters/green_npc_cedric.png", portal_path + "/green_npc_cedric.png")
|
||||||
copy_file("Graphics/Faces/cedric.png", portal_path + "/cedric.png")
|
copy_file("Graphics/Faces/cedric.png", portal_path + "/cedric.png")
|
||||||
write_key(portal_path + "/keyG.txt", CEDRIC_TEXT)
|
write_key(portal_path + "/keyG.txt", tr(CEDRIC_TEXT))
|
||||||
when 3
|
when 3
|
||||||
copy_file("Graphics/Characters/red_rue.png", portal_path + "/red_rue.png")
|
copy_file("Graphics/Characters/red_rue.png", portal_path + "/red_rue.png")
|
||||||
copy_file("Graphics/Faces/rue.png", portal_path + "/rue.png")
|
copy_file("Graphics/Faces/rue.png", portal_path + "/rue.png")
|
||||||
write_key(portal_path + "/keyR.txt", RUE_TEXT)
|
write_key(portal_path + "/keyR.txt", tr(RUE_TEXT))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
@ -477,11 +477,11 @@ module Script
|
||||||
if !Language::LANGUAGES.include? locale
|
if !Language::LANGUAGES.include? locale
|
||||||
locale = 'en'
|
locale = 'en'
|
||||||
end
|
end
|
||||||
source_dir = "Graphics\\Fogs\\_\\scenario1\\" + locale.downcase
|
source_dir = "Graphics/Fogs/_/scenario1/" + locale.downcase
|
||||||
copy_file(source_dir + "\\pw1.png", Oneshot::DOCS_PATH + "\\ONESHOT_password1.png")
|
copy_file(source_dir + "/pw1.png", Oneshot::DOCS_PATH + "/ONESHOT_password1.png")
|
||||||
copy_file(source_dir + "\\pw2.png", Oneshot::DOCS_PATH + "\\ONESHOT_password2.png")
|
copy_file(source_dir + "/pw2.png", Oneshot::DOCS_PATH + "/ONESHOT_password2.png")
|
||||||
copy_file(source_dir + "\\pw3.png", Oneshot::DOCS_PATH + "\\ONESHOT_password3.png")
|
copy_file(source_dir + "/pw3.png", Oneshot::DOCS_PATH + "/ONESHOT_password3.png")
|
||||||
copy_file(source_dir + "\\pw4.png", Oneshot::DOCS_PATH + "\\ONESHOT_password4.png")
|
copy_file(source_dir + "/pw4.png", Oneshot::DOCS_PATH + "/ONESHOT_password4.png")
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.password2
|
def self.password2
|
||||||
|
|
@ -489,11 +489,11 @@ module Script
|
||||||
if !Language::LANGUAGES.include? locale
|
if !Language::LANGUAGES.include? locale
|
||||||
locale = 'en'
|
locale = 'en'
|
||||||
end
|
end
|
||||||
source_dir = "Graphics\\Fogs\\_\\scenario2\\" + locale.downcase
|
source_dir = "Graphics/Fogs/_/scenario2/" + locale.downcase
|
||||||
copy_file(source_dir + "\\pw1.png", Oneshot::DOCS_PATH + "\\ONESHOT_password1.png")
|
copy_file(source_dir + "/pw1.png", Oneshot::DOCS_PATH + "/ONESHOT_password1.png")
|
||||||
copy_file(source_dir + "\\pw2.png", Oneshot::DOCS_PATH + "\\ONESHOT_password2.png")
|
copy_file(source_dir + "/pw2.png", Oneshot::DOCS_PATH + "/ONESHOT_password2.png")
|
||||||
copy_file(source_dir + "\\pw3.png", Oneshot::DOCS_PATH + "\\ONESHOT_password3.png")
|
copy_file(source_dir + "/pw3.png", Oneshot::DOCS_PATH + "/ONESHOT_password3.png")
|
||||||
copy_file(source_dir + "\\pw4.png", Oneshot::DOCS_PATH + "\\ONESHOT_password4.png")
|
copy_file(source_dir + "/pw4.png", Oneshot::DOCS_PATH + "/ONESHOT_password4.png")
|
||||||
end
|
end
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
|
|
@ -737,6 +737,9 @@ def plight_start_timer
|
||||||
end
|
end
|
||||||
|
|
||||||
def plight_update_timer
|
def plight_update_timer
|
||||||
|
if $game_oneshot.plight_timer == nil
|
||||||
|
plight_start_timer
|
||||||
|
end
|
||||||
Script.tmp_v1 = ((Time.now - $game_oneshot.plight_timer) / 60).to_i
|
Script.tmp_v1 = ((Time.now - $game_oneshot.plight_timer) / 60).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,14 @@ class Sprite_MapText < Sprite
|
||||||
@real_x = x * 4 * 32
|
@real_x = x * 4 * 32
|
||||||
@real_y = y * 4 * 32
|
@real_y = y * 4 * 32
|
||||||
|
|
||||||
self.zoom_x = 2
|
|
||||||
self.zoom_y = 2
|
|
||||||
self.bitmap = Bitmap.new(200, 24)
|
self.bitmap = Bitmap.new(200, 24)
|
||||||
|
if (Language::FONT_WESTERN == Font.default_name)
|
||||||
|
self.zoom_x = 2
|
||||||
|
self.zoom_y = 2
|
||||||
|
else
|
||||||
|
self.zoom_x = 1.5
|
||||||
|
self.zoom_y = 1.5
|
||||||
|
end
|
||||||
|
|
||||||
#calculate text width
|
#calculate text width
|
||||||
spacewidth = self.bitmap.text_size(' ').width
|
spacewidth = self.bitmap.text_size(' ').width
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,12 @@ class Window_Message < Window_Selectable
|
||||||
text.gsub!(/\\v\[([0-9]+)\]/) do
|
text.gsub!(/\\v\[([0-9]+)\]/) do
|
||||||
$game_variables[$1.to_i]
|
$game_variables[$1.to_i]
|
||||||
end
|
end
|
||||||
text.gsub!("\\p", $game_oneshot.player_name)
|
#add a space to the beginning of the player name to better deal with longer names in asian languages
|
||||||
|
if (Language::FONT_WESTERN == Font.default_name)
|
||||||
|
text.gsub!("\\p", $game_oneshot.player_name)
|
||||||
|
else
|
||||||
|
text.gsub!("\\p", " " + $game_oneshot.player_name)
|
||||||
|
end
|
||||||
text.gsub!("\\n", "\n")
|
text.gsub!("\\n", "\n")
|
||||||
# Handle text-rendering escape sequences
|
# Handle text-rendering escape sequences
|
||||||
text.gsub!(/\\c\[([0-9]+)\]/, "\0[\\1]")
|
text.gsub!(/\\c\[([0-9]+)\]/, "\0[\\1]")
|
||||||
|
|
|
||||||
|
|
@ -3,25 +3,57 @@ Font.default_name = Language::FONT_WESTERN
|
||||||
|
|
||||||
class Language
|
class Language
|
||||||
def self.create_input
|
def self.create_input
|
||||||
input = Window_NameInput.new
|
if Font.default_name == FONT_J
|
||||||
input.set_mode_buttons [[tr('Upper'), tr('Lower')]]
|
input = Window_NameInput.new
|
||||||
input.character_tables = {
|
input.ok_text = '決定'
|
||||||
[0] => [ # Case: Upper
|
input.set_mode_buttons [['英字', 'かな', 'カナ']]
|
||||||
"A","B","C","D","E","F","G","H","I","J",
|
input.character_tables = {
|
||||||
"K","L","M","N","O","P","Q","R","S","T",
|
[0] => [ # Latin
|
||||||
"U","V","W","X","Y","Z"," ",".",",","-",
|
"A","B","C","D","E","F","G","H","I","a","b","c","d","e","f","g","h","i",
|
||||||
"0","1","2","3","4","5","6","7","8","9",
|
"J","K","L","M","N","O","P","Q","R","j","k","l","m","n","o","p","q","r",
|
||||||
"!","?",'"',"'","/","&","[","]","(",")",
|
"S","T","U","V","W","X","Y","Z"," ","s","t","u","v","w","x","y","z"," ",
|
||||||
],
|
"0","1","2","3","4","+","-","=","&","!","?","'",'"',".",",",":",";","$",
|
||||||
[1] => [ # Case: Lower
|
"5","6","7","8","9","*","/","#","|","[","]","(",")","<",">","{","}","@",
|
||||||
"a","b","c","d","e","f","g","h","i","j",
|
],
|
||||||
"k","l","m","n","o","p","q","r","s","t",
|
[1] => [ # Hiragana
|
||||||
"u","v","w","x","y","z"," ",".",",","-",
|
"ー","っ","ぁ","ぱ","ば","だ","ざ","が","わ","ら","や","ま","は","な","た","さ","か","あ",
|
||||||
"0","1","2","3","4","5","6","7","8","9",
|
"~","ゃ","ぃ","ぴ","び","ぢ","じ","ぎ"," ","り"," ","み","ひ","に","ち","し","き","い",
|
||||||
"!","?",'"',"'","/","&","[","]","(",")",
|
"・","ゅ","ぅ","ぷ","ぶ","づ","ず","ぐ","を","る","ゆ","む","ふ","ぬ","つ","す","く","う",
|
||||||
],
|
"=","ょ","ぇ","ぺ","べ","で","ぜ","げ"," ","れ"," ","め","へ","ね","て","せ","け","え",
|
||||||
}
|
"☆","ゎ","ぉ","ぽ","ぼ","ど","ぞ","ご","ん","ろ","よ","も","ほ","の","と","そ","こ","お",
|
||||||
input.table_height = 5
|
],
|
||||||
input.init
|
[2] => [ # Katakana
|
||||||
|
"ー","ッ","ァ","パ","バ","ダ","ザ","ガ","ワ","ラ","ヤ","マ","ハ","ナ","タ","サ","カ","ア",
|
||||||
|
"~","ャ","ィ","ピ","ビ","ヂ","ジ","ギ"," ","リ"," ","ミ","ヒ","ニ","チ","シ","キ","イ",
|
||||||
|
"・","ュ","ゥ","プ","ブ","ヅ","ズ","グ","ヲ","ル","ユ","ム","フ","ヌ","ツ","ス","ク","ウ",
|
||||||
|
"=","ョ","ェ","ペ","ベ","デ","ゼ","ゲ"," ","レ"," ","メ","ヘ","ネ","テ","セ","ケ","エ",
|
||||||
|
"☆","ヮ","ォ","ポ","ボ","ド","ゾ","ゴ","ン","ロ","ヨ","モ","ホ","ノ","ト","ソ","コ","オ",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
input.index = 17 # Start on あ
|
||||||
|
input.table_height = 5
|
||||||
|
input.init
|
||||||
|
else
|
||||||
|
input = Window_NameInput.new
|
||||||
|
input.set_mode_buttons [[tr('Upper'), tr('Lower')]]
|
||||||
|
input.character_tables = {
|
||||||
|
[0] => [ # Case: Upper
|
||||||
|
"A","B","C","D","E","F","G","H","I","J",
|
||||||
|
"K","L","M","N","O","P","Q","R","S","T",
|
||||||
|
"U","V","W","X","Y","Z"," ",".",",","-",
|
||||||
|
"0","1","2","3","4","5","6","7","8","9",
|
||||||
|
"!","?",'"',"'","/","&","[","]","(",")",
|
||||||
|
],
|
||||||
|
[1] => [ # Case: Lower
|
||||||
|
"a","b","c","d","e","f","g","h","i","j",
|
||||||
|
"k","l","m","n","o","p","q","r","s","t",
|
||||||
|
"u","v","w","x","y","z"," ",".",",","-",
|
||||||
|
"0","1","2","3","4","5","6","7","8","9",
|
||||||
|
"!","?",'"',"'","/","&","[","]","(",")",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
input.table_height = 5
|
||||||
|
input.init
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ class Language
|
||||||
'en', 'fr', 'pt_BR', 'es'
|
'en', 'fr', 'pt_BR', 'es'
|
||||||
]
|
]
|
||||||
LANG_J = [
|
LANG_J = [
|
||||||
'ja'
|
'ja'
|
||||||
]
|
]
|
||||||
LANG_CK = [
|
LANG_CK = [
|
||||||
'ko', 'zh_CN'
|
'ko', 'zh_CN'
|
||||||
|
|
@ -34,13 +34,13 @@ class Language
|
||||||
@data = Marshal.load(file)
|
@data = Marshal.load(file)
|
||||||
if LANG_CK.include? name
|
if LANG_CK.include? name
|
||||||
Font.default_name = FONT_CK
|
Font.default_name = FONT_CK
|
||||||
elsif LANG_J.include? name
|
elsif LANG_J.include? name
|
||||||
Font.default_name = FONT_J
|
Font.default_name = FONT_J
|
||||||
else
|
else
|
||||||
Font.default_name = FONT_WESTERN
|
Font.default_name = FONT_WESTERN
|
||||||
end
|
end
|
||||||
Journal.setLang(name)
|
Journal.setLang(name)
|
||||||
dbg_print(Font.default_name)
|
dbg_print(Font.default_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -51,14 +51,13 @@ class Language
|
||||||
# Translate some text
|
# Translate some text
|
||||||
def tr(string)
|
def tr(string)
|
||||||
#dbg_print(caller_locations(1, 1).first.tap{|loc| puts "#{loc.path}:#{loc.lineno}"})
|
#dbg_print(caller_locations(1, 1).first.tap{|loc| puts "#{loc.path}:#{loc.lineno}"})
|
||||||
dbg_print(string)
|
|
||||||
if @data
|
if @data
|
||||||
rv = @data[Zlib::crc32(string)] || string
|
rv = @data[Zlib::crc32(string)] || string
|
||||||
else
|
else
|
||||||
rv = string
|
rv = string
|
||||||
end
|
end
|
||||||
dbg_print(rv)
|
dbg_print(string + " -> " + rv)
|
||||||
return rv
|
return String.new(rv)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Turn all database items into translatable strings
|
# Turn all database items into translatable strings
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue