shithub: cstory

Download patch

ref: 468aa2efc101427c566acc09420c6d4fdd3020e5
parent: 79bf011e3bd305dad0729d281cbb8755e8a40313
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Apr 23 05:50:15 EDT 2019

Added error message boxes to the TSC parser

--- a/src/TextScr.cpp
+++ b/src/TextScr.cpp
@@ -5,6 +5,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "SDL.h"
+
 #include "WindowsWrapper.h"
 
 #include "ArmsItem.h"
@@ -675,7 +677,13 @@
 						y = GetTextScriptNo(gTS.p_read + 19);
 						if (!TransferStage(z, w, x, y))
 						{
-						//	MessageBoxA(hWnd, "âXâeü[âWé¦ôÃé¦ì×é¦é+Ä©ös", "âGâëü[", 0);
+							#ifdef JAPANESE
+							SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "�G���[", "�X�e�[�W�̓ǂݍ��݂Ɏ��s", NULL);
+							#else
+							SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Failed to load stage", NULL);
+							#endif
+
+							//MessageBoxA(hWnd, "�X�e�[�W�̓ǂݍ��݂Ɏ��s", "�G���[", 0);
 							return 0;
 						}
 					}
@@ -1216,7 +1224,18 @@
 					}
 					else
 					{
-						printf("Unimplemented command: <%c%c%c\n", (char)gTS.data[gTS.p_read + 1], (char)gTS.data[gTS.p_read + 2], (char)gTS.data[gTS.p_read + 3]);
+						char str_0[0x40];
+
+						#ifdef JAPANESE
+						sprintf(str_0, "�s���̃R�[�h:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]);
+						SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "�G���[", str_0, NULL);
+						#else
+						sprintf(str_0, "Unknown code:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]);
+						SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", str_0, NULL);
+						#endif
+
+						//MessageBoxA(0, str_0, "�G���[", 0);
+
 						gTS.p_read += 4;
 						return 1;
 					}