Qt pager doll inventory

Change Qt's 6x3 grid of worn/wielded equipment so that it is facing
the player: hero's right hand side is shown in the grid's left column
and left hand side is shown in its right column.  Middle column is
unchanged.
This commit is contained in:
PatR
2022-11-21 12:53:42 -08:00
parent 8bab5546bd
commit c3a8850a86
+44 -43
View File
@@ -152,26 +152,27 @@ void NetHackQtInvUsageWindow::paintEvent(QPaintEvent*)
// equipment showing the map tiles that the inventory objects // equipment showing the map tiles that the inventory objects
// would be displayed as if they were on the floor. // would be displayed as if they were on the floor.
// //
// 0 1 2 two- dual // 0 1 2 two- dual
// [ old ] normal hander wielding legend // [ old ] normal hander wielding legend
// 0 [x H b] b H q b H q b H q b eyewear H helmet q quiver // 0 [x H b] q H b q H b q H b q quiver H helmet b eyewear
// 1 [S " w] S " w W " W X " w S shield " amulet w weapon // 1 [S " w] w " S W " W w " X w weapon " amulet S shield
// 2 [G C G] G C x G C x G C . G gloves C cloak x alt-weap // 2 [G C G] x C G x C G . C G x alt-weap C cloak G gloves
// 3 [= A =] = A = = A = = A = = left rg A suit = right ring // 3 [= A =] = A = = A = = A = = right rg A suit = left ring
// 4 [. U .] l U L l U L l U L l leash U shirt L light // 4 [. U .] L U l L U l L U l L light U shirt l leash
// 5 [. F .] . F . . F . . F . . blank F boots . blank // 5 [. F .] . F . . F . . F . . blank F boots . blank
// W wielded two-handed weapon // W wielded two-handed weapon
// X wielded secondary weapon // X wielded secondary weapon
// //
// 3.7: use a different layout (also different legend for it, above): // 3.7: use a different layout (also different legend for it, above):
// invert so grid is facing player, with right hand on screen left;
// show gloves in only one slot; // show gloves in only one slot;
// move alternate weapon to former right hand glove slot; // move alternate weapon to former right hand glove slot;
// move blindfold to former alternate weapon slot; // move blindfold to former alternate weapon slot;
// add quiver to former blindfold slot; // add quiver to former blindfold slot;
// show secondary weapon in shield slot when two-weapon is active; // show secondary weapon in shield slot when two-weapon is active;
// show two-handed primary weapon in both shield and uwep slots; // show two-handed primary weapon in both shield and uwep slots;
// add lit lamp/lantern/candle/candelabrum on lower right side; // add lit lamp/lantern/candle/candelabrum on lower left side;
// add leash-in-use on lower left side // add leash-in-use on lower right side
// //
// Actually indexed by grid[column][row]. // Actually indexed by grid[column][row].
@@ -195,24 +196,24 @@ void NetHackQtInvUsageWindow::paintEvent(QPaintEvent*)
// String argument is for a tool tip when the object in question is Null. // String argument is for a tool tip when the object in question is Null.
// //
// left column // left grid column (depicts hero's right side)
drawWorn(painter, ublindf, 0, 0, "no eyewear"); // bf|towel|lenses drawWorn(painter, uquiver, 0, 0, "nothing readied for firing"); // quiver
/* shield slot varies depending upon weapon usage; drawWorn(painter, uwep, 0, 1, "no weapon");
no alt tool tip is needed for first two cases because object will /* uswapwep slot varies depending upon dual-wielding state;
never be Null when the corresponding tests pass */ shown in shield slot when actively wielded, so uswapwep slot is empty
if (u.twoweap) then and an alternate tool tip is used to explain that emptiness */
drawWorn(painter, uswapwep, 0, 1, NULL); // secondary weapon, in use if (!u.twoweap)
else if (uwep && bimanual(uwep)) // show two-handed uwep twice drawWorn(painter, uswapwep, 0, 2, "no alternate weapon");
drawWorn(painter, uwep, 0, 1, NULL, dollReverse); // uwep on left
else else
drawWorn(painter, uarms, 0, 1, "no shield"); drawWorn(painter, NULL, 0, 2, "secondary weapon is wielded");
drawWorn(painter, uarmg, 0, 2, "no gloves"); drawWorn(painter, uright, 0, 3, "no right ring");
drawWorn(painter, uleft, 0, 3, "no left ring"); /* OIL_LAMP matches lit candles, lamps, lantern, and candelabrum
/* light source and leash aren't unique and don't have pointers defined */ (and might also duplicate Sunsword when it is wielded--hence lit--
drawWorn(painter, find_tool(LEASH), 0, 4, "no leashes in use"); depending upon whether another light source precedes it in invent) */
drawWorn(painter, NULL, 0, 5, NULL, dollUnused); // always blank drawWorn(painter, find_tool(OIL_LAMP), 0, 4, "no active light sources");
drawWorn(painter, NULL, 0, 5, NULL, dollUnused); // always blank
// middle column; no unused slots // middle grid column; no unused slots
drawWorn(painter, uarmh, 1, 0, "no helmet"); drawWorn(painter, uarmh, 1, 0, "no helmet");
drawWorn(painter, uamul, 1, 1, "no amulet"); drawWorn(painter, uamul, 1, 1, "no amulet");
drawWorn(painter, uarmc, 1, 2, "no cloak"); drawWorn(painter, uarmc, 1, 2, "no cloak");
@@ -220,22 +221,22 @@ void NetHackQtInvUsageWindow::paintEvent(QPaintEvent*)
drawWorn(painter, uarmu, 1, 4, "no shirt"); drawWorn(painter, uarmu, 1, 4, "no shirt");
drawWorn(painter, uarmf, 1, 5, "no boots"); drawWorn(painter, uarmf, 1, 5, "no boots");
// right column // right grid column (depicts hero's left side)
drawWorn(painter, uquiver, 2, 0, "nothing readied for firing"); // quiver drawWorn(painter, ublindf, 2, 0, "no eyewear"); // bf|towel|lenses
drawWorn(painter, uwep, 2, 1, "no weapon"); /* shield slot varies depending upon weapon usage;
/* uswapwep slot varies depending upon dual-wielding state; no alt tool tip is needed for first two cases because object will
shown in shield slot when actively wielded, so uswapwep slot is empty never be Null when the corresponding tests pass */
then and an alternate tool tip is used to explain that emptiness */ if (u.twoweap)
if (!u.twoweap) drawWorn(painter, uswapwep, 2, 1, NULL); // secondary weapon, in use
drawWorn(painter, uswapwep, 2, 2, "no alternate weapon"); else if (uwep && bimanual(uwep)) // show two-handed uwep twice
drawWorn(painter, uwep, 2, 1, NULL, dollReverse); // uwep on right
else else
drawWorn(painter, NULL, 2, 2, "secondary weapon is wielded"); drawWorn(painter, uarms, 2, 1, "no shield");
drawWorn(painter, uright, 2, 3, "no right ring"); drawWorn(painter, uarmg, 2, 2, "no gloves");
/* OIL_LAMP matches lit candles, lamps, lantern, and candelabrum drawWorn(painter, uleft, 2, 3, "no left ring");
(and might also duplicate Sunsword when it is wielded--hence lit-- /* light source and leash aren't unique and don't have pointers defined */
depending upon whether another light source precedes it in invent) */ drawWorn(painter, find_tool(LEASH), 2, 4, "no leashes in use");
drawWorn(painter, find_tool(OIL_LAMP), 2, 4, "no active light sources"); drawWorn(painter, NULL, 2, 5, NULL, dollUnused); // always blank
drawWorn(painter, NULL, 2, 5, NULL, dollUnused); // always blank
painter.end(); painter.end();