Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.47 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. @@ -2623,6 +2623,10 @@
  111. .hero_lock = bound(condbuf(20), -99, 99)
  112. .menu_tag = bound(boxbuf(192), -max_tag(), max_tag())
  113. .menu = bound(boxbuf(199), 0 ,gen(genMaxMenu))
  114. + .game_tag = bound(boxbuf(207), -max_tag(), max_tag())
  115. + .game_delete = bound(boxbuf(208), -1, 32)
  116. + .game_save = bound(boxbuf(209), -2, 32)
  117. + .game_load = bound(boxbuf(210), -3, 32)
  118. '--Get box bitsets
  119. .choice_enabled = xreadbit(boxbuf(), 0, 174)
  120. .no_box = xreadbit(boxbuf(), 1, 174)
  121. @@ -2700,6 +2704,10 @@
  122. str2array condtemp, boxbuf(), 305
  123. boxbuf(192) = .menu_tag
  124. boxbuf(199) = .menu
  125. + boxbuf(207) = .game_tag
  126. + boxbuf(208) = .game_delete
  127. + boxbuf(209) = .game_save
  128. + boxbuf(210) = .game_load
  129. '--Save bitsets
  130. setbit boxbuf(), 174, 0, .choice_enabled
  131. setbit boxbuf(), 174, 1, .no_box
  132. @@ -2757,6 +2765,10 @@
  133. .hero_addrem = 0
  134. .hero_swap = 0
  135. .hero_lock = 0
  136. + .game_tag = 0
  137. + .game_delete = 0
  138. + .game_save = 0
  139. + .game_load = 0
  140. .after_tag = 0
  141. .after = 0
  142. .money_tag = 0
  143. Index: wip/textboxedit.bas
  144. ===================================================================
  145. --- wip/textboxedit.bas (revision 9709)
  146. +++ wip/textboxedit.bas (working copy)
  147. @@ -48,17 +48,20 @@
  148.  
  149.  
  150. 'These are used in the TextBox conditional editor
  151. -CONST condEXIT = -1
  152. -CONST condTAG = 0
  153. -CONST condBATTLE = 1
  154. -CONST condSHOP = 2
  155. -CONST condHERO = 3
  156. -CONST condMONEY = 4
  157. -CONST condDOOR = 5
  158. -CONST condITEM = 6
  159. -CONST condBOX = 7
  160. -CONST condMENU = 8
  161. -CONST condSETTAG = 9
  162. +CONST condEXIT = -1
  163. +CONST condTAG = 0
  164. +CONST condBATTLE = 1
  165. +CONST condSHOP = 2
  166. +CONST condHERO = 3
  167. +CONST condGAMEDELETE = 4
  168. +CONST condGAMESAVE = 5
  169. +CONST condGAMELOAD = 6
  170. +CONST condMONEY = 7
  171. +CONST condDOOR = 8
  172. +CONST condITEM = 9
  173. +CONST condBOX = 10
  174. +CONST condMENU = 11
  175. +CONST condSETTAG = 12
  176.  
  177. 'whichbox is the box to edit, -1 for default, or past last textbox to add a new
  178. 'one. Returns -1 if cancelled add-new, or else last box edited.
  179. @@ -318,17 +321,17 @@
  180.  
  181.  
  182. SUB textbox_conditionals(byref box as TextBox)
  183. - DIM menu(-1 TO 22) as string
  184. + DIM menu(-1 TO 26) as string
  185.  
  186. DIM state as MenuState
  187. state.top = -1
  188. state.pt = 0
  189. state.first = -1
  190. - state.last = 22
  191. + state.last = 26
  192. state.spacing = 9 'Necessary because not using standardmenu
  193. state.autosize = YES
  194.  
  195. - DIM grey(-1 TO 22) as integer
  196. + DIM grey(-1 TO 26) as integer
  197. 'This array tells which rows in the conditional editor are grey
  198. grey(-1) = NO
  199. grey(0) = YES
  200. @@ -352,8 +355,12 @@
  201. grey(18) = NO
  202. grey(19) = YES
  203. grey(20) = NO
  204. - grey(21) = YES 'Menu Tag
  205. + grey(21) = YES
  206. grey(22) = NO
  207. + grey(23) = NO
  208. + grey(24) = NO
  209. + grey(25) = YES 'Menu Tag
  210. + grey(26) = NO
  211.  
  212. DIM num as integer
  213. DIM temptrig as integer
  214. @@ -376,7 +383,7 @@
  215. temptrig = large(-box.instead, 0)
  216. scriptbrowse temptrig, plottrigger, "instead of textbox plotscript"
  217. box.instead = -temptrig
  218. - CASE 22 '--after script
  219. + CASE 26 '--after script
  220. temptrig = large(-box.after, 0)
  221. scriptbrowse temptrig, plottrigger, "after textbox plotscript"
  222. box.after = -temptrig
  223. @@ -405,6 +412,12 @@
  224. END IF
  225. CASE condHERO
  226. intgrabber num, -99, 99
  227. + CASE condGAMEDELETE
  228. + intgrabber num, -1, 32
  229. + CASE condGAMESAVE
  230. + intgrabber num, -2, 32
  231. + CASE condGAMELOAD
  232. + intgrabber num, -3, 32
  233. CASE condMONEY
  234. intgrabber num, -32000, 32000
  235. CASE condDOOR
  236. @@ -523,11 +536,30 @@
  237. menu(18) = " instantly use door " & box.door
  238. menu(19) = textbox_condition_caption(box.menu_tag, "MENU")
  239. menu(20) = " open menu " & box.menu & " " & getmenuname(box.menu)
  240. - menu(21) = textbox_condition_caption(box.after_tag, "AFTER")
  241. + menu(21) = textbox_condition_caption(box.game_tag, "GAME")
  242. + SELECT CASE box.game_delete
  243. + CASE 0 : menu(22) = " don't delete save slot"
  244. + CASE -1 : menu(22) = " delete active save slot"
  245. + CASE IS > 0 : menu(22) = " delete save slot " & box.game_delete
  246. + END SELECT
  247. + SELECT CASE box.game_save
  248. + CASE 0 : menu(23) = " don't save to slot"
  249. + CASE -1 : menu(23) = " save to active slot"
  250. + CASE -2 : menu(23) = " show save menu"
  251. + CASE IS > 0 : menu(23) = " save to slot " & box.game_save
  252. + END SELECT
  253. + SELECT CASE box.game_load
  254. + CASE 0 : menu(24) = " don't load from slot / game over"
  255. + CASE -1 : menu(24) = " load from active slot"
  256. + CASE -2 : menu(24) = " show load menu"
  257. + CASE -3 : menu(24) = " game over"
  258. + CASE IS > 0 : menu(24) = " load from slot " & box.game_load
  259. + END SELECT
  260. + menu(25) = textbox_condition_caption(box.after_tag, "AFTER")
  261. SELECT CASE box.after
  262. - CASE 0 : menu(22) = " use [text box or script] next"
  263. - CASE IS < 0 : menu(22) = " run " & scriptname(-box.after) & " next"
  264. - CASE IS > 0 : menu(22) = " jump to text box " & box.after & " next"
  265. + CASE 0 : menu(26) = " use [text box or script] next"
  266. + CASE IS < 0 : menu(26) = " run " & scriptname(-box.after) & " next"
  267. + CASE IS > 0 : menu(26) = " jump to text box " & box.after & " next"
  268. END SELECT
  269. END SUB
  270.  
  271. @@ -658,8 +690,12 @@
  272. CASE 18: .door = num
  273. CASE 19: .menu_tag = num
  274. CASE 20: .menu = num
  275. - CASE 21: .after_tag = num
  276. - CASE 22: .after = num
  277. + CASE 21: .game_tag = num
  278. + CASE 22: .game_delete = num
  279. + CASE 23: .game_save = num
  280. + CASE 24: .game_load = num
  281. + CASE 25: .after_tag = num
  282. + CASE 26: .after = num
  283. END SELECT
  284. END WITH
  285. END SUB
  286. @@ -688,8 +724,12 @@
  287. CASE 18: RETURN .door
  288. CASE 19: RETURN .menu_tag
  289. CASE 20: RETURN .menu
  290. - CASE 21: RETURN .after_tag
  291. - CASE 22: RETURN .after
  292. + CASE 21: RETURN .game_tag
  293. + CASE 22: RETURN .game_delete
  294. + CASE 23: RETURN .game_save
  295. + CASE 24: RETURN .game_load
  296. + CASE 25: RETURN .after_tag
  297. + CASE 26: RETURN .after
  298. END SELECT
  299. END WITH
  300. END FUNCTION
  301. @@ -697,7 +737,7 @@
  302. FUNCTION box_conditional_type_by_menu_index(menuindex as integer) as integer
  303. SELECT CASE menuindex
  304. CASE -1 : RETURN condEXIT
  305. - CASE 1, 22 : RETURN condBOX
  306. + CASE 1, 26 : RETURN condBOX
  307. CASE 3, 4 : RETURN condSETTAG
  308. CASE 6 : RETURN condMONEY
  309. CASE 8 : RETURN condBATTLE
  310. @@ -706,6 +746,9 @@
  311. CASE 14,15,16: RETURN condHERO
  312. CASE 18 : RETURN condDOOR
  313. CASE 20 : RETURN condMENU
  314. + CASE 22 : RETURN condGAMEDELETE
  315. + CASE 23 : RETURN condGAMESAVE
  316. + CASE 24 : RETURN condGAMELOAD
  317. CASE ELSE : RETURN condTAG
  318. END SELECT
  319. END FUNCTION
  320. @@ -1554,6 +1597,14 @@
  321. box.menu_tag = VALINT(v)
  322. CASE "menu"
  323. box.menu = VALINT(v)
  324. + CASE "game tag"
  325. + box.game_tag = VALINT(v)
  326. + CASE "game delete"
  327. + box.game_delete = VALINT(v)
  328. + CASE "game save"
  329. + box.game_save = VALINT(v)
  330. + CASE "game load"
  331. + box.game_load = VALINT(v)
  332. CASE "next tag"
  333. box.after_tag = VALINT(v)
  334. CASE "next box"
  335. @@ -1733,6 +1784,44 @@
  336.  
  337. END IF
  338.  
  339. + IF box.game_tag <> 0 THEN
  340. + PRINT #fh, "Game Tag: " & box.game_tag & " (" & escape_nonprintable_ascii(tag_condition_caption(box.game_tag, , "Never")) & ")"
  341. +
  342. + IF box.game_delete <> 0 THEN
  343. + PRINT #fh, "Game Delete: " & box.game_delete;
  344. + IF box.game_delete = -1 THEN
  345. + PRINT #fh, " (Delete active save slot)"
  346. + ELSE
  347. + PRINT #fh, " (Delete save slot " & box.game_delete & ")"
  348. + END IF
  349. + END IF
  350. +
  351. + IF box.game_save <> 0 THEN
  352. + PRINT #fh, "Game Save: " & box.game_save;
  353. + IF box.game_save = -1 THEN
  354. + PRINT #fh, " (Save to active slot)"
  355. + ELSEIF box.game_save = -2 THEN
  356. + PRINT #fh, " (Show save menu)"
  357. + ELSE
  358. + PRINT #fh, " (Save to slot " & box.game_save & ")"
  359. + END IF
  360. + END IF
  361. +
  362. + IF box.game_load <> 0 THEN
  363. + PRINT #fh, "Game Load: " & box.game_load;
  364. + IF box.game_load = -1 THEN
  365. + PRINT #fh, " (Load from active slot)"
  366. + ELSEIF box.game_load = -2 THEN
  367. + PRINT #fh, " (Show load menu)"
  368. + ELSEIF box.game_load = -3 THEN
  369. + PRINT #fh, " (Game over)"
  370. + ELSE
  371. + PRINT #fh, " (Load from slot " & box.game_load & ")"
  372. + END IF
  373. + END IF
  374. +
  375. + END IF
  376. +
  377. IF box.money_tag <> 0 THEN
  378. PRINT #fh, "Money Tag: " & box.money_tag & " (" & escape_nonprintable_ascii(tag_condition_caption(box.money_tag, , "Never")) & ")"
  379. PRINT #fh, "Money: " & box.money
  380. Index: wip/udts.bi
  381. ===================================================================
  382. --- wip/udts.bi (revision 9709)
  383. +++ wip/udts.bi (working copy)
  384. @@ -886,6 +886,10 @@
  385. hero_addrem as integer
  386. hero_swap as integer
  387. hero_lock as integer
  388. + game_tag as integer
  389. + game_delete as integer
  390. + game_save as integer
  391. + game_load as integer
  392. after_tag as integer
  393. after as integer
  394. money_tag as integer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement