]> granicus.if.org Git - nethack/commitdiff
add Qt paperdoll 'todo' comment
authorPatR <rankin@nethack.org>
Sun, 22 Jan 2023 20:35:54 +0000 (12:35 -0800)
committerPatR <rankin@nethack.org>
Sun, 22 Jan 2023 20:35:54 +0000 (12:35 -0800)
Add a comment to qt_inv.cpp, plus a couple of reformatting bits in
cmd.c and invent.c.

src/cmd.c
src/invent.c
win/Qt/qt_inv.cpp

index 37a99370b4f0a9422d746c489a13419f1c25d1cd..04b6290172402c436677b7af24f45a77d5cc5bef 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -4600,7 +4600,8 @@ reset_commands(boolean initial)
 #endif
             /* FIXME: NHKF_DOINV2 ought to be implemented instead of this */
             c = M('0') & 0xff;
-            gc.Cmd.commands[c] = gc.Cmd.pcHack_compat ? gc.Cmd.commands['I'] : 0;
+            gc.Cmd.commands[c] = gc.Cmd.pcHack_compat ? gc.Cmd.commands['I']
+                                                      : 0;
         }
         /* phone keypad layout (only applicable for num_pad) */
         flagtemp = (iflags.num_pad_mode & 2) ? gc.Cmd.num_pad : FALSE;
index a7e743b5c6b128a1bc7a63735fac8c39bf107a74..2f21716ff2f17d87460742c789969e565108cea3 100644 (file)
@@ -1016,8 +1016,11 @@ DISABLE_WARNING_FORMAT_NONLITERAL
  * touch_artifact will print its own messages if they are warranted.
  */
 struct obj *
-hold_another_object(struct obj *obj, const char *drop_fmt,
-                    const char *drop_arg, const char *hold_msg)
+hold_another_object(
+    struct obj *obj, /* object to be held */
+    const char *drop_fmt, /* format string for message if it can't be held */
+    const char *drop_arg, /* argument to use when formatting message */
+    const char *hold_msg) /* message to display if successfully held */
 {
     char buf[BUFSZ];
 
@@ -2636,12 +2639,18 @@ enum item_action_actions {
 
 /* construct text for the menu entries for IA_NAME_OBJ and IA_NAME_OTYP */
 static boolean
-item_naming_classification(struct obj *obj, char *onamebuf, char *ocallbuf)
+item_naming_classification(
+    struct obj *obj,
+    char *onamebuf,
+    char *ocallbuf)
 {
-    static const char Name[] = "Name", Rename[] = "Rename or un-name",
-                      /* "re-call" seems a bit weird, but "recall" and
-                         "rename" don't fit for changing a type name */
-                      Call[] = "Call", Recall[] = "Re-call or un-call";
+    static const char
+        Name[] = "Name",
+        Rename[] = "Rename or un-name",
+        Call[] = "Call",
+        /* "re-call" seems a bit weird, but "recall" and
+           "rename" don't fit for changing a type name */
+        Recall[] = "Re-call or un-call";
 
     onamebuf[0] = ocallbuf[0] = '\0';
     if (name_ok(obj) == GETOBJ_SUGGEST) {
index cca4224bcd81a45e44d08d23f8726792c1a5ba47..01cf2039fccbe2e923f576e654919b2e93c80c18 100644 (file)
@@ -49,13 +49,19 @@ find_tool(int tooltyp)
     return o;
 }
 
-NetHackQtInvUsageWindow::NetHackQtInvUsageWindow(QWidgetparent) :
+NetHackQtInvUsageWindow::NetHackQtInvUsageWindow(QWidget *parent) :
     QWidget(parent)
 {
     setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
     // needed to enable tool tips
     setMouseTracking(true);
 
+    /*
+     * TODO:
+     *  Add support for clicking on a paperdoll cell and have that
+     *  run itemactions(invent.c) for the object shown in the cell.
+     */
+
     // paperdoll is 6x3 but the indices are column oriented: 0..2x0..5
     for (int x = 0; x <= 2; ++x)
         for (int y = 0; y <= 5; ++y)
@@ -70,9 +76,12 @@ NetHackQtInvUsageWindow::~NetHackQtInvUsageWindow()
                 free((void *) tips[x][y]), tips[x][y] = NULL;
 }
 
-void NetHackQtInvUsageWindow::drawWorn(QPainter &painter, obj *nhobj,
-                                       int x, int y, // cell index, not pixels
-                                       const char *alttip, int flags)
+void NetHackQtInvUsageWindow::drawWorn(
+    QPainter &painter,
+    obj *nhobj,
+    int x, int y, // cell index, not pixels
+    const char *alttip,
+    int flags)
 {
     short int glyph;
     glyph_info gi;