mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-09 21:31:22 +00:00
Inventory formatting updates
This commit is contained in:
parent
7c297f757d
commit
ad8d58f62e
@ -1166,7 +1166,12 @@ def displayPlayerData(player)
|
|||||||
rawDisplayStr(player=>s_name)
|
rawDisplayStr(player=>s_name)
|
||||||
// Locate the first weapon, and display it's clip
|
// Locate the first weapon, and display it's clip
|
||||||
pi = player=>p_items
|
pi = player=>p_items
|
||||||
while pi and pi->t_type <> TYPE_WEAPON; pi = pi=>p_nextObj; loop
|
while pi
|
||||||
|
if pi->t_type == TYPE_WEAPON and pi->b_flags & ITEM_FLAG_EQUIP
|
||||||
|
break
|
||||||
|
fin
|
||||||
|
pi = pi=>p_nextObj
|
||||||
|
loop
|
||||||
if pi
|
if pi
|
||||||
rightJustifyNum(pi->b_clipCurrent, CHAR_WND_AMMO_X)
|
rightJustifyNum(pi->b_clipCurrent, CHAR_WND_AMMO_X)
|
||||||
else
|
else
|
||||||
|
@ -15,12 +15,17 @@ include "gamelib.plh"
|
|||||||
// Data structure definitions
|
// Data structure definitions
|
||||||
include "playtype.plh"
|
include "playtype.plh"
|
||||||
|
|
||||||
|
// Global definitions
|
||||||
|
include "globalDefs.plh"
|
||||||
|
|
||||||
// Definition of constants for functions exported by this module
|
// Definition of constants for functions exported by this module
|
||||||
include "party.plh"
|
include "party.plh"
|
||||||
|
|
||||||
// Number of items that fit in inventory pane
|
// Number of items that fit in inventory pane
|
||||||
const INV_PAGE_NUM = 13
|
const INV_PAGE_NUM = 13
|
||||||
|
|
||||||
|
const CHAR_WND_STAT_X = 20
|
||||||
|
|
||||||
// This pointer is the root of all heap-tracked (and garbage collected) objects.
|
// This pointer is the root of all heap-tracked (and garbage collected) objects.
|
||||||
// See playtype.plh for definitions of all the datastructures and how they interconnect.
|
// See playtype.plh for definitions of all the datastructures and how they interconnect.
|
||||||
word global
|
word global
|
||||||
@ -65,7 +70,7 @@ def unequip(player, type, kind)
|
|||||||
end
|
end
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Display inventory pane
|
// Display inventory pane
|
||||||
def showInventory(player, page)
|
def showInventory(player, page, select)
|
||||||
word item
|
word item
|
||||||
byte n_item, n_page
|
byte n_item, n_page
|
||||||
|
|
||||||
@ -83,7 +88,11 @@ def showInventory(player, page)
|
|||||||
loop
|
loop
|
||||||
fin
|
fin
|
||||||
while item and n_item < (n_page + INV_PAGE_NUM)
|
while item and n_item < (n_page + INV_PAGE_NUM)
|
||||||
displayf2("\n%c) %s", 'A' + n_item, item=>s_name)
|
if select
|
||||||
|
displayf2("\n%c) %s", 'A' + n_item, item=>s_name)
|
||||||
|
else
|
||||||
|
displayf1("\n%s", item=>s_name)
|
||||||
|
fin
|
||||||
//if item=>s_itemKind
|
//if item=>s_itemKind
|
||||||
// displayf1(" (%s)", item=>s_itemKind)
|
// displayf1(" (%s)", item=>s_itemKind)
|
||||||
//fin
|
//fin
|
||||||
@ -140,15 +149,15 @@ def showPlayerSheet(num)
|
|||||||
setWindow2()
|
setWindow2()
|
||||||
clearWindow()
|
clearWindow()
|
||||||
rawDisplayStr("^Y^LStats^L^N\n")
|
rawDisplayStr("^Y^LStats^L^N\n")
|
||||||
displayf1("%d", player=>w_health); rawDisplayStr("^T024Health\n")
|
rightJustifyNum(player=>w_health, CHAR_WND_STAT_X); rawDisplayStr("^T024Health\n")
|
||||||
displayf1("%d", player->b_intelligence); rawDisplayStr("^T024Intelligence\n")
|
rightJustifyNum(player->b_intelligence, CHAR_WND_STAT_X); rawDisplayStr("^T024Intelligence\n")
|
||||||
displayf1("%d", player->b_strength); rawDisplayStr("^T024Strength\n")
|
rightJustifyNum(player->b_strength, CHAR_WND_STAT_X); rawDisplayStr("^T024Strength\n")
|
||||||
displayf1("%d", player->b_agility); rawDisplayStr("^T024Agility\n")
|
rightJustifyNum(player->b_agility, CHAR_WND_STAT_X); rawDisplayStr("^T024Agility\n")
|
||||||
displayf1("%d", player->b_stamina); rawDisplayStr("^T024Stamina\n")
|
rightJustifyNum(player->b_stamina, CHAR_WND_STAT_X); rawDisplayStr("^T024Stamina\n")
|
||||||
displayf1("%d", player->b_charisma); rawDisplayStr("^T024Charisma\n")
|
rightJustifyNum(player->b_charisma, CHAR_WND_STAT_X); rawDisplayStr("^T024Charisma\n")
|
||||||
displayf1("%d", player->b_spirit); rawDisplayStr("^T024Spirit\n")
|
rightJustifyNum(player->b_spirit, CHAR_WND_STAT_X); rawDisplayStr("^T024Spirit\n")
|
||||||
displayf1("%d", player->b_luck); rawDisplayStr("^T024Luck\n")
|
rightJustifyNum(player->b_luck, CHAR_WND_STAT_X); rawDisplayStr("^T024Luck\n")
|
||||||
displayf1("%d", player->b_armor); rawDisplayStr("^T024Armor\n")
|
rightJustifyNum(player->b_armor, CHAR_WND_STAT_X); rawDisplayStr("^T024Armor\n")
|
||||||
|
|
||||||
// Show aquired skills in lower right panel
|
// Show aquired skills in lower right panel
|
||||||
setWindow3()
|
setWindow3()
|
||||||
@ -165,7 +174,7 @@ def showPlayerSheet(num)
|
|||||||
col++
|
col++
|
||||||
loop
|
loop
|
||||||
// Next, show inventory in the main panel
|
// Next, show inventory in the main panel
|
||||||
showInventory(player, 0)
|
showInventory(player, 0, FALSE)
|
||||||
rawDisplayStr("\n^YE)quip, U)se, D)rop^Y")
|
rawDisplayStr("\n^YE)quip, U)se, D)rop^Y")
|
||||||
return player
|
return player
|
||||||
end
|
end
|
||||||
@ -187,7 +196,7 @@ def _party_doPlayerSheet(num)
|
|||||||
is '3'; num = 2; n_page = 0; break
|
is '3'; num = 2; n_page = 0; break
|
||||||
// Equip player with weapon/armor
|
// Equip player with weapon/armor
|
||||||
is 'E'
|
is 'E'
|
||||||
showInventory(player, n_page)
|
showInventory(player, n_page, TRUE)
|
||||||
rawDisplayStr(@strWhichItem)
|
rawDisplayStr(@strWhichItem)
|
||||||
item = itemNum(player, getUpperKey() - 'A')
|
item = itemNum(player, getUpperKey() - 'A')
|
||||||
if item
|
if item
|
||||||
@ -200,7 +209,7 @@ def _party_doPlayerSheet(num)
|
|||||||
break
|
break
|
||||||
// Use an item
|
// Use an item
|
||||||
is 'U'
|
is 'U'
|
||||||
showInventory(player, n_page)
|
showInventory(player, n_page, TRUE)
|
||||||
rawDisplayStr(@strWhichItem)
|
rawDisplayStr(@strWhichItem)
|
||||||
item = itemNum(player, getUpperKey() - 'A')
|
item = itemNum(player, getUpperKey() - 'A')
|
||||||
if item
|
if item
|
||||||
@ -219,7 +228,7 @@ def _party_doPlayerSheet(num)
|
|||||||
break
|
break
|
||||||
// Drop an item
|
// Drop an item
|
||||||
is 'D'
|
is 'D'
|
||||||
showInventory(player, n_page)
|
showInventory(player, n_page, TRUE)
|
||||||
rawDisplayStr(@strWhichItem)
|
rawDisplayStr(@strWhichItem)
|
||||||
item = itemNum(player, getUpperKey() - 'A')
|
item = itemNum(player, getUpperKey() - 'A')
|
||||||
if item
|
if item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user