Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.08 KB | None | 0 0
  1. Index: wip/common.rbas
  2. ===================================================================
  3. --- wip/common.rbas (revision 9709)
  4. +++ wip/common.rbas (working copy)
  5. @@ -982,7 +982,7 @@
  6. IF id = binMENUS THEN RETURN 54 'menus.bin
  7. IF id = binMENUITEM THEN RETURN 64 'menuitem.bin
  8. IF id = binUICOLORS THEN RETURN 126 'uicolors.bin
  9. - IF id = binSAY THEN RETURN 414 '.say
  10. + IF id = binSAY THEN RETURN 422 '.say
  11. IF id = binN THEN RETURN 38 '.n##
  12. IF id = binDT0 THEN RETURN 858 '.dt0
  13. IF id = binDT1 THEN RETURN 742 '.dt1
  14. @@ -3526,6 +3526,10 @@
  15. .choice_tag(0) = 0
  16. .choice(1) = ""
  17. .choice_tag(1) = 0
  18. + .game_tag = 0
  19. + .game_delete = 0
  20. + .game_save = 0
  21. + .game_load = 0
  22. .menu_tag = 0
  23. .vertical_offset = 0
  24. .shrink = 0
  25. Index: wip/game.bas
  26. ===================================================================
  27. --- wip/game.bas (revision 9709)
  28. +++ wip/game.bas (working copy)
  29. @@ -3431,6 +3431,8 @@
  30. END IF
  31. '---ADD/REMOVE/SWAP/LOCK HERO-----------------
  32. IF istag(txt.box.hero_tag, 0) THEN add_rem_swap_lock_hero txt.box
  33. + '---DELETE/SAVE/LOAD GAME-----------------
  34. + IF istag(txt.box.game_tag, 0) THEN delete_save_load_game txt.box
  35. '---FORCE DOOR------
  36. IF istag(txt.box.door_tag, 0) THEN
  37. usedoor txt.box.door
  38. @@ -3526,6 +3528,47 @@
  39. party_change_updates
  40. END SUB
  41.  
  42. +SUB delete_save_load_game (byref box as TextBox)
  43. + '---/DELETE/SAVE/LOAD
  44. + '---DELETE---
  45. + IF box.game_delete = -1 THEN
  46. + IF valid_save_slot(lastsaveslot) THEN
  47. + erase_save_slot lastsaveslot - 1
  48. + END IF
  49. + ELSEIF box.game_delete > 0 THEN
  50. + IF valid_save_slot(box.game_delete) THEN
  51. + erase_save_slot box.game_delete - 1
  52. + END IF
  53. + END IF
  54. + '---SAVE---
  55. + IF box.game_save = -2 THEN
  56. + DIM slot as integer = picksave()
  57. + IF slot >= 0 THEN savegame slot
  58. + ELSEIF box.game_save = -1 THEN
  59. + IF valid_save_slot(lastsaveslot) THEN
  60. + savegame lastsaveslot - 1
  61. + END IF
  62. + ELSEIF box.game_save > 0 THEN
  63. + IF valid_save_slot(box.game_save) THEN
  64. + savegame box.game_save - 1
  65. + END IF
  66. + END IF
  67. + '---LOAD---
  68. + IF box.game_load = -3 THEN
  69. + gam.quit = YES
  70. + ELSEIF box.game_load = -2 THEN
  71. + gam.want.loadgame = pickload(NO) + 1
  72. + ELSEIF box.game_load = -1 THEN
  73. + IF save_slot_used(lastsaveslot) THEN
  74. + gam.want.loadgame = lastsaveslot
  75. + END IF
  76. + ELSEIF box.game_load > 0 THEN
  77. + IF save_slot_used(box.game_load - 1) THEN
  78. + gam.want.loadgame = box.game_load
  79. + END IF
  80. + END IF
  81. +END SUB
  82. +
  83. SUB init_text_box_slices(txt as TextBoxState)
  84. IF txt.sl THEN
  85. '--free any already-loaded textbox
  86. @@ -4649,6 +4692,7 @@
  87. after &= box_cond_info(txt.box.item_tag, "Item")
  88. after &= box_cond_info(txt.box.shop_tag, "Shop/Inn")
  89. after &= box_cond_info(txt.box.hero_tag, "Party change")
  90. + after &= box_cond_info(txt.box.game_tag, "Game saving")
  91. IF txt.box.restore_music THEN after &= "[Restore music] "
  92. IF txt.box.backdrop THEN after &= "[Remove backdrop] "
  93. IF LEN(after) THEN
  94. Index: wip/game.bi
  95. ===================================================================
  96. --- wip/game.bi (revision 9709)
  97. +++ wip/game.bi (working copy)
  98. @@ -47,6 +47,7 @@
  99. DECLARE SUB cleanup_text_box ()
  100. DECLARE SUB advance_text_box ()
  101. DECLARE SUB add_rem_swap_lock_hero (box as TextBox)
  102. +DECLARE SUB delete_save_load_game (box as TextBox)
  103. DECLARE FUNCTION immediate_showtextbox() as bool
  104.  
  105. DECLARE SUB SetupGameSlices
  106. Index: wip/loading.rbas
  107. ===================================================================
  108. --- wip/loading.rbas (revision 9709)
  109. +++ wip/loading.rbas (working copy)
  110. @@ -2595,7 +2595,7 @@
  111. '--Gather conditional data
  112. '--transpose conditional data from its dumb-as-toast non-int-aligned location
  113. DIM condtemp as string
  114. - DIM condbuf(20) as integer
  115. + DIM condbuf(24) as integer
  116. condtemp = STRING(42, 0)
  117. array2str boxbuf(), 305, condtemp
  118. str2array condtemp, condbuf(), 0
  119. @@ -2623,6 +2623,10 @@
  120. .hero_lock = bound(condbuf(20), -99, 99)
  121. .menu_tag = bound(boxbuf(192), -max_tag(), max_tag())
  122. .menu = bound(boxbuf(199), 0 ,gen(genMaxMenu))
  123. + .game_tag = bound(boxbuf(207), -max_tag(), max_tag())
  124. + .game_delete = bound(boxbuf(208), -1, 32)
  125. + .game_save = bound(boxbuf(209), -2, 32)
  126. + .game_load = bound(boxbuf(210), -3, 32)
  127. '--Get box bitsets
  128. .choice_enabled = xreadbit(boxbuf(), 0, 174)
  129. .no_box = xreadbit(boxbuf(), 1, 174)
  130. @@ -2672,7 +2676,7 @@
  131. str2array rpad(.text(i), CHR(0), 38), boxbuf(), i * 38
  132. NEXT i
  133. '--Transcribe conditional data
  134. - DIM condbuf(20) as integer
  135. + DIM condbuf(24) as integer
  136. condbuf(0) = .instead_tag
  137. condbuf(1) = .instead
  138. condbuf(2) = .settag_tag
  139. @@ -2700,6 +2704,10 @@
  140. str2array condtemp, boxbuf(), 305
  141. boxbuf(192) = .menu_tag
  142. boxbuf(199) = .menu
  143. + boxbuf(207) = .game_tag
  144. + boxbuf(208) = .game_delete
  145. + boxbuf(209) = .game_save
  146. + boxbuf(210) = .game_load
  147. '--Save bitsets
  148. setbit boxbuf(), 174, 0, .choice_enabled
  149. setbit boxbuf(), 174, 1, .no_box
  150. @@ -2757,6 +2765,10 @@
  151. .hero_addrem = 0
  152. .hero_swap = 0
  153. .hero_lock = 0
  154. + .game_tag = 0
  155. + .game_delete = 0
  156. + .game_save = 0
  157. + .game_load = 0
  158. .after_tag = 0
  159. .after = 0
  160. .money_tag = 0
  161. Index: wip/textboxedit.bas
  162. ===================================================================
  163. --- wip/textboxedit.bas (revision 9709)
  164. +++ wip/textboxedit.bas (working copy)
  165. @@ -48,17 +48,20 @@
  166.  
  167.  
  168. 'These are used in the TextBox conditional editor
  169. -CONST condEXIT = -1
  170. -CONST condTAG = 0
  171. -CONST condBATTLE = 1
  172. -CONST condSHOP = 2
  173. -CONST condHERO = 3
  174. -CONST condMONEY = 4
  175. -CONST condDOOR = 5
  176. -CONST condITEM = 6
  177. -CONST condBOX = 7
  178. -CONST condMENU = 8
  179. -CONST condSETTAG = 9
  180. +CONST condEXIT = -1
  181. +CONST condTAG = 0
  182. +CONST condBATTLE = 1
  183. +CONST condSHOP = 2
  184. +CONST condHERO = 3
  185. +CONST condGAMEDELETE = 4
  186. +CONST condGAMESAVE = 5
  187. +CONST condGAMELOAD = 6
  188. +CONST condMONEY = 7
  189. +CONST condDOOR = 8
  190. +CONST condITEM = 9
  191. +CONST condBOX = 10
  192. +CONST condMENU = 11
  193. +CONST condSETTAG = 12
  194.  
  195. 'whichbox is the box to edit, -1 for default, or past last textbox to add a new
  196. 'one. Returns -1 if cancelled add-new, or else last box edited.
  197. @@ -318,17 +321,17 @@
  198.  
  199.  
  200. SUB textbox_conditionals(byref box as TextBox)
  201. - DIM menu(-1 TO 22) as string
  202. + DIM menu(-1 TO 26) as string
  203.  
  204. DIM state as MenuState
  205. state.top = -1
  206. state.pt = 0
  207. state.first = -1
  208. - state.last = 22
  209. + state.last = 26
  210. state.spacing = 9 'Necessary because not using standardmenu
  211. state.autosize = YES
  212.  
  213. - DIM grey(-1 TO 22) as integer
  214. + DIM grey(-1 TO 26) as integer
  215. 'This array tells which rows in the conditional editor are grey
  216. grey(-1) = NO
  217. grey(0) = YES
  218. @@ -352,8 +355,12 @@
  219. grey(18) = NO
  220. grey(19) = YES
  221. grey(20) = NO
  222. - grey(21) = YES 'Menu Tag
  223. + grey(21) = YES
  224. grey(22) = NO
  225. + grey(23) = NO
  226. + grey(24) = NO
  227. + grey(25) = YES 'Menu Tag
  228. + grey(26) = NO
  229.  
  230. DIM num as integer
  231. DIM temptrig as integer
  232. @@ -376,7 +383,7 @@
  233. temptrig = large(-box.instead, 0)
  234. scriptbrowse temptrig, plottrigger, "instead of textbox plotscript"
  235. box.instead = -temptrig
  236. - CASE 22 '--after script
  237. + CASE 26 '--after script
  238. temptrig = large(-box.after, 0)
  239. scriptbrowse temptrig, plottrigger, "after textbox plotscript"
  240. box.after = -temptrig
  241. @@ -405,6 +412,12 @@
  242. END IF
  243. CASE condHERO
  244. intgrabber num, -99, 99
  245. + CASE condGAMEDELETE
  246. + intgrabber num, -1, 32
  247. + CASE condGAMESAVE
  248. + intgrabber num, -2, 32
  249. + CASE condGAMELOAD
  250. + intgrabber num, -3, 32
  251. CASE condMONEY
  252. intgrabber num, -32000, 32000
  253. CASE condDOOR
  254. @@ -523,11 +536,30 @@
  255. menu(18) = " instantly use door " & box.door
  256. menu(19) = textbox_condition_caption(box.menu_tag, "MENU")
  257. menu(20) = " open menu " & box.menu & " " & getmenuname(box.menu)
  258. - menu(21) = textbox_condition_caption(box.after_tag, "AFTER")
  259. + menu(21) = textbox_condition_caption(box.game_tag, "GAME")
  260. + SELECT CASE box.game_delete
  261. + CASE 0 : menu(22) = " don't delete save slot"
  262. + CASE -1 : menu(22) = " delete active save slot"
  263. + CASE IS > 0 : menu(22) = " delete save slot " & box.game_delete
  264. + END SELECT
  265. + SELECT CASE box.game_save
  266. + CASE 0 : menu(23) = " don't save to slot"
  267. + CASE -1 : menu(23) = " save to active slot"
  268. + CASE -2 : menu(23) = " show save menu"
  269. + CASE IS > 0 : menu(23) = " save to slot " & box.game_save
  270. + END SELECT
  271. + SELECT CASE box.game_load
  272. + CASE 0 : menu(24) = " don't load from slot / game over"
  273. + CASE -1 : menu(24) = " load from active slot"
  274. + CASE -2 : menu(24) = " show load menu"
  275. + CASE -3 : menu(24) = " game over"
  276. + CASE IS > 0 : menu(24) = " load from slot " & box.game_load
  277. + END SELECT
  278. + menu(25) = textbox_condition_caption(box.after_tag, "AFTER")
  279. SELECT CASE box.after
  280. - CASE 0 : menu(22) = " use [text box or script] next"
  281. - CASE IS < 0 : menu(22) = " run " & scriptname(-box.after) & " next"
  282. - CASE IS > 0 : menu(22) = " jump to text box " & box.after & " next"
  283. + CASE 0 : menu(26) = " use [text box or script] next"
  284. + CASE IS < 0 : menu(26) = " run " & scriptname(-box.after) & " next"
  285. + CASE IS > 0 : menu(26) = " jump to text box " & box.after & " next"
  286. END SELECT
  287. END SUB
  288.  
  289. @@ -658,8 +690,12 @@
  290. CASE 18: .door = num
  291. CASE 19: .menu_tag = num
  292. CASE 20: .menu = num
  293. - CASE 21: .after_tag = num
  294. - CASE 22: .after = num
  295. + CASE 21: .game_tag = num
  296. + CASE 22: .game_delete = num
  297. + CASE 23: .game_save = num
  298. + CASE 24: .game_load = num
  299. + CASE 25: .after_tag = num
  300. + CASE 26: .after = num
  301. END SELECT
  302. END WITH
  303. END SUB
  304. @@ -688,8 +724,12 @@
  305. CASE 18: RETURN .door
  306. CASE 19: RETURN .menu_tag
  307. CASE 20: RETURN .menu
  308. - CASE 21: RETURN .after_tag
  309. - CASE 22: RETURN .after
  310. + CASE 21: RETURN .game_tag
  311. + CASE 22: RETURN .game_delete
  312. + CASE 23: RETURN .game_save
  313. + CASE 24: RETURN .game_load
  314. + CASE 25: RETURN .after_tag
  315. + CASE 26: RETURN .after
  316. END SELECT
  317. END WITH
  318. END FUNCTION
  319. @@ -697,7 +737,7 @@
  320. FUNCTION box_conditional_type_by_menu_index(menuindex as integer) as integer
  321. SELECT CASE menuindex
  322. CASE -1 : RETURN condEXIT
  323. - CASE 1, 22 : RETURN condBOX
  324. + CASE 1, 26 : RETURN condBOX
  325. CASE 3, 4 : RETURN condSETTAG
  326. CASE 6 : RETURN condMONEY
  327. CASE 8 : RETURN condBATTLE
  328. @@ -706,6 +746,9 @@
  329. CASE 14,15,16: RETURN condHERO
  330. CASE 18 : RETURN condDOOR
  331. CASE 20 : RETURN condMENU
  332. + CASE 22 : RETURN condGAMEDELETE
  333. + CASE 23 : RETURN condGAMESAVE
  334. + CASE 24 : RETURN condGAMELOAD
  335. CASE ELSE : RETURN condTAG
  336. END SELECT
  337. END FUNCTION
  338. @@ -1554,6 +1597,14 @@
  339. box.menu_tag = VALINT(v)
  340. CASE "menu"
  341. box.menu = VALINT(v)
  342. + CASE "game tag"
  343. + box.game_tag = VALINT(v)
  344. + CASE "game delete"
  345. + box.game_delete = VALINT(v)
  346. + CASE "game save"
  347. + box.game_save = VALINT(v)
  348. + CASE "game load"
  349. + box.game_load = VALINT(v)
  350. CASE "next tag"
  351. box.after_tag = VALINT(v)
  352. CASE "next box"
  353. @@ -1733,6 +1784,44 @@
  354.  
  355. END IF
  356.  
  357. + IF box.game_tag <> 0 THEN
  358. + PRINT #fh, "Game Tag: " & box.game_tag & " (" & escape_nonprintable_ascii(tag_condition_caption(box.game_tag, , "Never")) & ")"
  359. +
  360. + IF box.game_delete <> 0 THEN
  361. + PRINT #fh, "Game Delete: " & box.game_delete;
  362. + IF box.game_delete = -1 THEN
  363. + PRINT #fh, " (Delete active save slot)"
  364. + ELSE
  365. + PRINT #fh, " (Delete save slot " & (box.game_delete - 1) & ")"
  366. + END IF
  367. + END IF
  368. +
  369. + IF box.game_save <> 0 THEN
  370. + PRINT #fh, "Game Save: " & box.game_save;
  371. + IF box.game_save = -1 THEN
  372. + PRINT #fh, " (Save to active slot)"
  373. + ELSEIF box.game_save = -2 THEN
  374. + PRINT #fh, " (Show save menu)"
  375. + ELSE
  376. + PRINT #fh, " (Save to slot " & (box.game_save - 1) & ")"
  377. + END IF
  378. + END IF
  379. +
  380. + IF box.game_load <> 0 THEN
  381. + PRINT #fh, "Game Load: " & box.game_load;
  382. + IF box.game_load = -1 THEN
  383. + PRINT #fh, " (Load from active slot)"
  384. + ELSEIF box.game_load = -2 THEN
  385. + PRINT #fh, " (Show load menu)"
  386. + ELSEIF box.game_load = -3 THEN
  387. + PRINT #fh, " (Game over)"
  388. + ELSE
  389. + PRINT #fh, " (Load from slot " & (box.game_load - 1) & ")"
  390. + END IF
  391. + END IF
  392. +
  393. + END IF
  394. +
  395. IF box.money_tag <> 0 THEN
  396. PRINT #fh, "Money Tag: " & box.money_tag & " (" & escape_nonprintable_ascii(tag_condition_caption(box.money_tag, , "Never")) & ")"
  397. PRINT #fh, "Money: " & box.money
  398. Index: wip/udts.bi
  399. ===================================================================
  400. --- wip/udts.bi (revision 9709)
  401. +++ wip/udts.bi (working copy)
  402. @@ -886,6 +886,10 @@
  403. hero_addrem as integer
  404. hero_swap as integer
  405. hero_lock as integer
  406. + game_tag as integer
  407. + game_delete as integer
  408. + game_save as integer
  409. + game_load as integer
  410. after_tag as integer
  411. after as integer
  412. money_tag as integer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement