Merge remote-tracking branch 'mathewv/master' into oneshot-fop

This commit is contained in:
Vinyl Darkscratch 2017-07-08 02:52:09 -07:00
commit 6c772cfdd2
11 changed files with 373 additions and 83 deletions

5
.gitignore vendored
View File

@ -25,6 +25,11 @@ rpgscript.bat
rpgscript - mklang.bat rpgscript - mklang.bat
oneshot_JA_2_merge.pot oneshot_JA_2_merge.pot
oneshot_JA_2_merge-jpn.pot oneshot_JA_2_merge-jpn.pot
oneshot_JA_2_ver4.pot
oneshot_JA_2_fixed_ver3.pot
oneshot_JA_2_ver3_checked.pot
oneshot_JA_Mariko1_WIP.pot
*.pot
xScripts.rxdata xScripts.rxdata
.qmake.stash .qmake.stash

View File

@ -31,8 +31,10 @@
static SDL_Thread *thread = NULL; static SDL_Thread *thread = NULL;
static SDL_mutex *mutex = NULL; static SDL_mutex *mutex = NULL;
static volatile char lang_buffer[BUFFER_SIZE];
static volatile char message_buffer[BUFFER_SIZE]; static volatile char message_buffer[BUFFER_SIZE];
static volatile bool active = false; static volatile bool active = false;
static volatile int message_len = 0;
#ifdef LINUX #ifdef LINUX
#define PIPE_PATH "/tmp/oneshot-pipe" #define PIPE_PATH "/tmp/oneshot-pipe"
@ -83,10 +85,15 @@ RB_METHOD(journalSet)
RB_UNUSED_PARAM; RB_UNUSED_PARAM;
const char *name; const char *name;
rb_get_args(argc, argv, "z", &name RB_ARG_END); rb_get_args(argc, argv, "z", &name RB_ARG_END);
#if defined OS_W32 // Record message
SDL_LockMutex(mutex); SDL_LockMutex(mutex);
strcpy((char*)message_buffer, name); message_len = strlen(name);
memcpy((char*)message_buffer, name, message_len);
strcpy((char*)message_buffer + message_len, (char*)lang_buffer);
message_len += strlen((char*)lang_buffer);
SDL_UnlockMutex(mutex); SDL_UnlockMutex(mutex);
#if defined _WIN32
HANDLE pipe = CreateFileW(L"\\\\.\\pipe\\oneshot-game-to-journal", HANDLE pipe = CreateFileW(L"\\\\.\\pipe\\oneshot-game-to-journal",
GENERIC_WRITE, GENERIC_WRITE,
0, 0,
@ -110,12 +117,6 @@ RB_METHOD(journalSet)
SDL_WaitThread(thread, NULL); SDL_WaitThread(thread, NULL);
thread = NULL; thread = NULL;
} }
// Record message
SDL_LockMutex(mutex);
message_len = strlen(name);
memcpy((char*)message_buffer, name, message_len);
SDL_UnlockMutex(mutex);
// Attempt to send it over the tubes // Attempt to send it over the tubes
if (out_pipe != -1) { if (out_pipe != -1) {
// We have a connection, so send it over // We have a connection, so send it over
@ -133,6 +134,15 @@ RB_METHOD(journalSet)
return Qnil; return Qnil;
} }
RB_METHOD(journalSetLang)
{
RB_UNUSED_PARAM;
const char *lang;
rb_get_args(argc, argv, "z", &lang RB_ARG_END);
strcpy((char*)lang_buffer+1, lang);
return Qnil;
}
RB_METHOD(journalActive) RB_METHOD(journalActive)
{ {
RB_UNUSED_PARAM; RB_UNUSED_PARAM;
@ -142,7 +152,9 @@ RB_METHOD(journalActive)
void journalBindingInit() void journalBindingInit()
{ {
mutex = SDL_CreateMutex(); mutex = SDL_CreateMutex();
#ifdef LINUX memset((char*)lang_buffer, 0, BUFFER_SIZE);
lang_buffer[0] = '_';
#if defined __linux
mkfifo(PIPE_PATH, 0666); mkfifo(PIPE_PATH, 0666);
atexit(cleanup_pipe); atexit(cleanup_pipe);
#endif #endif
@ -150,4 +162,5 @@ void journalBindingInit()
VALUE module = rb_define_module("Journal"); VALUE module = rb_define_module("Journal");
_rb_define_module_function(module, "set", journalSet); _rb_define_module_function(module, "set", journalSet);
_rb_define_module_function(module, "active?", journalActive); _rb_define_module_function(module, "active?", journalActive);
_rb_define_module_function(module, "setLang", journalSetLang);
} }

View File

@ -13,13 +13,31 @@ static const WCHAR journal_classname[] = L"journal";
static HBITMAP image_handle = NULL; static HBITMAP image_handle = NULL;
static HANDLE image_mutex = NULL; static HANDLE image_mutex = NULL;
static DWORD err = 0;
static HWND window = NULL; static HWND window = NULL;
static void loadImage(const char *name) { static void loadImage(const char *name) {
char copy_space[IN_BUFFER_SIZE];
const char* lang_ptr;
if (image_handle) { if (image_handle) {
DeleteObject(image_handle); DeleteObject(image_handle);
} }
image_handle = LoadBitmapA(GetModuleHandleW(NULL), name); image_handle = LoadBitmapA(GetModuleHandleW(NULL), name);
// In the event we can't find an image's translated value
// try to find a matching resource without any language code suffix
if (!image_handle) {
lang_ptr = strchr(name, '_');
if (lang_ptr) {
memset(copy_space, 0, IN_BUFFER_SIZE);
strncpy(copy_space, name, lang_ptr - name);
//terminate the string because I guess strncpy doesn't
image_handle = LoadBitmapA(GetModuleHandleW(NULL), copy_space);
if (!image_handle) {
err = GetLastError();
}
}
}
} }
// Window procedure // Window procedure
@ -134,7 +152,7 @@ int do_journal()
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.cbWndExtra = 0; wc.cbWndExtra = 0;
wc.hInstance = module; wc.hInstance = module;
wc.hIcon = LoadIcon(NULL, "MAINICON"); wc.hIcon = LoadIcon(NULL, L"MAINICON");
wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL; wc.hbrBackground = NULL;
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;

View File

@ -1,37 +1,223 @@
#include <winuser.h> #include <winuser.h>
MAINICON ICON "icon.ico" MAINICON ICON "icon.ico"
NIKO1 BITMAP "niko1.bmp" NIKO1 BITMAP "img/NIKO1.bmp"
NIKO2 BITMAP "niko2.bmp" NIKO2 BITMAP "img/NIKO2.bmp"
NIKO3 BITMAP "niko3.bmp" NIKO3 BITMAP "img/NIKO3.bmp"
default BITMAP "default.bmp" default BITMAP "img/DEFAULT.bmp"
t1 BITMAP "t1.bmp" t1 BITMAP "img/T1.bmp"
t2 BITMAP "t2.bmp" t2 BITMAP "img/T2.bmp"
t3 BITMAP "t3.bmp" t3 BITMAP "img/T3.bmp"
t4 BITMAP "t4.bmp" t4 BITMAP "img/T4.bmp"
t5 BITMAP "t5.bmp" t5 BITMAP "img/T5.bmp"
t6 BITMAP "t6.bmp" t6 BITMAP "img/T6.bmp"
t7 BITMAP "t7.bmp" t7 BITMAP "img/T7.bmp"
t8 BITMAP "t8.bmp" t8 BITMAP "img/T8.bmp"
t9 BITMAP "t9.bmp" t9 BITMAP "img/T9.bmp"
t10 BITMAP "t10.bmp" t10 BITMAP "img/T10.bmp"
t11 BITMAP "t11.bmp" t11 BITMAP "img/T11.bmp"
t12 BITMAP "t12.bmp" t12 BITMAP "img/T12.bmp"
t13 BITMAP "t13.bmp" t13 BITMAP "img/T13.bmp"
t14 BITMAP "t14.bmp" t14 BITMAP "img/T14.bmp"
t15 BITMAP "t15.bmp" t15 BITMAP "img/T15.bmp"
t16 BITMAP "t16.bmp" t16 BITMAP "img/T16.bmp"
c1 BITMAP "c1.bmp" c1 BITMAP "img/C1.bmp"
c2 BITMAP "c2.bmp" c2 BITMAP "img/C2.bmp"
c3 BITMAP "c3.bmp" c3 BITMAP "img/C3.bmp"
c4 BITMAP "c4.bmp" c4 BITMAP "img/C4.bmp"
c5 BITMAP "c5.bmp" c5 BITMAP "img/C5.bmp"
c6 BITMAP "c6.bmp" c6 BITMAP "img/C6.bmp"
c7 BITMAP "c7.bmp" c7 BITMAP "img/C7.bmp"
s1 BITMAP "s1.bmp" s1 BITMAP "img/S1.bmp"
s2 BITMAP "s2.bmp" s2 BITMAP "img/S2.bmp"
s3 BITMAP "s3.bmp" s3 BITMAP "img/S3.bmp"
s4 BITMAP "s4.bmp" s4 BITMAP "img/S4.bmp"
save BITMAP "save.bmp" save BITMAP "img/SAVE.bmp"
final BITMAP "final.bmp" final BITMAP "img/FINAL.bmp"
//french
t1_FR BITMAP "img/fr/T1.bmp"
t2_FR BITMAP "img/fr/T2.bmp"
t3_FR BITMAP "img/fr/T3.bmp"
t4_FR BITMAP "img/fr/T4.bmp"
t5_FR BITMAP "img/fr/T5.bmp"
t6_FR BITMAP "img/fr/T6.bmp"
t7_FR BITMAP "img/fr/T7.bmp"
t8_FR BITMAP "img/fr/T8.bmp"
t9_FR BITMAP "img/fr/T9.bmp"
t10_FR BITMAP "img/fr/T10.bmp"
t11_FR BITMAP "img/fr/T11.bmp"
t12_FR BITMAP "img/fr/T12.bmp"
t13_FR BITMAP "img/fr/T13.bmp"
t14_FR BITMAP "img/fr/T14.bmp"
t15_FR BITMAP "img/fr/T15.bmp"
t16_FR BITMAP "img/fr/T16.bmp"
c1_FR BITMAP "img/fr/C1.bmp"
c2_FR BITMAP "img/fr/C2.bmp"
c3_FR BITMAP "img/fr/C3.bmp"
c4_FR BITMAP "img/fr/C4.bmp"
c5_FR BITMAP "img/fr/C5.bmp"
c6_FR BITMAP "img/fr/C6.bmp"
c7_FR BITMAP "img/fr/C7.bmp"
s1_FR BITMAP "img/fr/S1.bmp"
s2_FR BITMAP "img/fr/S2.bmp"
s3_FR BITMAP "img/fr/S3.bmp"
s4_FR BITMAP "img/fr/S4.bmp"
save_FR BITMAP "img/fr/SAVE.bmp"
final_FR BITMAP "img/fr/FINAL.bmp"
//spanish
t1_ES BITMAP "img/es/T1.bmp"
t2_ES BITMAP "img/es/T2.bmp"
t3_ES BITMAP "img/es/T3.bmp"
t4_ES BITMAP "img/es/T4.bmp"
t5_ES BITMAP "img/es/T5.bmp"
t6_ES BITMAP "img/es/T6.bmp"
t7_ES BITMAP "img/es/T7.bmp"
t8_ES BITMAP "img/es/T8.bmp"
t9_ES BITMAP "img/es/T9.bmp"
t10_ES BITMAP "img/es/T10.bmp"
t11_ES BITMAP "img/es/T11.bmp"
t12_ES BITMAP "img/es/T12.bmp"
t13_ES BITMAP "img/es/T13.bmp"
t14_ES BITMAP "img/es/T14.bmp"
t15_ES BITMAP "img/es/T15.bmp"
t16_ES BITMAP "img/es/T16.bmp"
c1_ES BITMAP "img/es/C1.bmp"
c2_ES BITMAP "img/es/C2.bmp"
c3_ES BITMAP "img/es/C3.bmp"
c4_ES BITMAP "img/es/C4.bmp"
c5_ES BITMAP "img/es/C5.bmp"
c6_ES BITMAP "img/es/C6.bmp"
c7_ES BITMAP "img/es/C7.bmp"
s1_ES BITMAP "img/es/S1.bmp"
s2_ES BITMAP "img/es/S2.bmp"
s3_ES BITMAP "img/es/S3.bmp"
s4_ES BITMAP "img/es/S4.bmp"
save_ES BITMAP "img/es/SAVE.bmp"
final_ES BITMAP "img/es/FINAL.bmp"
//japanese
t1_JA BITMAP "img/ja/T1.bmp"
t2_JA BITMAP "img/ja/T2.bmp"
t3_JA BITMAP "img/ja/T3.bmp"
t4_JA BITMAP "img/ja/T4.bmp"
t5_JA BITMAP "img/ja/T5.bmp"
t6_JA BITMAP "img/ja/T6.bmp"
t7_JA BITMAP "img/ja/T7.bmp"
t8_JA BITMAP "img/ja/T8.bmp"
t9_JA BITMAP "img/ja/T9.bmp"
t10_JA BITMAP "img/ja/T10.bmp"
t11_JA BITMAP "img/ja/T11.bmp"
t12_JA BITMAP "img/ja/T12.bmp"
t13_JA BITMAP "img/ja/T13.bmp"
t14_JA BITMAP "img/ja/T14.bmp"
t15_JA BITMAP "img/ja/T15.bmp"
t16_JA BITMAP "img/ja/T16.bmp"
c1_JA BITMAP "img/ja/C1.bmp"
c2_JA BITMAP "img/ja/C2.bmp"
c3_JA BITMAP "img/ja/C3.bmp"
c4_JA BITMAP "img/ja/C4.bmp"
c5_JA BITMAP "img/ja/C5.bmp"
c6_JA BITMAP "img/ja/C6.bmp"
c7_JA BITMAP "img/ja/C7.bmp"
s1_JA BITMAP "img/ja/S1.bmp"
s2_JA BITMAP "img/ja/S2.bmp"
s3_JA BITMAP "img/ja/S3.bmp"
s4_JA BITMAP "img/ja/S4.bmp"
save_JA BITMAP "img/ja/SAVE.bmp"
final_JA BITMAP "img/ja/FINAL.bmp"
//korean
t1_KO BITMAP "img/ko/T1.bmp"
t2_KO BITMAP "img/ko/T2.bmp"
t3_KO BITMAP "img/ko/T3.bmp"
t4_KO BITMAP "img/ko/T4.bmp"
t5_KO BITMAP "img/ko/T5.bmp"
t6_KO BITMAP "img/ko/T6.bmp"
t7_KO BITMAP "img/ko/T7.bmp"
t8_KO BITMAP "img/ko/T8.bmp"
t9_KO BITMAP "img/ko/T9.bmp"
t10_KO BITMAP "img/ko/T10.bmp"
t11_KO BITMAP "img/ko/T11.bmp"
t12_KO BITMAP "img/ko/T12.bmp"
t13_KO BITMAP "img/ko/T13.bmp"
t14_KO BITMAP "img/ko/T14.bmp"
t15_KO BITMAP "img/ko/T15.bmp"
t16_KO BITMAP "img/ko/T16.bmp"
c1_KO BITMAP "img/ko/C1.bmp"
c2_KO BITMAP "img/ko/C2.bmp"
c3_KO BITMAP "img/ko/C3.bmp"
c4_KO BITMAP "img/ko/C4.bmp"
c5_KO BITMAP "img/ko/C5.bmp"
c6_KO BITMAP "img/ko/C6.bmp"
c7_KO BITMAP "img/ko/C7.bmp"
s1_KO BITMAP "img/ko/S1.bmp"
s2_KO BITMAP "img/ko/S2.bmp"
s3_KO BITMAP "img/ko/S3.bmp"
s4_KO BITMAP "img/ko/S4.bmp"
save_KO BITMAP "img/ko/SAVE.bmp"
final_KO BITMAP "img/ko/FINAL.bmp"
//portuges
t1_PT_BR BITMAP "img/pt_br/T1.bmp"
t2_PT_BR BITMAP "img/pt_br/T2.bmp"
t3_PT_BR BITMAP "img/pt_br/T3.bmp"
t4_PT_BR BITMAP "img/pt_br/T4.bmp"
t5_PT_BR BITMAP "img/pt_br/T5.bmp"
t6_PT_BR BITMAP "img/pt_br/T6.bmp"
t7_PT_BR BITMAP "img/pt_br/T7.bmp"
t8_PT_BR BITMAP "img/pt_br/T8.bmp"
t9_PT_BR BITMAP "img/pt_br/T9.bmp"
t10_PT_BR BITMAP "img/pt_br/T10.bmp"
t11_PT_BR BITMAP "img/pt_br/T11.bmp"
t12_PT_BR BITMAP "img/pt_br/T12.bmp"
t13_PT_BR BITMAP "img/pt_br/T13.bmp"
t14_PT_BR BITMAP "img/pt_br/T14.bmp"
t15_PT_BR BITMAP "img/pt_br/T15.bmp"
t16_PT_BR BITMAP "img/pt_br/T16.bmp"
c1_PT_BR BITMAP "img/pt_br/C1.bmp"
c2_PT_BR BITMAP "img/pt_br/C2.bmp"
c3_PT_BR BITMAP "img/pt_br/C3.bmp"
c4_PT_BR BITMAP "img/pt_br/C4.bmp"
c5_PT_BR BITMAP "img/pt_br/C5.bmp"
c6_PT_BR BITMAP "img/pt_br/C6.bmp"
c7_PT_BR BITMAP "img/pt_br/C7.bmp"
s1_PT_BR BITMAP "img/pt_br/S1.bmp"
s2_PT_BR BITMAP "img/pt_br/S2.bmp"
s3_PT_BR BITMAP "img/pt_br/S3.bmp"
s4_PT_BR BITMAP "img/pt_br/S4.bmp"
save_PT_BR BITMAP "img/pt_br/SAVE.bmp"
final_PT_BR BITMAP "img/pt_br/FINAL.bmp"
//chinese
t1_ZH_CN BITMAP "img/zh_cn/T1.bmp"
t2_ZH_CN BITMAP "img/zh_cn/T2.bmp"
t3_ZH_CN BITMAP "img/zh_cn/T3.bmp"
t4_ZH_CN BITMAP "img/zh_cn/T4.bmp"
t5_ZH_CN BITMAP "img/zh_cn/T5.bmp"
t6_ZH_CN BITMAP "img/zh_cn/T6.bmp"
t7_ZH_CN BITMAP "img/zh_cn/T7.bmp"
t8_ZH_CN BITMAP "img/zh_cn/T8.bmp"
t9_ZH_CN BITMAP "img/zh_cn/T9.bmp"
t10_ZH_CN BITMAP "img/zh_cn/T10.bmp"
t11_ZH_CN BITMAP "img/zh_cn/T11.bmp"
t12_ZH_CN BITMAP "img/zh_cn/T12.bmp"
t13_ZH_CN BITMAP "img/zh_cn/T13.bmp"
t14_ZH_CN BITMAP "img/zh_cn/T14.bmp"
t15_ZH_CN BITMAP "img/zh_cn/T15.bmp"
t16_ZH_CN BITMAP "img/zh_cn/T16.bmp"
c1_ZH_CN BITMAP "img/zh_cn/C1.bmp"
c2_ZH_CN BITMAP "img/zh_cn/C2.bmp"
c3_ZH_CN BITMAP "img/zh_cn/C3.bmp"
c4_ZH_CN BITMAP "img/zh_cn/C4.bmp"
c5_ZH_CN BITMAP "img/zh_cn/C5.bmp"
c6_ZH_CN BITMAP "img/zh_cn/C6.bmp"
c7_ZH_CN BITMAP "img/zh_cn/C7.bmp"
s1_ZH_CN BITMAP "img/zh_cn/S1.bmp"
s2_ZH_CN BITMAP "img/zh_cn/S2.bmp"
s3_ZH_CN BITMAP "img/zh_cn/S3.bmp"
s4_ZH_CN BITMAP "img/zh_cn/S4.bmp"
save_ZH_CN BITMAP "img/zh_cn/SAVE.bmp"
final_ZH_CN BITMAP "img/zh_cn/FINAL.bmp"

View File

@ -12,7 +12,7 @@ class Game_Oneshot
if $GDC if $GDC
@player_name = '' @player_name = ''
else else
@player_name = Game_Oneshot.get_user_name @player_name = Game_Oneshot.get_user_name.force_encoding("utf-8")
end end
@lights = {} @lights = {}
@plight_timer = nil @plight_timer = nil

View File

@ -558,6 +558,77 @@ def check_exit(min, max, x: -1, y: -1)
Script.tmp_s1 = $game_switches[11] ? false : result Script.tmp_s1 = $game_switches[11] ? false : result
end end
def loadQASave(fname)
filename = "testing_saves/" + fname + ".rxdata"
# If file doesn't exist
unless FileTest.exist?(filename)
filename = "testing_saves_postgame/" + fname + ".rxdata"
unless FileTest.exist?(filename)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
end
# Play load SE
$game_system.se_play($data_system.load_se)
# Read save data
file = File.open(filename, "rb")
# Read character data for drawing save file
characters = Marshal.load(file)
# Read frame count for measuring play time
Graphics.frame_count = Marshal.load(file)
# Read each type of game object
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
$game_followers = Marshal.load(file)
$game_oneshot = Marshal.load(file)
$game_fasttravel = Marshal.load(file)
$game_temp.footstep_sfx = Marshal.load(file)
# If magic number is different from when saving
# (if editing was added with editor)
if $game_system.magic_number != $data_system.magic_number
# Load map
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
# Refresh party members
$game_party.refresh
f_prev = $game_player
for f in $game_followers
f.leader = f_prev
f.moveto($game_player.x, $game_player.y)
f_prev = f
end
file.close
# Restore BGM and BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
def kill_perma_flags
for i in 151..175
$game_switches[i] = false
end
for i in 76..100
$game_variables[i] = 0
end
end
def bg(name) def bg(name)
$game_map.bg_name = name $game_map.bg_name = name
end end

View File

@ -80,7 +80,7 @@ class Window_Item < Window_Selectable
x = index % 2 * (self.width / COLUMN_MAX) x = index % 2 * (self.width / COLUMN_MAX)
y = index / 2 * 32 y = index / 2 * 32
off = index == @index ? 2 : 0 off = index == @index ? 2 : 0
rect = Rect.new(x, y, self.width / COLUMN_MAX - 32, 32) rect = Rect.new(x + 32, y, self.width / COLUMN_MAX - 64, 32)
self.contents.draw_text(rect, item.name, 1) self.contents.draw_text(rect, item.name, 1)
bitmap = RPG::Cache.icon(item.icon_name) bitmap = RPG::Cache.icon(item.icon_name)

View File

@ -233,12 +233,7 @@ class Window_Message < Window_Selectable
end end
if c == "\003" if c == "\003"
# new facepic # new facepic
face_name = "" face_name = @text.slice!(/^[^\s]+ */).strip()
c2 = @text.slice!(0)
while c2 != " "
face_name += c2
c2 = @text.slice!(0)
end
self.contents.fill_rect(self.contents.width - 96, 0, 96, 96, Color.new(0,0,0,0)) self.contents.fill_rect(self.contents.width - 96, 0, 96, 96, Color.new(0,0,0,0))
$game_temp.message_face = face_name $game_temp.message_face = face_name
if $game_player.character_name == "niko_gasmask" || $game_player.character_name == "niko_bulb_gasmask" \ if $game_player.character_name == "niko_gasmask" || $game_player.character_name == "niko_bulb_gasmask" \

View File

@ -3,6 +3,7 @@ class Window_Settings
TITLE_TOP_MARGIN = 32 TITLE_TOP_MARGIN = 32
TITLE_MARGIN = 100 TITLE_MARGIN = 100
ITEM_SPACING = 28 ITEM_SPACING = 28
VALUE_MARGIN = 270
ACTIVE_MARGIN = MARGIN * 2 + 20 ACTIVE_MARGIN = MARGIN * 2 + 20
SETTINGS_FILE_NAME = Oneshot::SAVE_PATH + '/settings.conf' SETTINGS_FILE_NAME = Oneshot::SAVE_PATH + '/settings.conf'
@ -130,7 +131,7 @@ class Window_Settings
# Create menu options # Create menu options
@data.each_with_index do |item, i| @data.each_with_index do |item, i|
spr = Sprite.new(@viewport) spr = Sprite.new(@viewport)
spr.bitmap = Bitmap.new(320, ITEM_SPACING) spr.bitmap = Bitmap.new(400, ITEM_SPACING)
spr.x = MARGIN spr.x = MARGIN
spr.y = TITLE_MARGIN + TITLE_TOP_MARGIN + ITEM_SPACING * i spr.y = TITLE_MARGIN + TITLE_TOP_MARGIN + ITEM_SPACING * i
spr.opacity = 0 spr.opacity = 0
@ -150,36 +151,36 @@ class Window_Settings
spr.bitmap.draw_text(0, 0, spr.bitmap.width, spr.bitmap.height, @data[i]) spr.bitmap.draw_text(0, 0, spr.bitmap.width, spr.bitmap.height, @data[i])
case i case i
when 0 when 0
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, Audio.bgm_volume.to_s) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, Audio.bgm_volume.to_s)
when 1 when 1
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, Audio.sfx_volume.to_s) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, Audio.sfx_volume.to_s)
when 2 #fullscreen when 2 #fullscreen
if(Graphics.fullscreen == true) if(Graphics.fullscreen == true)
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, tr("ON")) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("ON"))
else else
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF")) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF"))
end end
when 3 #default movement when 3 #default movement
if($game_switches[251] == true) if($game_switches[251] == true)
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, tr("RUN")) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("RUN"))
else else
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, tr("WALK")) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("WALK"))
end end
when 4 #colorblind mode when 4 #colorblind mode
if($game_switches[252] == true) if($game_switches[252] == true)
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, tr("ON")) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("ON"))
else else
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF")) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF"))
end end
when 5 #frameskip when 5 #frameskip
if(Graphics.frameskip == true) if(Graphics.frameskip == true)
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, tr("ON")) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("ON"))
else else
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF")) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF"))
end end
when 6 # Language when 6 # Language
l = Language::LANGUAGES[@lang_index] rescue Language::LANGUAGES[0] l = Language::LANGUAGES[@lang_index] rescue Language::LANGUAGES[0]
spr.bitmap.draw_text(260, 0, spr.bitmap.width, spr.bitmap.height, l) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr(l))
end end
end end

View File

@ -4,7 +4,7 @@ Font.default_name = Language::FONT_WESTERN
class Language class Language
def self.create_input def self.create_input
input = Window_NameInput.new input = Window_NameInput.new
input.set_mode_buttons [['Upper', 'Lower']] input.set_mode_buttons [[tr('Upper'), tr('Lower')]]
input.character_tables = { input.character_tables = {
[0] => [ # Case: Upper [0] => [ # Case: Upper
"A","B","C","D","E","F","G","H","I","J", "A","B","C","D","E","F","G","H","I","J",

View File

@ -33,6 +33,7 @@ class Language
else else
Font.default_name = FONT_WESTERN Font.default_name = FONT_WESTERN
end end
Journal.setLang(name)
end end
end end
end end