static int store_top = 0;
|
static int store_top = 0;
|
static int store_bottom = 0;
|
static int store_bottom = 0;
|
static int xtra_stock = 0;
|
static int xtra_stock = 0;
|
| static int window_width = 0;
|
static store_type *st_ptr = NULL;
|
static store_type *st_ptr = NULL;
|
static owner_type *ot_ptr = NULL;
|
static owner_type *ot_ptr = NULL;
|
static s16b old_town_num = 0;
|
static s16b old_town_num = 0;
|
/* Describe an item in the home */
|
/* Describe an item in the home */
|
if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
|
if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
|
{
|
{
|
maxwid = 75;
|
maxwid = window_width;
|
|
|
/* Leave room for weights, if necessary -DRS- */
|
/* Leave room for weights, if necessary -DRS- */
|
if (show_weights) maxwid -= 10;
|
if (show_weights) maxwid -= 10;
|
int wgt = o_ptr->weight;
|
int wgt = o_ptr->weight;
|
#ifdef JP
|
#ifdef JP
|
sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
|
sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
|
put_str(out_val, i+6, 67);
|
put_str(out_val, i+6, window_width-9);
|
#else
|
#else
|
(void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
|
(void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
|
put_str(out_val, i+6, 68);
|
put_str(out_val, i+6, window_width-9);
|
#endif
|
#endif
|
|
|
}
|
}
|
else
|
else
|
{
|
{
|
/* Must leave room for the "price" */
|
/* Must leave room for the "price" */
|
maxwid = 65;
|
maxwid = window_width-10;
|
|
|
/* Leave room for weights, if necessary -DRS- */
|
/* Leave room for weights, if necessary -DRS- */
|
if (show_weights) maxwid -= 7;
|
if (show_weights) maxwid -= 7;
|
int wgt = o_ptr->weight;
|
int wgt = o_ptr->weight;
|
#ifdef JP
|
#ifdef JP
|
sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
|
sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
|
put_str(out_val, i+6, 60);
|
put_str(out_val, i+6, window_width-12-7);
|
#else
|
#else
|
(void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
|
(void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
|
put_str(out_val, i+6, 61);
|
put_str(out_val, i+6, window_width-12-7);
|
#endif
|
#endif
|
|
|
}
|
}
|
(void)sprintf(out_val, "%9ld F", (long)x);
|
(void)sprintf(out_val, "%9ld F", (long)x);
|
#endif
|
#endif
|
|
|
put_str(out_val, i+6, 68);
|
put_str(out_val, i+6, window_width-12);
|
}
|
}
|
|
|
/* Display a "taxed" cost */
|
/* Display a "taxed" cost */
|
|
|
/* Actually draw the price (with tax) */
|
/* Actually draw the price (with tax) */
|
(void)sprintf(out_val, "%9ld ", (long)x);
|
(void)sprintf(out_val, "%9ld ", (long)x);
|
put_str(out_val, i+6, 68);
|
put_str(out_val, i+6, window_width-12);
|
}
|
}
|
|
|
/* Display a "haggle" cost */
|
/* Display a "haggle" cost */
|
|
|
/* Actually draw the price (not fixed) */
|
/* Actually draw the price (not fixed) */
|
(void)sprintf(out_val, "%9ld ", (long)x);
|
(void)sprintf(out_val, "%9ld ", (long)x);
|
put_str(out_val, i+6, 68);
|
put_str(out_val, i+6, window_width-12);
|
}
|
}
|
}
|
}
|
}
|
}
|
if (show_weights)
|
if (show_weights)
|
{
|
{
|
#ifdef JP
|
#ifdef JP
|
put_str("重さ", 5, 72);
|
put_str("重さ", 5, window_width-5);
|
#else
|
#else
|
put_str("Weight", 5, 70);
|
put_str("Weight", 5, window_width-7);
|
#endif
|
#endif
|
|
|
}
|
}
|
if (show_weights)
|
if (show_weights)
|
{
|
{
|
#ifdef JP
|
#ifdef JP
|
put_str("重さ", 5, 72);
|
put_str("重さ", 5, window_width-5);
|
#else
|
#else
|
put_str("Weight", 5, 70);
|
put_str("Weight", 5, window_width-7);
|
#endif
|
#endif
|
|
|
}
|
}
|
if (show_weights)
|
if (show_weights)
|
{
|
{
|
#ifdef JP
|
#ifdef JP
|
put_str("重さ", 5, 62);
|
put_str("重さ", 5, window_width-12-6);
|
#else
|
#else
|
put_str("Weight", 5, 60);
|
put_str("Weight", 5, window_width-12-8);
|
#endif
|
#endif
|
|
|
}
|
}
|
|
|
/* Label the asking price (in stores) */
|
/* Label the asking price (in stores) */
|
#ifdef JP
|
#ifdef JP
|
put_str("価格", 5, 73);
|
put_str("価格", 5, window_width-7);
|
#else
|
#else
|
put_str("Price", 5, 72);
|
put_str("Price", 5, window_width-8);
|
#endif
|
#endif
|
|
|
}
|
}
|
|
|
/* Get term size */
|
/* Get term size */
|
Term_get_size(&w, &h);
|
Term_get_size(&w, &h);
|
| window_width = w;
|
|
|
/* Calculate stocks per 1 page */
|
/* Calculate stocks per 1 page */
|
xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
|
xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
|