Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: wip/common.rbas
- ===================================================================
- --- wip/common.rbas (revision 9709)
- +++ wip/common.rbas (working copy)
- @@ -982,7 +982,7 @@
- IF id = binMENUS THEN RETURN 54 'menus.bin
- IF id = binMENUITEM THEN RETURN 64 'menuitem.bin
- IF id = binUICOLORS THEN RETURN 126 'uicolors.bin
- - IF id = binSAY THEN RETURN 414 '.say
- + IF id = binSAY THEN RETURN 422 '.say
- IF id = binN THEN RETURN 38 '.n##
- IF id = binDT0 THEN RETURN 858 '.dt0
- IF id = binDT1 THEN RETURN 742 '.dt1
- @@ -3526,6 +3526,10 @@
- .choice_tag(0) = 0
- .choice(1) = ""
- .choice_tag(1) = 0
- + .game_tag = 0
- + .game_delete = 0
- + .game_save = 0
- + .game_load = 0
- .menu_tag = 0
- .vertical_offset = 0
- .shrink = 0
- Index: wip/game.bas
- ===================================================================
- --- wip/game.bas (revision 9709)
- +++ wip/game.bas (working copy)
- @@ -3431,6 +3431,8 @@
- END IF
- '---ADD/REMOVE/SWAP/LOCK HERO-----------------
- IF istag(txt.box.hero_tag, 0) THEN add_rem_swap_lock_hero txt.box
- + '---DELETE/SAVE/LOAD GAME-----------------
- + IF istag(txt.box.game_tag, 0) THEN delete_save_load_game txt.box
- '---FORCE DOOR------
- IF istag(txt.box.door_tag, 0) THEN
- usedoor txt.box.door
- @@ -3526,6 +3528,47 @@
- party_change_updates
- END SUB
- +SUB delete_save_load_game (byref box as TextBox)
- + '---/DELETE/SAVE/LOAD
- + '---DELETE---
- + IF box.game_delete = -1 THEN
- + IF valid_save_slot(lastsaveslot) THEN
- + erase_save_slot lastsaveslot - 1
- + END IF
- + ELSEIF box.game_delete > 0 THEN
- + IF valid_save_slot(box.game_delete) THEN
- + erase_save_slot box.game_delete - 1
- + END IF
- + END IF
- + '---SAVE---
- + IF box.game_save = -2 THEN
- + DIM slot as integer = picksave()
- + IF slot >= 0 THEN savegame slot
- + ELSEIF box.game_save = -1 THEN
- + IF valid_save_slot(lastsaveslot) THEN
- + savegame lastsaveslot - 1
- + END IF
- + ELSEIF box.game_save > 0 THEN
- + IF valid_save_slot(box.game_save) THEN
- + savegame box.game_save - 1
- + END IF
- + END IF
- + '---LOAD---
- + IF box.game_load = -3 THEN
- + gam.quit = YES
- + ELSEIF box.game_load = -2 THEN
- + gam.want.loadgame = pickload(NO) + 1
- + ELSEIF box.game_load = -1 THEN
- + IF save_slot_used(lastsaveslot) THEN
- + gam.want.loadgame = lastsaveslot
- + END IF
- + ELSEIF box.game_load > 0 THEN
- + IF save_slot_used(box.game_load - 1) THEN
- + gam.want.loadgame = box.game_load
- + END IF
- + END IF
- +END SUB
- +
- SUB init_text_box_slices(txt as TextBoxState)
- IF txt.sl THEN
- '--free any already-loaded textbox
- @@ -4649,6 +4692,7 @@
- after &= box_cond_info(txt.box.item_tag, "Item")
- after &= box_cond_info(txt.box.shop_tag, "Shop/Inn")
- after &= box_cond_info(txt.box.hero_tag, "Party change")
- + after &= box_cond_info(txt.box.game_tag, "Game saving")
- IF txt.box.restore_music THEN after &= "[Restore music] "
- IF txt.box.backdrop THEN after &= "[Remove backdrop] "
- IF LEN(after) THEN
- Index: wip/game.bi
- ===================================================================
- --- wip/game.bi (revision 9709)
- +++ wip/game.bi (working copy)
- @@ -47,6 +47,7 @@
- DECLARE SUB cleanup_text_box ()
- DECLARE SUB advance_text_box ()
- DECLARE SUB add_rem_swap_lock_hero (box as TextBox)
- +DECLARE SUB delete_save_load_game (box as TextBox)
- DECLARE FUNCTION immediate_showtextbox() as bool
- DECLARE SUB SetupGameSlices
- Index: wip/loading.rbas
- ===================================================================
- --- wip/loading.rbas (revision 9709)
- +++ wip/loading.rbas (working copy)
- @@ -2595,7 +2595,7 @@
- '--Gather conditional data
- '--transpose conditional data from its dumb-as-toast non-int-aligned location
- DIM condtemp as string
- - DIM condbuf(20) as integer
- + DIM condbuf(24) as integer
- condtemp = STRING(42, 0)
- array2str boxbuf(), 305, condtemp
- str2array condtemp, condbuf(), 0
- @@ -2623,6 +2623,10 @@
- .hero_lock = bound(condbuf(20), -99, 99)
- .menu_tag = bound(boxbuf(192), -max_tag(), max_tag())
- .menu = bound(boxbuf(199), 0 ,gen(genMaxMenu))
- + .game_tag = bound(boxbuf(207), -max_tag(), max_tag())
- + .game_delete = bound(boxbuf(208), -1, 32)
- + .game_save = bound(boxbuf(209), -2, 32)
- + .game_load = bound(boxbuf(210), -3, 32)
- '--Get box bitsets
- .choice_enabled = xreadbit(boxbuf(), 0, 174)
- .no_box = xreadbit(boxbuf(), 1, 174)
- @@ -2672,7 +2676,7 @@
- str2array rpad(.text(i), CHR(0), 38), boxbuf(), i * 38
- NEXT i
- '--Transcribe conditional data
- - DIM condbuf(20) as integer
- + DIM condbuf(24) as integer
- condbuf(0) = .instead_tag
- condbuf(1) = .instead
- condbuf(2) = .settag_tag
- @@ -2700,6 +2704,10 @@
- str2array condtemp, boxbuf(), 305
- boxbuf(192) = .menu_tag
- boxbuf(199) = .menu
- + boxbuf(207) = .game_tag
- + boxbuf(208) = .game_delete
- + boxbuf(209) = .game_save
- + boxbuf(210) = .game_load
- '--Save bitsets
- setbit boxbuf(), 174, 0, .choice_enabled
- setbit boxbuf(), 174, 1, .no_box
- @@ -2757,6 +2765,10 @@
- .hero_addrem = 0
- .hero_swap = 0
- .hero_lock = 0
- + .game_tag = 0
- + .game_delete = 0
- + .game_save = 0
- + .game_load = 0
- .after_tag = 0
- .after = 0
- .money_tag = 0
- Index: wip/textboxedit.bas
- ===================================================================
- --- wip/textboxedit.bas (revision 9709)
- +++ wip/textboxedit.bas (working copy)
- @@ -48,17 +48,20 @@
- 'These are used in the TextBox conditional editor
- -CONST condEXIT = -1
- -CONST condTAG = 0
- -CONST condBATTLE = 1
- -CONST condSHOP = 2
- -CONST condHERO = 3
- -CONST condMONEY = 4
- -CONST condDOOR = 5
- -CONST condITEM = 6
- -CONST condBOX = 7
- -CONST condMENU = 8
- -CONST condSETTAG = 9
- +CONST condEXIT = -1
- +CONST condTAG = 0
- +CONST condBATTLE = 1
- +CONST condSHOP = 2
- +CONST condHERO = 3
- +CONST condGAMEDELETE = 4
- +CONST condGAMESAVE = 5
- +CONST condGAMELOAD = 6
- +CONST condMONEY = 7
- +CONST condDOOR = 8
- +CONST condITEM = 9
- +CONST condBOX = 10
- +CONST condMENU = 11
- +CONST condSETTAG = 12
- 'whichbox is the box to edit, -1 for default, or past last textbox to add a new
- 'one. Returns -1 if cancelled add-new, or else last box edited.
- @@ -318,17 +321,17 @@
- SUB textbox_conditionals(byref box as TextBox)
- - DIM menu(-1 TO 22) as string
- + DIM menu(-1 TO 26) as string
- DIM state as MenuState
- state.top = -1
- state.pt = 0
- state.first = -1
- - state.last = 22
- + state.last = 26
- state.spacing = 9 'Necessary because not using standardmenu
- state.autosize = YES
- - DIM grey(-1 TO 22) as integer
- + DIM grey(-1 TO 26) as integer
- 'This array tells which rows in the conditional editor are grey
- grey(-1) = NO
- grey(0) = YES
- @@ -352,8 +355,12 @@
- grey(18) = NO
- grey(19) = YES
- grey(20) = NO
- - grey(21) = YES 'Menu Tag
- + grey(21) = YES
- grey(22) = NO
- + grey(23) = NO
- + grey(24) = NO
- + grey(25) = YES 'Menu Tag
- + grey(26) = NO
- DIM num as integer
- DIM temptrig as integer
- @@ -376,7 +383,7 @@
- temptrig = large(-box.instead, 0)
- scriptbrowse temptrig, plottrigger, "instead of textbox plotscript"
- box.instead = -temptrig
- - CASE 22 '--after script
- + CASE 26 '--after script
- temptrig = large(-box.after, 0)
- scriptbrowse temptrig, plottrigger, "after textbox plotscript"
- box.after = -temptrig
- @@ -405,6 +412,12 @@
- END IF
- CASE condHERO
- intgrabber num, -99, 99
- + CASE condGAMEDELETE
- + intgrabber num, -1, 32
- + CASE condGAMESAVE
- + intgrabber num, -2, 32
- + CASE condGAMELOAD
- + intgrabber num, -3, 32
- CASE condMONEY
- intgrabber num, -32000, 32000
- CASE condDOOR
- @@ -523,11 +536,30 @@
- menu(18) = " instantly use door " & box.door
- menu(19) = textbox_condition_caption(box.menu_tag, "MENU")
- menu(20) = " open menu " & box.menu & " " & getmenuname(box.menu)
- - menu(21) = textbox_condition_caption(box.after_tag, "AFTER")
- + menu(21) = textbox_condition_caption(box.game_tag, "GAME")
- + SELECT CASE box.game_delete
- + CASE 0 : menu(22) = " don't delete save slot"
- + CASE -1 : menu(22) = " delete active save slot"
- + CASE IS > 0 : menu(22) = " delete save slot " & box.game_delete
- + END SELECT
- + SELECT CASE box.game_save
- + CASE 0 : menu(23) = " don't save to slot"
- + CASE -1 : menu(23) = " save to active slot"
- + CASE -2 : menu(23) = " show save menu"
- + CASE IS > 0 : menu(23) = " save to slot " & box.game_save
- + END SELECT
- + SELECT CASE box.game_load
- + CASE 0 : menu(24) = " don't load from slot / game over"
- + CASE -1 : menu(24) = " load from active slot"
- + CASE -2 : menu(24) = " show load menu"
- + CASE -3 : menu(24) = " game over"
- + CASE IS > 0 : menu(24) = " load from slot " & box.game_load
- + END SELECT
- + menu(25) = textbox_condition_caption(box.after_tag, "AFTER")
- SELECT CASE box.after
- - CASE 0 : menu(22) = " use [text box or script] next"
- - CASE IS < 0 : menu(22) = " run " & scriptname(-box.after) & " next"
- - CASE IS > 0 : menu(22) = " jump to text box " & box.after & " next"
- + CASE 0 : menu(26) = " use [text box or script] next"
- + CASE IS < 0 : menu(26) = " run " & scriptname(-box.after) & " next"
- + CASE IS > 0 : menu(26) = " jump to text box " & box.after & " next"
- END SELECT
- END SUB
- @@ -658,8 +690,12 @@
- CASE 18: .door = num
- CASE 19: .menu_tag = num
- CASE 20: .menu = num
- - CASE 21: .after_tag = num
- - CASE 22: .after = num
- + CASE 21: .game_tag = num
- + CASE 22: .game_delete = num
- + CASE 23: .game_save = num
- + CASE 24: .game_load = num
- + CASE 25: .after_tag = num
- + CASE 26: .after = num
- END SELECT
- END WITH
- END SUB
- @@ -688,8 +724,12 @@
- CASE 18: RETURN .door
- CASE 19: RETURN .menu_tag
- CASE 20: RETURN .menu
- - CASE 21: RETURN .after_tag
- - CASE 22: RETURN .after
- + CASE 21: RETURN .game_tag
- + CASE 22: RETURN .game_delete
- + CASE 23: RETURN .game_save
- + CASE 24: RETURN .game_load
- + CASE 25: RETURN .after_tag
- + CASE 26: RETURN .after
- END SELECT
- END WITH
- END FUNCTION
- @@ -697,7 +737,7 @@
- FUNCTION box_conditional_type_by_menu_index(menuindex as integer) as integer
- SELECT CASE menuindex
- CASE -1 : RETURN condEXIT
- - CASE 1, 22 : RETURN condBOX
- + CASE 1, 26 : RETURN condBOX
- CASE 3, 4 : RETURN condSETTAG
- CASE 6 : RETURN condMONEY
- CASE 8 : RETURN condBATTLE
- @@ -706,6 +746,9 @@
- CASE 14,15,16: RETURN condHERO
- CASE 18 : RETURN condDOOR
- CASE 20 : RETURN condMENU
- + CASE 22 : RETURN condGAMEDELETE
- + CASE 23 : RETURN condGAMESAVE
- + CASE 24 : RETURN condGAMELOAD
- CASE ELSE : RETURN condTAG
- END SELECT
- END FUNCTION
- @@ -1554,6 +1597,14 @@
- box.menu_tag = VALINT(v)
- CASE "menu"
- box.menu = VALINT(v)
- + CASE "game tag"
- + box.game_tag = VALINT(v)
- + CASE "game delete"
- + box.game_delete = VALINT(v)
- + CASE "game save"
- + box.game_save = VALINT(v)
- + CASE "game load"
- + box.game_load = VALINT(v)
- CASE "next tag"
- box.after_tag = VALINT(v)
- CASE "next box"
- @@ -1733,6 +1784,44 @@
- END IF
- + IF box.game_tag <> 0 THEN
- + PRINT #fh, "Game Tag: " & box.game_tag & " (" & escape_nonprintable_ascii(tag_condition_caption(box.game_tag, , "Never")) & ")"
- +
- + IF box.game_delete <> 0 THEN
- + PRINT #fh, "Game Delete: " & box.game_delete;
- + IF box.game_delete = -1 THEN
- + PRINT #fh, " (Delete active save slot)"
- + ELSE
- + PRINT #fh, " (Delete save slot " & (box.game_delete - 1) & ")"
- + END IF
- + END IF
- +
- + IF box.game_save <> 0 THEN
- + PRINT #fh, "Game Save: " & box.game_save;
- + IF box.game_save = -1 THEN
- + PRINT #fh, " (Save to active slot)"
- + ELSEIF box.game_save = -2 THEN
- + PRINT #fh, " (Show save menu)"
- + ELSE
- + PRINT #fh, " (Save to slot " & (box.game_save - 1) & ")"
- + END IF
- + END IF
- +
- + IF box.game_load <> 0 THEN
- + PRINT #fh, "Game Load: " & box.game_load;
- + IF box.game_load = -1 THEN
- + PRINT #fh, " (Load from active slot)"
- + ELSEIF box.game_load = -2 THEN
- + PRINT #fh, " (Show load menu)"
- + ELSEIF box.game_load = -3 THEN
- + PRINT #fh, " (Game over)"
- + ELSE
- + PRINT #fh, " (Load from slot " & (box.game_load - 1) & ")"
- + END IF
- + END IF
- +
- + END IF
- +
- IF box.money_tag <> 0 THEN
- PRINT #fh, "Money Tag: " & box.money_tag & " (" & escape_nonprintable_ascii(tag_condition_caption(box.money_tag, , "Never")) & ")"
- PRINT #fh, "Money: " & box.money
- Index: wip/udts.bi
- ===================================================================
- --- wip/udts.bi (revision 9709)
- +++ wip/udts.bi (working copy)
- @@ -886,6 +886,10 @@
- hero_addrem as integer
- hero_swap as integer
- hero_lock as integer
- + game_tag as integer
- + game_delete as integer
- + game_save as integer
- + game_load as integer
- after_tag as integer
- after as integer
- money_tag as integer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement