From 1f35ab104f1e703d7c7bd198439d7e0a900139ef Mon Sep 17 00:00:00 2001 From: Mathew Velasquez Date: Fri, 4 Nov 2016 05:28:39 -0400 Subject: [PATCH] Various last-minute beta fixes --- binding-mri/niko-binding.cpp | 6 +++--- binding-mri/wallpaper-binding.cpp | 4 ++-- journal/icon.ico | Bin 0 -> 3638 bytes journal/journal.cpp | 14 ++++++++++++-- journal/journal.pro | 2 +- journal/resources.rc | 8 ++++++++ scripts/Game_Oneshot.rb | 7 +++++-- 7 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 journal/icon.ico 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 0000000000000000000000000000000000000000..5f6a983771981034f3fba50c0ef895e99b641226 GIT binary patch literal 3638 zcmeHJOKuZE6s&f}c6o%cOs#MbJ^^}s5M9Q*7u=ZGYL&egQI&6DhI}PKW$Fk)HpiV@WQV1xmJ3?#^ z;RgYU3VslIfnO7T6nRmgYn^2j_*Jcfh;>~mAvR@M0*{UO`U7Zv;;$#6fX`ompC5qx zYhaz%A@#$p^Vx!}H@2PTEAZT6pWI^$@y%&OFAZ~;RMs(O4Dnj=T_gU=Fp2OZ%o!#b zp@?&cPaCdtdbIeo5kF>_cucLZo-H12;t?i{g1$VJJmR~UPZ$e&y!iYi65lSU%X!Au z)5YhHINreV2L6c~cyZtq@d5qSGxh0#`6u)tVJGu3spsV#TIZMT zsLyqCg#M1s`Pq08M*WRC={p^nJ;5+b2N+LVIP3R$24l7|kY!n#rh@@aU%nn)q00{9 z%n}!{3w_wLE@$9M;JnoN&_xHE!@j73{ yt7O?(c9*TY?vlT5GgjVBverd@|8{s?u9C7`cFXeaWH*G95PhAO<-;vs= +#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