A few last fixes on the buy page.

This commit is contained in:
Martin Haye 2017-09-02 11:27:21 -07:00
parent 805a1e426a
commit 3d70f886d4
3 changed files with 16 additions and 9 deletions

View File

@ -190,7 +190,7 @@ def editFlags()#1
^$c051 ^$c051
textHome() textHome()
*$4000 = 0 // so renderer knows we messed up the page *$4000 = 0 // so renderer knows we messed up the page
puts("Flags:") puts("Game flags:")
mmgr(START_LOAD, 1) // code is in partition 1 mmgr(START_LOAD, 1) // code is in partition 1
pModule = mmgr(QUEUE_LOAD, MOD_GEN_FLAGS<<8 | RES_TYPE_MODULE) pModule = mmgr(QUEUE_LOAD, MOD_GEN_FLAGS<<8 | RES_TYPE_MODULE)
mmgr(FINISH_LOAD, 0) mmgr(FINISH_LOAD, 0)

View File

@ -806,7 +806,7 @@ def _showPlayerSheet(player_num)#1 // funcTbl functions always have to return a
item = interactWithItem(player, itemByNum(player, i_page * INV_ROWS + sel)) item = interactWithItem(player, itemByNum(player, i_page * INV_ROWS + sel))
if item; return item; fin // Use an item if item; return item; fin // Use an item
if countList(player=>p_items) <= i_page * INV_ROWS // destroyed last item on pg 2 if countList(player=>p_items) <= i_page * INV_ROWS // destroyed last item on pg 2
i_page = 0 i_page--
fin fin
redisplay = 2 redisplay = 2
else else

View File

@ -79,7 +79,7 @@ end
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
def displayPaging(action, nItems, pageNum, nPages)#0 def displayPaging(action, nItems, pageNum, nPages)#0
rawDisplayStr("\n^V166") rawDisplayStr("\n^V164")
if nItems or playerCount > 1 if nItems or playerCount > 1
if nItems if nItems
rawDisplayf1("%s [A", action) rawDisplayf1("%s [A", action)
@ -182,6 +182,12 @@ def askQuantity(nMax)#1
return num return num
end end
///////////////////////////////////////////////////////////////////////////////////////////////////
def displayMsg(msg, beep)#0
rawDisplayf1("^T000^C%s", msg)
pause(800)
end
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
def browseItem(num)#0 def browseItem(num)#0
word pItem, price, compSkip, pComp, quantity word pItem, price, compSkip, pComp, quantity
@ -199,16 +205,16 @@ def browseItem(num)#0
if pItem->t_type == TYPE_FANCY_ITEM and pItem=>w_count > 0 if pItem->t_type == TYPE_FANCY_ITEM and pItem=>w_count > 0
pComp=>w_count = min(30000, pComp=>w_count + pItem=>w_count) pComp=>w_count = min(30000, pComp=>w_count + pItem=>w_count)
else else
rawDisplayStr("\nDuplicate item.") rawDisplayStr("^T000^CDuplicate item.")
beep() beep()
pause(1000) pause(400)
continue continue
fin fin
else else
addToList(@pPlayer=>p_items, pItem) addToList(@pPlayer=>p_items, pItem)
fin fin
global=>w_gold = global=>w_gold - price global=>w_gold = global=>w_gold - price
rawDisplayStr("\nPurchase complete.") rawDisplayStr("^T000^CDone.")
pause(800) pause(800)
break break
elsif sel == 'N' and (compSkip or matchEquipped(pItem, 1+compSkip)) elsif sel == 'N' and (compSkip or matchEquipped(pItem, 1+compSkip))
@ -326,12 +332,10 @@ def sellItem(num)#0
pItem = pageItems[num] pItem = pageItems[num]
price = pagePrices[num] price = pagePrices[num]
clearWindow()
global=>w_gold = global=>w_gold + price global=>w_gold = global=>w_gold + price
removeFromList(@pPlayer=>p_items, pItem) removeFromList(@pPlayer=>p_items, pItem)
rawDisplayStr("\nSale complete.") rawDisplayStr("^T000^CDone.")
pause(800) pause(800)
end end
@ -365,6 +369,9 @@ def _sellToStore(profitPercent)#1
elsif choice >= 'A' and (choice-'A' < nItemsOnPage) elsif choice >= 'A' and (choice-'A' < nItemsOnPage)
sellItem(choice-'A') sellItem(choice-'A')
totalItems = iterateSellables(9999, 0) totalItems = iterateSellables(9999, 0)
if totalItems <= pageNum * PAGE_SIZE // sold last item on pg 2
pageNum--
fin
elsif choice == $1B // Esc elsif choice == $1B // Esc
break break
else else