OSDN Git Service

[Refactor] #40233 Moved display_store_inventory() from store.c to display-store.c/h
authorHourier <hourier@users.sourceforge.jp>
Thu, 16 Jul 2020 11:56:28 +0000 (20:56 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 16 Jul 2020 11:56:28 +0000 (20:56 +0900)
src/store/store.c
src/store/store.h
src/view/display-store.c
src/view/display-store.h

index 78d1866..7681f9d 100644 (file)
 
 #define MIN_STOCK 12
 
-static int store_top = 0;
+int store_top = 0;
 int store_bottom = 0;
-static int xtra_stock = 0;
+int xtra_stock = 0;
 const owner_type *ot_ptr = NULL;
 static s16b old_town_num = 0;
 static s16b inner_town_num = 0;
@@ -463,42 +463,6 @@ static void updatebargain(PRICE price, PRICE minprice, int num)
 }
 
 /*!
- * @brief 店の商品リストを表示する /
- * Displays a store's inventory -RAK-
- * @param player_ptr プレーヤーへの参照ポインタ
- * @return なし
- * @details
- * All prices are listed as "per individual object".  -BEN-
- */
-static void display_store_inventory(player_type *player_ptr)
-{
-    int k;
-    for (k = 0; k < store_bottom; k++) {
-        if (store_top + k >= st_ptr->stock_num)
-            break;
-
-        display_entry(player_ptr, store_top + k);
-    }
-
-    for (int i = k; i < store_bottom + 1; i++)
-        prt("", i + 6, 0);
-
-    put_str(_("          ", "        "), 5, _(20, 22));
-    if (st_ptr->stock_num > store_bottom) {
-        prt(_("-続く-", "-more-"), k + 6, 3);
-        put_str(format(_("(%dページ)  ", "(Page %d)  "), store_top / store_bottom + 1), 5, _(20, 22));
-    }
-
-    if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM) {
-        k = st_ptr->stock_size;
-        if (cur_store_num == STORE_HOME && !powerup_home)
-            k /= 10;
-
-        put_str(format(_("アイテム数:  %4d/%4d", "Objects:  %4d/%4d"), st_ptr->stock_num, k), 19 + xtra_stock, _(27, 30));
-    }
-}
-
-/*!
  * @brief プレイヤーの所持金を表示する /
  * Displays players gold                                       -RAK-
  * @param player_ptr プレーヤーへの参照ポインタ
index a41b60d..92b05bc 100644 (file)
@@ -11,7 +11,9 @@
 #define STORE_SHUFFLE   21              /* 1/Chance (per day) of an owner changing */
 #define STORE_TICKS     1000            /* Number of ticks between turnovers */
 
+extern int store_top;
 extern int store_bottom;
+extern int xtra_stock;
 extern const owner_type *ot_ptr;
 
 PRICE price_item(player_type *player_ptr, object_type *o_ptr, int greed, bool flip);
index 32cdd1f..807f58f 100644 (file)
@@ -100,3 +100,39 @@ void display_entry(player_type *player_ptr, int pos)
     (void)sprintf(out_val, "%9ld  ", (long)x);
     put_str(out_val, i + 6, 68);
 }
+
+/*!
+ * @brief 店の商品リストを表示する /
+ * Displays a store's inventory -RAK-
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @return なし
+ * @details
+ * All prices are listed as "per individual object".  -BEN-
+ */
+void display_store_inventory(player_type *player_ptr)
+{
+    int k;
+    for (k = 0; k < store_bottom; k++) {
+        if (store_top + k >= st_ptr->stock_num)
+            break;
+
+        display_entry(player_ptr, store_top + k);
+    }
+
+    for (int i = k; i < store_bottom + 1; i++)
+        prt("", i + 6, 0);
+
+    put_str(_("          ", "        "), 5, _(20, 22));
+    if (st_ptr->stock_num > store_bottom) {
+        prt(_("-続く-", "-more-"), k + 6, 3);
+        put_str(format(_("(%dページ)  ", "(Page %d)  "), store_top / store_bottom + 1), 5, _(20, 22));
+    }
+
+    if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM) {
+        k = st_ptr->stock_size;
+        if (cur_store_num == STORE_HOME && !powerup_home)
+            k /= 10;
+
+        put_str(format(_("アイテム数:  %4d/%4d", "Objects:  %4d/%4d"), st_ptr->stock_num, k), 19 + xtra_stock, _(27, 30));
+    }
+}
index b7b557d..838200b 100644 (file)
@@ -3,3 +3,4 @@
 #include "system/angband.h"
 
 void display_entry(player_type *player_ptr, int pos);
+void display_store_inventory(player_type *player_ptr);