From: PatR Date: Sun, 22 Jan 2023 20:35:54 +0000 (-0800) Subject: add Qt paperdoll 'todo' comment X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=949afe8e832f3c5d7e542a3e49fecb6c033bac91;p=nethack add Qt paperdoll 'todo' comment Add a comment to qt_inv.cpp, plus a couple of reformatting bits in cmd.c and invent.c. --- diff --git a/src/cmd.c b/src/cmd.c index 37a99370b..04b629017 100644 --- 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; diff --git a/src/invent.c b/src/invent.c index a7e743b5c..2f21716ff 100644 --- a/src/invent.c +++ b/src/invent.c @@ -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) { diff --git a/win/Qt/qt_inv.cpp b/win/Qt/qt_inv.cpp index cca4224bc..01cf2039f 100644 --- a/win/Qt/qt_inv.cpp +++ b/win/Qt/qt_inv.cpp @@ -49,13 +49,19 @@ find_tool(int tooltyp) return o; } -NetHackQtInvUsageWindow::NetHackQtInvUsageWindow(QWidget* parent) : +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;