diff --git a/binding-mri/niko-binding.cpp b/binding-mri/niko-binding.cpp index 368fccc..4d88151 100644 --- a/binding-mri/niko-binding.cpp +++ b/binding-mri/niko-binding.cpp @@ -16,7 +16,7 @@ RB_METHOD(nikoStart) RB_UNUSED_PARAM; // Calculate where to stick the window POINT pos; - pos.x = (9 * 16 - 4) * 2; + pos.x = 320 - 16; pos.y = (13 * 16) * 2; SDL_SysWMinfo syswindow; SDL_VERSION(&syswindow.version); @@ -28,8 +28,8 @@ RB_METHOD(nikoStart) WCHAR args[MAX_PATH]; GetModuleFileNameW(NULL, path, MAX_PATH); PathRemoveFileSpecW(path); - wcscat(path, L"\\___.exe"); - wsprintfW(args, L"___.exe %d %d", pos.x, pos.y); + wcscat(path, L"\\_______.exe"); + wsprintfW(args, L"_______.exe %d %d", pos.x, pos.y); STARTUPINFOW si; memset(&si, 0, sizeof(si)); si.cb = sizeof(si); diff --git a/binding-mri/wallpaper-binding.cpp b/binding-mri/wallpaper-binding.cpp index 1ce16bb..91e32f2 100644 --- a/binding-mri/wallpaper-binding.cpp +++ b/binding-mri/wallpaper-binding.cpp @@ -22,7 +22,8 @@ RB_METHOD(wallpaperSet) { RB_UNUSED_PARAM; const char *imageName; - rb_get_args(argc, argv, "z", &imageName RB_ARG_END); + int color; + rb_get_args(argc, argv, "zi", &imageName, &color RB_ARG_END); std::string imgname = shState->config().gameFolder + "/Wallpaper/" + imageName + ".bmp"; #ifdef _WIN32 // Crapify the slashes @@ -41,7 +42,6 @@ RB_METHOD(wallpaperSet) int colorId = COLOR_BACKGROUND; - int color = 0x1a041f; WCHAR zero[2] = L"0"; DWORD zeroSize = 4; diff --git a/journal/icon.ico b/journal/icon.ico new file mode 100644 index 0000000..5f6a983 Binary files /dev/null and b/journal/icon.ico differ diff --git a/journal/journal.cpp b/journal/journal.cpp index 9a05369..749fe37 100644 --- a/journal/journal.cpp +++ b/journal/journal.cpp @@ -1,4 +1,6 @@ #include +#include +#include #define DEFAULT_WIDTH 800 #define DEFAULT_HEIGHT 600 @@ -93,7 +95,15 @@ int do_journal() // Create HINSTANCE module = GetModuleHandleW(NULL); - loadImage("default"); + // Default image + WCHAR save_path[MAX_PATH]; + SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, 0, save_path); + wcscat(save_path, L"\\My Games\\Oneshot\\progress.oneshot"); + if (PathFileExistsW(save_path)) { + loadImage("save"); + } else { + loadImage("default"); + } // Initial image char message[IN_BUFFER_SIZE]; @@ -132,7 +142,7 @@ int do_journal() if (!RegisterClassEx(&wc)) return 1; - if (!(window = CreateWindowExW(WS_EX_COMPOSITED | WS_EX_LAYERED | WS_EX_TOPMOST, + if (!(window = CreateWindowExW(WS_EX_COMPOSITED | WS_EX_LAYERED, journal_classname, L"", WS_OVERLAPPEDWINDOW ^ (WS_THICKFRAME | WS_MAXIMIZEBOX), diff --git a/journal/journal.pro b/journal/journal.pro index 15b2533..6fab2f8 100644 --- a/journal/journal.pro +++ b/journal/journal.pro @@ -7,6 +7,6 @@ SOURCES += main.cpp \ niko.cpp \ journal.cpp -LIBS += -lgdi32 +LIBS += -lgdi32 -lshlwapi RC_FILE = resources.rc diff --git a/journal/resources.rc b/journal/resources.rc index e5e1a0c..3146119 100644 --- a/journal/resources.rc +++ b/journal/resources.rc @@ -1,4 +1,6 @@ #include +MAINICON ICON "icon.ico" + NIKO1 BITMAP "niko1.bmp" NIKO2 BITMAP "niko2.bmp" NIKO3 BITMAP "niko3.bmp" @@ -27,3 +29,9 @@ c4 BITMAP "c4.bmp" c5 BITMAP "c5.bmp" c6 BITMAP "c6.bmp" c7 BITMAP "c7.bmp" +s1 BITMAP "s1.bmp" +s2 BITMAP "s2.bmp" +s3 BITMAP "s3.bmp" +s4 BITMAP "s4.bmp" +save BITMAP "save.bmp" +final BITMAP "final.bmp" diff --git a/scripts/Game_Oneshot.rb b/scripts/Game_Oneshot.rb index 880794b..d05a932 100644 --- a/scripts/Game_Oneshot.rb +++ b/scripts/Game_Oneshot.rb @@ -5,6 +5,7 @@ class Game_Oneshot attr_accessor :player_name # map music (for battle memory) attr_accessor :plight_timer # start of plight's plight attr_accessor :wallpaper # the wallpaper that we should use + attr_accessor :wallpaper_color # the wallpaper color def initialize if $GDC @@ -27,13 +28,15 @@ class Game_Oneshot end module Wallpaper - def self.set_persistent(name) + def self.set_persistent(name, color) $game_oneshot.wallpaper = name - Wallpaper.set(name) + $game_oneshot.wallpaper_color = color + Wallpaper.set(name, color) end def self.reset_persistent $game_oneshot.wallpaper = nil + $game_oneshot.wallpaper_color = nil Wallpaper.reset end end