Browse Source

derestrict l10n template generator, parser & usage, makes translation of mod version possible

Pal Lockheart 6 years ago
parent
commit
02e5d994c6
3 changed files with 9 additions and 1 deletions
  1. 3 0
      script.c
  2. 5 0
      scripts/makemessage.py
  3. 1 1
      text.c

+ 3 - 0
script.c

@@ -3300,6 +3300,9 @@ PAL_RunTriggerScript(
 			   else
                   PAL_ShowDialogText(PAL_GetMsg(iMsg));
             }
+            if( gpGlobals->g.lprgScriptEntry[wScriptEntry+1].wOperation == 0xFFFF && gpGlobals->g.lprgScriptEntry[wScriptEntry+1].rgwOperand[0] != pScript->rgwOperand[0] + 1)
+			   wScriptEntry++;
+            else
             while (gpGlobals->g.lprgScriptEntry[wScriptEntry].wOperation == 0xFFFF
                 || gpGlobals->g.lprgScriptEntry[wScriptEntry].wOperation == 0x008E)
             {

+ 5 - 0
scripts/makemessage.py

@@ -231,6 +231,11 @@ def main():
     for i in range(0, len(script_bytes) / 8):
         op, w1, w2, w3 = struct.unpack('<HHHH', script_bytes[i * 8 : (i + 1) * 8])
         if op == 0xFFFF:
+            if is_msg_group == 1 and last_index + 1 != w1:
+                is_msg_group = 0
+                temp = "%s %d\n\n" % ('[END MESSAGE]', last_index)
+                message += temp
+                output += comment + message
 
             if is_msg_group == 0:
                 is_msg_group = 1

+ 1 - 1
text.c

@@ -197,7 +197,7 @@ PAL_ReadMessageFile(
 				if (*buffer && *buffer != '#')
 				{
 					if (strncmp(buffer, "[BEGIN MESSAGE]", 15) == 0 &&
-						sscanf(buffer + 15, "%d", &sid) == 1 && sid > eid)
+						sscanf(buffer + 15, "%d", &sid) == 1)
 					{
 						state = ST_DIALOG;
 						//