From c26c01aaff95c1883a257b07e72f9b477edd73e4 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 22 Apr 2025 14:48:15 -0400 Subject: [PATCH] Add missing tooltip formatting --- forms/connectionslistitem.ui | 14 +-- forms/customattributesdialog.ui | 6 +- forms/customscriptseditor.ui | 6 +- forms/mainwindow.ui | 50 +-------- forms/maplisttoolbar.ui | 8 +- forms/newmapconnectiondialog.ui | 12 +-- forms/preferenceeditor.ui | 16 +-- forms/projectsettingseditor.ui | 160 ++++++++++++++++------------- forms/regionmappropertiesdialog.ui | 36 +++---- include/core/utility.h | 1 + src/core/utility.cpp | 4 + src/ui/customattributestable.cpp | 3 +- src/ui/eventframes.cpp | 103 +++++++++++-------- src/ui/maplisttoolbar.cpp | 2 +- src/ui/projectsettingseditor.cpp | 5 +- 15 files changed, 215 insertions(+), 211 deletions(-) diff --git a/forms/connectionslistitem.ui b/forms/connectionslistitem.ui index bf04e8be..116da983 100644 --- a/forms/connectionslistitem.ui +++ b/forms/connectionslistitem.ui @@ -6,7 +6,7 @@ 0 0 - 178 + 188 157 @@ -20,7 +20,7 @@ .ConnectionsListItem { border-width: 1px; } - QFrame::StyledPanel + QFrame::Shape::StyledPanel @@ -65,7 +65,7 @@ - Remove this connection. + <html><head/><body><p>Remove this connection.</p></body></html> ... @@ -79,28 +79,28 @@ - Where the connected map should be positioned relative to the current map. + <html><head/><body><p>Where the connected map should be positioned relative to the current map.</p></body></html> - The name of the map to connect to the current map. + <html><head/><body><p>The name of the map to connect to the current map.</p></body></html> - The number of spaces to move the connected map perpendicular to its connected direction. + <html><head/><body><p>The number of spaces to move the connected map perpendicular to its connected direction.</p></body></html> - Open the connected map. + <html><head/><body><p>Open the connected map.</p></body></html> ... diff --git a/forms/customattributesdialog.ui b/forms/customattributesdialog.ui index b1f1ee4b..90dfba6e 100644 --- a/forms/customattributesdialog.ui +++ b/forms/customattributesdialog.ui @@ -33,7 +33,7 @@ - The key name for the new JSON field + <html><head/><body><p>The key name for the new JSON field</p></body></html> true @@ -50,7 +50,7 @@ - The data type for the new JSON field + <html><head/><body><p>The data type for the new JSON field</p></body></html> @@ -70,7 +70,7 @@ - The value for the new JSON field + <html><head/><body><p>The value for the new JSON field</p></body></html> diff --git a/forms/customscriptseditor.ui b/forms/customscriptseditor.ui index e2efa2af..7db3b208 100644 --- a/forms/customscriptseditor.ui +++ b/forms/customscriptseditor.ui @@ -60,7 +60,7 @@ - Create a new Porymap script file with a default template + <html><head/><body><p>Create a new Porymap script file with a default template</p></body></html> Create New Script... @@ -74,7 +74,7 @@ - Add an existing script file to the list below + <html><head/><body><p>Add an existing script file to the list below</p></body></html> Load Script... @@ -88,7 +88,7 @@ - Refresh all loaded scripts to account for any recent edits + <html><head/><body><p>Refresh all loaded scripts to account for any recent edits</p></body></html> Refresh Scripts diff --git a/forms/mainwindow.ui b/forms/mainwindow.ui index 53224385..bf0d2608 100644 --- a/forms/mainwindow.ui +++ b/forms/mainwindow.ui @@ -260,9 +260,6 @@ false - - - 0 @@ -2380,7 +2377,7 @@ - If enabled, connections will automatically be updated on the connected map. + <html><head/><body><p>If enabled, the connected Emerge and/or Dive maps will be displayed with an opacity set using the slider.</p></body></html> Mirror to Connecting Maps @@ -2433,7 +2430,7 @@ false - Open the selected Dive Map + <html><head/><body><p>Open the selected Dive Map</p></body></html> ... @@ -2447,7 +2444,7 @@ - If enabled, the connected Emerge and/or Dive maps will be displayed with an opacity set using the slider. + <html><head/><body><p>If enabled, the connected Emerge and/or Dive maps will be displayed with an opacity set using the slider.</p></body></html> Show Emerge/Dive Maps @@ -2570,7 +2567,7 @@ false - Open the selected Emerge Map + <html><head/><body><p>Open the selected Emerge Map</p></body></html> ... @@ -3079,45 +3076,6 @@ Ctrl+T - - - true - - - - :/icons/sort_alphabet.ico:/icons/sort_alphabet.ico - - - Sort by &Location - - - - - true - - - - :/icons/sort_number.ico:/icons/sort_number.ico - - - Sort by &Group - - - Sort by Group - - - - - true - - - - :/icons/sort_map.ico:/icons/sort_map.ico - - - Sort by &Layout - - About Porymap... diff --git a/forms/maplisttoolbar.ui b/forms/maplisttoolbar.ui index 54eb48d0..07878f0a 100644 --- a/forms/maplisttoolbar.ui +++ b/forms/maplisttoolbar.ui @@ -32,7 +32,7 @@ - Add a new folder to the list. + <html><head/><body><p>Add a new folder to the list.</p></body></html> @@ -73,7 +73,7 @@ - Expand all folders in the list. + <html><head/><body><p>Expand all folders in the list.</p></body></html> @@ -93,7 +93,7 @@ - Collapse all folders in the list. + <html><head/><body><p>Collapse all folders in the list.</p></body></html> @@ -113,7 +113,7 @@ - If enabled, folders may be renamed and items in the list may be rearranged. + <html><head/><body><p>If enabled, folders may be renamed and items in the list may be rearranged.</p></body></html> diff --git a/forms/newmapconnectiondialog.ui b/forms/newmapconnectiondialog.ui index 9b3a3b6e..85aeec72 100644 --- a/forms/newmapconnectiondialog.ui +++ b/forms/newmapconnectiondialog.ui @@ -17,10 +17,10 @@ - QFrame::NoFrame + QFrame::Shape::NoFrame - QFrame::Plain + QFrame::Shadow::Plain @@ -45,7 +45,7 @@ - The name of the map to connect to the current map. + <html><head/><body><p>The name of the map to connect to the current map.</p></body></html> @@ -59,7 +59,7 @@ - Where the connected map should be positioned relative to the current map. + <html><head/><body><p>Where the connected map should be positioned relative to the current map.</p></body></html> @@ -82,10 +82,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok diff --git a/forms/preferenceeditor.ui b/forms/preferenceeditor.ui index 2ce37cbe..83de6f18 100644 --- a/forms/preferenceeditor.ui +++ b/forms/preferenceeditor.ui @@ -40,7 +40,7 @@ - If checked, a prompt to reload your project will appear if relevant project files are edited + <html><head/><body><p>If checked, a prompt to reload your project will appear if relevant project files are edited</p></body></html> Monitor project files @@ -50,7 +50,7 @@ - If checked, Porymap will automatically open your most recently opened project on startup + <html><head/><body><p>If checked, Porymap will automatically open your most recently opened project on startup</p></body></html> Open recent project on launch @@ -60,7 +60,7 @@ - If checked, Porymap will automatically alert you on startup if a new release is available + <html><head/><body><p>If checked, Porymap will automatically alert you on startup if a new release is available</p></body></html> Automatically check for updates @@ -112,7 +112,7 @@ - If checked, no warning will be shown when deleting an event that has an associated #define that may also be deleted. + <html><head/><body><p>If checked, no warning will be shown when deleting an event that has an associated #define that may also be deleted.</p></body></html> Disable warning when deleting events with IDs @@ -138,7 +138,7 @@ - If enabled, an event can be selected by clicking directly on the opaque pixels of its sprite. This may be preferable when events are overlapping. + <html><head/><body><p>If enabled, an event can be selected by clicking directly on the opaque pixels of its sprite. This may be preferable when events are overlapping.</p></body></html> Select by clicking on sprite @@ -148,7 +148,7 @@ - If enabled, an event can be selected by clicking anywhere within its sprite dimensions. This may be preferable for events with small or mostly transparent sprites. + <html><head/><body><p>If enabled, an event can be selected by clicking anywhere within its sprite dimensions. This may be preferable for events with small or mostly transparent sprites.</p></body></html> Select by clicking within bounding rectangle @@ -231,7 +231,7 @@ - The shell command for your preferred text editor (possibly an absolute path if the program doesn't exist in your PATH). + <html><head/><body><p>The shell command for your preferred text editor (possibly an absolute path if the program doesn't exist in your PATH).</p></body></html> e.g. code %D @@ -264,7 +264,7 @@ - The shell command for your preferred text editor to open a file to a specific line number (possibly an absolute path if the program doesn't exist in your PATH). + <html><head/><body><p>The shell command for your preferred text editor to open a file to a specific line number (possibly an absolute path if the program doesn't exist in your PATH).</p></body></html> e.g. code --goto %F:%L diff --git a/forms/projectsettingseditor.ui b/forms/projectsettingseditor.ui index 642c13a8..4cf06515 100644 --- a/forms/projectsettingseditor.ui +++ b/forms/projectsettingseditor.ui @@ -52,7 +52,7 @@ - Whether map script files should prefer using .pory + <html><head/><body><p>Whether map script files should prefer using .pory</p></body></html> Use Poryscript @@ -61,6 +61,9 @@ + + <html><head/><body><p>If enabled, Porymap will display wild encounter data on the Wild Pokémon tab.</p></body></html> + Show Wild Encounter Tables @@ -99,7 +102,7 @@ - Restore the data in the prefabs file to the version defaults. Will create a new file if one doesn't exist. + <html><head/><body><p>Restore the data in the prefabs file to the version defaults. Will create a new file if one doesn't exist.</p></body></html> Import Defaults @@ -109,7 +112,7 @@ - The file that will be used to populate the Prefabs tab + <html><head/><body><p>The file that will be used to populate the Prefabs tab</p></body></html> prefabs.json @@ -148,7 +151,7 @@ - The image sheet that will be used to represent elevation and collision on the Collision tab + <html><head/><body><p>The image sheet that will be used to represent elevation and collision on the Collision tab</p></body></html> true @@ -176,7 +179,7 @@ - The maximum collision value represented with an icon on the image sheet + <html><head/><body><p>The maximum collision value represented with an icon on the image sheet</p></body></html> @@ -197,7 +200,7 @@ - The maximum elevation value represented with an icon on the image sheet + <html><head/><body><p>The maximum elevation value represented with an icon on the image sheet</p></body></html> @@ -270,7 +273,7 @@ - The icon that will be displayed on the Wild Pokémon tab for the above species + <html><head/><body><p>The icon that will be displayed on the Wild Pokémon tab for the above species</p></body></html> true @@ -304,22 +307,22 @@ - - 0 - <html><head/><body><p>The distance (in pixels) that a player is able to see North of their character's position in-game. By default this is the distance from the center 16x16 to the edge of the 160 pixel tall GBA screen.</p></body></html> + + 0 + - - 0 - <html><head/><body><p>The distance (in pixels) that a player is able to see South of their character's position in-game. By default this is the distance from the center 16x16 to the edge of the 160 pixel tall GBA screen.</p></body></html> + + 0 + @@ -342,22 +345,22 @@ - - 0 - <html><head/><body><p>The distance (in pixels) that a player is able to see West of their character's position in-game. By default this is the distance from the center 16x16 to the edge of the 240 pixel wide GBA screen.</p></body></html> + + 0 + - - 0 - <html><head/><body><p>The distance (in pixels) that a player is able to see East of their character's position in-game. By default this is the distance from the center 16x16 to the edge of the 240 pixel wide GBA screen.</p></body></html> + + 0 + @@ -463,7 +466,7 @@ 0 0 - 561 + 570 622 @@ -491,14 +494,14 @@ - The default elevation that will be used to fill new maps + <html><head/><body><p>The default elevation that will be used to fill new maps</p></body></html> - Whether a separate text.inc or text.pory file will be created for new maps, alongside the scripts file + <html><head/><body><p>Whether a separate text.inc or text.pory file will be created for new maps, alongside the scripts file</p></body></html> Create separate text file @@ -507,6 +510,9 @@ + + <html><head/><body><p>The default layout width for new maps</p></body></html> + 1 @@ -514,6 +520,9 @@ + + <html><head/><body><p>The default layout height for new maps</p></body></html> + 1 @@ -543,14 +552,14 @@ - The default metatile value that will be used to fill new maps + <html><head/><body><p>The default metatile value that will be used to fill new maps</p></body></html> - The default collision that will be used to fill new maps + <html><head/><body><p>The default collision that will be used to fill new maps</p></body></html> @@ -573,7 +582,7 @@ - A comma-separated list of metatile values that will be used to fill new map borders + <html><head/><body><p>A comma-separated list of metatile values that will be used to fill new map borders</p></body></html> @@ -596,28 +605,28 @@ - The default metatile value that will be used for the top-left border metatile on new maps. + <html><head/><body><p>The default metatile value that will be used for the top-left border metatile on new maps.</p></body></html> - The default metatile value that will be used for the top-right border metatile on new maps. + <html><head/><body><p>The default metatile value that will be used for the top-right border metatile on new maps.</p></body></html> - The default metatile value that will be used for the bottom-left border metatile on new maps. + <html><head/><body><p>The default metatile value that will be used for the bottom-left border metatile on new maps.</p></body></html> - The default metatile value that will be used for the bottom-right border metatile on new maps. + <html><head/><body><p>The default metatile value that will be used for the bottom-right border metatile on new maps.</p></body></html> @@ -697,7 +706,7 @@ - The mask used to read/write metatile IDs in map data. + <html><head/><body><p>The mask used to read/write metatile IDs in map data.</p></body></html> @@ -711,7 +720,7 @@ - The mask used to read/write collision values in map data. + <html><head/><body><p>The mask used to read/write collision values in map data.</p></body></html> @@ -725,7 +734,7 @@ - The mask used to read/write elevation values in map data. + <html><head/><body><p>The mask used to read/write elevation values in map data.</p></body></html> @@ -754,7 +763,7 @@ - Whether "Allow Running", "Allow Biking" and "Allow Dig & Escape Rope" are default options for Map Headers + <html><head/><body><p>Whether &quot;Allow Running&quot;, &quot;Allow Biking&quot; and &quot;Allow Dig &amp; Escape Rope&quot; are default options for Map Headers</p></body></html> Enable 'Allow Running/Biking/Escaping' @@ -764,7 +773,7 @@ - Whether "Floor Number" is a default option for Map Headers + <html><head/><body><p>Whether &quot;Floor Number&quot; is a default option for Map Headers</p></body></html> Enable 'Floor Number' @@ -774,7 +783,7 @@ - Whether the dimensions of the border can be changed. If not set, all borders are 2x2 + <html><head/><body><p>Whether the dimensions of the border can be changed. If not set, all borders are 2x2</p></body></html> Enable Custom Border Size @@ -834,7 +843,7 @@ 0 0 - 561 + 570 798 @@ -853,7 +862,11 @@ - + + + <html><head/><body><p>The default primary tileset to use for new maps/layouts.</p></body></html> + + @@ -863,7 +876,11 @@ - + + + <html><head/><body><p>The default secondary tileset to use for new maps/layouts.</p></body></html> + + @@ -877,7 +894,7 @@ - Fully transparent pixels will be rendered as black pixels (the Pokémon games do this by default) + <html><head/><body><p>Fully transparent pixels will be rendered as black pixels (the Pokémon games do this by default)</p></body></html> Render as black @@ -887,7 +904,7 @@ - Fully transparent pixels will be rendered using the first palette color (this the default behavior for the GBA) + <html><head/><body><p>Fully transparent pixels will be rendered using the first palette color (this the default behavior for the GBA)</p></body></html> Render using first palette color @@ -913,7 +930,7 @@ - This raw tile value will be used to fill the unused bottom layer of Normal metatiles + <html><head/><body><p>This raw tile value will be used to fill the unused bottom layer of Normal metatiles</p></body></html> @@ -927,7 +944,7 @@ - This raw tile value will be used to fill the unused top layer of Covered metatiles + <html><head/><body><p>This raw tile value will be used to fill the unused top layer of Covered metatiles</p></body></html> @@ -941,7 +958,7 @@ - This raw tile value will be used to fill the unused middle layer of Split metatiles + <html><head/><body><p>This raw tile value will be used to fill the unused middle layer of Split metatiles</p></body></html> @@ -985,22 +1002,19 @@ - The mask used to read/write Layer Type from the metatile's attributes data. If 0, this attribute is disabled. + <html><head/><body><p>The mask used to read/write Layer Type from the metatile's attributes data. If 0, this attribute is disabled.</p></body></html> - The mask used to read/write Metatile Behavior from the metatile's attributes data. If 0, this attribute is disabled. + <html><head/><body><p>The mask used to read/write Metatile Behavior from the metatile's attributes data. If 0, this attribute is disabled.</p></body></html> - - The number of bytes used per metatile for metatile attributes - Attributes size (in bytes) @@ -1031,6 +1045,9 @@ + + <html><head/><body><p>If checked, metatiles will be interpreted as having 3 layers of 4 tiles each (12 tiles total) as opposed to the default 2 layers of 4 tiles each (8 total).</p></body></html> + Enable Triple Layer Metatiles @@ -1039,7 +1056,7 @@ - The mask used to read/write Terrain Type from the metatile's attributes data. If 0, this attribute is disabled. + <html><head/><body><p>The mask used to read/write Terrain Type from the metatile's attributes data. If 0, this attribute is disabled.</p></body></html> @@ -1066,7 +1083,7 @@ - The mask used to read/write Encounter Type from the metatile's attributes data. If 0, this attribute is disabled. + <html><head/><body><p>The mask used to read/write Encounter Type from the metatile's attributes data. If 0, this attribute is disabled.</p></body></html> @@ -1079,6 +1096,9 @@ + + <html><head/><body><p>The number of bytes each metatile has for metatile attributes. This is the metadata about each metatile like behvior, layer type, etc.</p></body></html> + false @@ -1119,7 +1139,7 @@ - Whether the C data outputted for new tilesets will include the "callback" field + <html><head/><body><p>Whether the C data outputted for new tilesets will include the &quot;callback&quot; field</p></body></html> Output 'callback' field @@ -1129,7 +1149,7 @@ - Whether the C data outputted for new tilesets will include the "isCompressed" field + <html><head/><body><p>Whether the C data outputted for new tilesets will include the &quot;isCompressed&quot; field</p></body></html> Output 'isCompressed' field @@ -1176,7 +1196,7 @@ 0 0 - 561 + 570 840 @@ -1204,7 +1224,7 @@ - The icon that will be used to represent Warp events + <html><head/><body><p>The icon that will be used to represent Warp events</p></body></html> true @@ -1214,7 +1234,7 @@ - The icon that will be used to represent Heal Location events + <html><head/><body><p>The icon that will be used to represent Heal Location events</p></body></html> true @@ -1238,7 +1258,7 @@ - The icon that will be used to represent Object events that don't have their own sprite + <html><head/><body><p>The icon that will be used to represent Object events that don't have their own sprite</p></body></html> true @@ -1255,7 +1275,7 @@ - The icon that will be used to represent Trigger events + <html><head/><body><p>The icon that will be used to represent Trigger events</p></body></html> true @@ -1265,7 +1285,7 @@ - The icon that will be used to represent BG events + <html><head/><body><p>The icon that will be used to represent BG events</p></body></html> true @@ -1339,7 +1359,7 @@ - Remove the current text from the list + <html><head/><body><p>Remove the current text from the list</p></body></html> ... @@ -1363,7 +1383,7 @@ - If checked, Warp Events will not display a warning about incompatible metatile behaviors + <html><head/><body><p>If checked, Warp Events will not display a warning about incompatible metatile behaviors</p></body></html> Disable Warning @@ -1376,7 +1396,7 @@ - Metatile Behaviors on this list won't trigger warnings for Warp Events + <html><head/><body><p>Metatile Behaviors on this list won't trigger warnings for Warp Events</p></body></html> true @@ -1392,7 +1412,7 @@ - Add the current text to the list + <html><head/><body><p>Add the current text to the list</p></body></html> ... @@ -1558,8 +1578,8 @@ 0 0 - 561 - 593 + 570 + 499 @@ -1605,8 +1625,8 @@ 0 0 - 535 - 531 + 544 + 437 @@ -1647,8 +1667,8 @@ 0 0 - 561 - 593 + 570 + 499 @@ -1694,8 +1714,8 @@ 0 0 - 535 - 531 + 544 + 437 diff --git a/forms/regionmappropertiesdialog.ui b/forms/regionmappropertiesdialog.ui index 80e7020a..88b465f4 100644 --- a/forms/regionmappropertiesdialog.ui +++ b/forms/regionmappropertiesdialog.ui @@ -21,7 +21,7 @@ - QFormLayout::AllNonFixedFieldsGrow + QFormLayout::FieldGrowthPolicy::AllNonFixedFieldsGrow @@ -33,7 +33,7 @@ - A nickname for this region map that will differentiate it from others (should be unique). + <html><head/><body><p>A nickname for this region map that will differentiate it from others (should be unique).</p></body></html> @@ -131,7 +131,7 @@ - The height of the tilemap + <html><head/><body><p>The height of the tilemap</p></body></html> 255 @@ -148,10 +148,10 @@ - QFrame::NoFrame + QFrame::Shape::NoFrame - QFrame::Raised + QFrame::Shadow::Raised @@ -218,10 +218,10 @@ <html><head/><body><p>Path to the tilemap binary relative to the project root.</p></body></html> - QFrame::NoFrame + QFrame::Shape::NoFrame - QFrame::Raised + QFrame::Shadow::Raised @@ -269,10 +269,10 @@ - QFrame::NoFrame + QFrame::Shape::NoFrame - QFrame::Plain + QFrame::Shadow::Plain @@ -392,10 +392,10 @@ - QFrame::NoFrame + QFrame::Shape::NoFrame - QFrame::Raised + QFrame::Shadow::Raised @@ -487,7 +487,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -517,7 +517,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -590,7 +590,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -617,7 +617,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -646,7 +646,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -659,10 +659,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok diff --git a/include/core/utility.h b/include/core/utility.h index 6613ee71..09caebce 100644 --- a/include/core/utility.h +++ b/include/core/utility.h @@ -9,6 +9,7 @@ namespace Util { int roundUp(int numToRound, int multiple); QString toDefineCase(QString input); QString toHexString(uint32_t value, int minLength = 0); + QString toHtmlParagraph(const QString &text); Qt::Orientations getOrientation(bool xflip, bool yflip); } diff --git a/src/core/utility.cpp b/src/core/utility.cpp index 55830b8a..7c7e5435 100644 --- a/src/core/utility.cpp +++ b/src/core/utility.cpp @@ -43,6 +43,10 @@ QString Util::toHexString(uint32_t value, int minLength) { return "0x" + QString("%1").arg(value, minLength, 16, QChar('0')).toUpper(); } +QString Util::toHtmlParagraph(const QString &text) { + return QString("

%1

").arg(text); +} + Qt::Orientations Util::getOrientation(bool xflip, bool yflip) { Qt::Orientations flags; if (xflip) flags |= Qt::Orientation::Horizontal; diff --git a/src/ui/customattributestable.cpp b/src/ui/customattributestable.cpp index 28153b4d..ba9409c8 100644 --- a/src/ui/customattributestable.cpp +++ b/src/ui/customattributestable.cpp @@ -1,6 +1,7 @@ #include "customattributestable.h" #include "parseutil.h" #include "noscrollspinbox.h" +#include "utility.h" #include #include @@ -96,7 +97,7 @@ int CustomAttributesTable::addAttribute(const QString &key, const QJsonValue &va keyItem->setFlags(Qt::ItemIsEnabled); keyItem->setData(DataRole::JsonType, type); // Record the type for writing to the file keyItem->setTextAlignment(Qt::AlignCenter); - keyItem->setToolTip(key); // Display name as tool tip in case it's too long to see in the cell + keyItem->setToolTip(Util::toHtmlParagraph(key)); // Display name as tool tip in case it's too long to see in the cell this->setItem(rowIndex, Column::Key, keyItem); // Add value to table diff --git a/src/ui/eventframes.cpp b/src/ui/eventframes.cpp index bce55c66..d3cfdc80 100644 --- a/src/ui/eventframes.cpp +++ b/src/ui/eventframes.cpp @@ -209,15 +209,16 @@ void ObjectFrame::setup() { // sprite combo QFormLayout *l_form_sprite = new QFormLayout(); this->combo_sprite = new NoScrollComboBox(this); - this->combo_sprite->setToolTip("The sprite graphics to use for this object."); + static const QString combo_sprite_toolTip = Util::toHtmlParagraph("The sprite graphics to use for this object."); + this->combo_sprite->setToolTip(combo_sprite_toolTip); l_form_sprite->addRow("Sprite", this->combo_sprite); this->layout_contents->addLayout(l_form_sprite); // movement QFormLayout *l_form_movement = new QFormLayout(); this->combo_movement = new NoScrollComboBox(this); - this->combo_movement->setToolTip("The object's natural movement behavior when\n" - "the player is not interacting with it."); + static const QString combo_movement_toolTip = Util::toHtmlParagraph("The object's natural movement behavior when the player is not interacting with it."); + this->combo_movement->setToolTip(combo_movement_toolTip); l_form_movement->addRow("Movement", this->combo_movement); this->layout_contents->addLayout(l_form_movement); @@ -226,15 +227,15 @@ void ObjectFrame::setup() { this->spinner_radius_x = new NoScrollSpinBox(this); this->spinner_radius_x->setMinimum(0); this->spinner_radius_x->setMaximum(255); - this->spinner_radius_x->setToolTip("The maximum number of metatiles this object\n" - "is allowed to move left or right during its\n" - "normal movement behavior actions."); + static const QString spinner_radius_x_toolTip = Util::toHtmlParagraph("The maximum number of metatiles this object is allowed to move left " + "or right during its normal movement behavior actions."); + this->spinner_radius_x->setToolTip(spinner_radius_x_toolTip); this->spinner_radius_y = new NoScrollSpinBox(this); this->spinner_radius_y->setMinimum(0); this->spinner_radius_y->setMaximum(255); - this->spinner_radius_y->setToolTip("The maximum number of metatiles this object\n" - "is allowed to move up or down during its\n" - "normal movement behavior actions."); + static const QString spinner_radius_y_toolTip = Util::toHtmlParagraph("The maximum number of metatiles this object is allowed to move up " + "or down during its normal movement behavior actions."); + this->spinner_radius_y->setToolTip(spinner_radius_y_toolTip); l_form_radii_xy->addRow("Movement Radius X", this->spinner_radius_x); l_form_radii_xy->addRow("Movement Radius Y", this->spinner_radius_y); this->layout_contents->addLayout(l_form_radii_xy); @@ -242,11 +243,13 @@ void ObjectFrame::setup() { // script QFormLayout *l_form_script = new QFormLayout(); this->combo_script = new NoScrollComboBox(this); - this->combo_script->setToolTip("The script which is executed with this event."); + static const QString combo_script_toolTip = Util::toHtmlParagraph("The script that is executed with this event."); + this->combo_script->setToolTip(combo_script_toolTip); // Add button next to combo which opens combo's current script. this->button_script = new QToolButton(this); - this->button_script->setToolTip("Go to this script definition in text editor."); + static const QString button_script_toolTip = Util::toHtmlParagraph("Go to this script definition in text editor."); + this->button_script->setToolTip(button_script_toolTip); this->button_script->setFixedSize(this->combo_script->height(), this->combo_script->height()); this->button_script->setIcon(QFileIconProvider().icon(QFileIconProvider::File)); @@ -261,24 +264,25 @@ void ObjectFrame::setup() { // event flag QFormLayout *l_form_flag = new QFormLayout(); this->combo_flag = new NoScrollComboBox(this); - this->combo_flag->setToolTip("The flag which hides the object when set."); + static const QString combo_flag_toolTip = Util::toHtmlParagraph("The flag that hides the object when set."); + this->combo_flag->setToolTip(combo_flag_toolTip); l_form_flag->addRow("Event Flag", this->combo_flag); this->layout_contents->addLayout(l_form_flag); // trainer type QFormLayout *l_form_trainer = new QFormLayout(); this->combo_trainer_type = new NoScrollComboBox(this); - this->combo_trainer_type->setToolTip("The trainer type of this object event.\n" - "If it is not a trainer, use NONE. SEE ALL DIRECTIONS\n" - "should only be used with a sight radius of 1."); + static const QString combo_trainer_type_toolTip = Util::toHtmlParagraph("The trainer type of this object event. If it is not a trainer, use NONE. " + "SEE ALL DIRECTIONS should only be used with a sight radius of 1."); + this->combo_trainer_type->setToolTip(combo_trainer_type_toolTip); l_form_trainer->addRow("Trainer Type", this->combo_trainer_type); this->layout_contents->addLayout(l_form_trainer); // sight radius / berry tree id QFormLayout *l_form_radius_treeid = new QFormLayout(); this->combo_radius_treeid = new NoScrollComboBox(this); - this->combo_radius_treeid->setToolTip("The maximum sight range of a trainer,\n" - "OR the unique id of the berry tree."); + static const QString combo_radius_treeid_toolTip = Util::toHtmlParagraph("The maximum sight range of a trainer, OR the unique id of the berry tree."); + this->combo_radius_treeid->setToolTip(combo_radius_treeid_toolTip); l_form_radius_treeid->addRow("Sight Radius / Berry Tree ID", this->combo_radius_treeid); this->layout_contents->addLayout(l_form_radius_treeid); @@ -420,14 +424,16 @@ void CloneObjectFrame::setup() { // clone map id combo QFormLayout *l_form_dest_map = new QFormLayout(); this->combo_target_map = new NoScrollComboBox(this); - this->combo_target_map->setToolTip("The name of the map that the object being cloned is on."); + static const QString combo_target_map_toolTip = Util::toHtmlParagraph("The name of the map that the object being cloned is on."); + this->combo_target_map->setToolTip(combo_target_map_toolTip); l_form_dest_map->addRow("Target Map", this->combo_target_map); this->layout_contents->addLayout(l_form_dest_map); // clone local id spinbox QFormLayout *l_form_dest_id = new QFormLayout(); this->spinner_target_id = new NoScrollSpinBox(this); - this->spinner_target_id->setToolTip("event_object ID of the object being cloned."); + static const QString spinner_target_id_toolTip = Util::toHtmlParagraph("event_object ID of the object being cloned."); + this->spinner_target_id->setToolTip(spinner_target_id_toolTip); l_form_dest_id->addRow("Target Local ID", this->spinner_target_id); this->layout_contents->addLayout(l_form_dest_id); @@ -497,21 +503,21 @@ void WarpFrame::setup() { // desination map combo QFormLayout *l_form_dest_map = new QFormLayout(); this->combo_dest_map = new NoScrollComboBox(this); - this->combo_dest_map->setToolTip("The destination map name of the warp."); + static const QString combo_dest_map_toolTip = Util::toHtmlParagraph("The destination map name of the warp."); + this->combo_dest_map->setToolTip(combo_dest_map_toolTip); l_form_dest_map->addRow("Destination Map", this->combo_dest_map); this->layout_contents->addLayout(l_form_dest_map); // desination warp id QFormLayout *l_form_dest_warp = new QFormLayout(); this->combo_dest_warp = new NoScrollComboBox(this); - this->combo_dest_warp->setToolTip("The warp id on the destination map."); + static const QString combo_dest_warp_toolTip = Util::toHtmlParagraph("The warp id on the destination map."); + this->combo_dest_warp->setToolTip(combo_dest_warp_toolTip); l_form_dest_warp->addRow("Destination Warp", this->combo_dest_warp); this->layout_contents->addLayout(l_form_dest_warp); // warning - static const QString warningText = "Warning:\n" - "This warp event is not positioned on a metatile with a warp behavior.\n" - "Click this warning for more details."; + auto warningText = QStringLiteral("Warning:\nThis warp event is not positioned on a metatile with a warp behavior.\nClick this warning for more details."); QVBoxLayout *l_vbox_warning = new QVBoxLayout(); this->warning = new QPushButton(warningText, this); this->warning->setFlat(true); @@ -580,22 +586,25 @@ void TriggerFrame::setup() { // script combo QFormLayout *l_form_script = new QFormLayout(); this->combo_script = new NoScrollComboBox(this); - this->combo_script->setToolTip("The script which is executed with this event."); + static const QString combo_script_toolTip = Util::toHtmlParagraph("The script that is executed with this event."); + this->combo_script->setToolTip(combo_script_toolTip); l_form_script->addRow("Script", this->combo_script); this->layout_contents->addLayout(l_form_script); // var combo QFormLayout *l_form_var = new QFormLayout(); this->combo_var = new NoScrollComboBox(this); - this->combo_var->setToolTip("The variable by which the script is triggered.\n" - "The script is triggered when this variable's value matches 'Var Value'."); + static const QString combo_var_toolTip = Util::toHtmlParagraph("The variable by which the script is triggered. " + "The script is triggered when this variable's value matches 'Var Value'."); + this->combo_var->setToolTip(combo_var_toolTip); l_form_var->addRow("Var", this->combo_var); this->layout_contents->addLayout(l_form_var); // var value combo QFormLayout *l_form_var_val = new QFormLayout(); this->combo_var_value = new NoScrollComboBox(this); - this->combo_var_value->setToolTip("The variable's value which triggers the script."); + static const QString combo_var_value_toolTip = Util::toHtmlParagraph("The variable's value that triggers the script."); + this->combo_var_value->setToolTip(combo_var_value_toolTip); l_form_var_val->addRow("Var Value", this->combo_var_value); this->layout_contents->addLayout(l_form_var_val); @@ -668,7 +677,8 @@ void WeatherTriggerFrame::setup() { // weather combo QFormLayout *l_form_weather = new QFormLayout(); this->combo_weather = new NoScrollComboBox(this); - this->combo_weather->setToolTip("The weather that starts when the player steps on this spot."); + static const QString combo_weather_toolTip = Util::toHtmlParagraph("The weather that starts when the player steps on this spot."); + this->combo_weather->setToolTip(combo_weather_toolTip); l_form_weather->addRow("Weather", this->combo_weather); this->layout_contents->addLayout(l_form_weather); @@ -719,15 +729,16 @@ void SignFrame::setup() { // facing dir combo QFormLayout *l_form_facing_dir = new QFormLayout(); this->combo_facing_dir = new NoScrollComboBox(this); - this->combo_facing_dir->setToolTip("The direction which the player must be facing\n" - "to be able to interact with this event."); + static const QString combo_facing_dir_toolTip = Util::toHtmlParagraph("The direction that the player must be facing to be able to interact with this event."); + this->combo_facing_dir->setToolTip(combo_facing_dir_toolTip); l_form_facing_dir->addRow("Player Facing Direction", this->combo_facing_dir); this->layout_contents->addLayout(l_form_facing_dir); // script combo QFormLayout *l_form_script = new QFormLayout(); this->combo_script = new NoScrollComboBox(this); - this->combo_script->setToolTip("The script which is executed with this event."); + static const QString combo_script_toolTip = Util::toHtmlParagraph("The script that is executed with this event."); + this->combo_script->setToolTip(combo_script_toolTip); l_form_script->addRow("Script", this->combo_script); this->layout_contents->addLayout(l_form_script); @@ -790,14 +801,16 @@ void HiddenItemFrame::setup() { // item combo QFormLayout *l_form_item = new QFormLayout(); this->combo_item = new NoScrollComboBox(this); - this->combo_item->setToolTip("The item to be given."); + static const QString combo_item_toolTip = Util::toHtmlParagraph("The item to be given."); + this->combo_item->setToolTip(combo_item_toolTip); l_form_item->addRow("Item", this->combo_item); this->layout_contents->addLayout(l_form_item); // flag combo QFormLayout *l_form_flag = new QFormLayout(); this->combo_flag = new NoScrollComboBox(this); - this->combo_flag->setToolTip("The flag which is set when the hidden item is picked up."); + static const QString combo_flag_toolTip = Util::toHtmlParagraph("The flag that is set when the hidden item is picked up."); + this->combo_flag->setToolTip(combo_flag_toolTip); l_form_flag->addRow("Flag", this->combo_flag); this->layout_contents->addLayout(l_form_flag); @@ -806,7 +819,8 @@ void HiddenItemFrame::setup() { QFormLayout *l_form_quantity = new QFormLayout(hideable_quantity); l_form_quantity->setContentsMargins(0, 0, 0, 0); this->spinner_quantity = new NoScrollSpinBox(hideable_quantity); - this->spinner_quantity->setToolTip("The number of items received when the hidden item is picked up."); + static const QString spinner_quantity_toolTip = Util::toHtmlParagraph("The number of items received when the hidden item is picked up."); + this->spinner_quantity->setToolTip(spinner_quantity_toolTip); this->spinner_quantity->setMinimum(0x01); this->spinner_quantity->setMaximum(0xFF); l_form_quantity->addRow("Quantity", this->spinner_quantity); @@ -817,7 +831,8 @@ void HiddenItemFrame::setup() { QFormLayout *l_form_itemfinder = new QFormLayout(hideable_itemfinder); l_form_itemfinder->setContentsMargins(0, 0, 0, 0); this->check_itemfinder = new QCheckBox(hideable_itemfinder); - this->check_itemfinder->setToolTip("If checked, hidden item can only be picked up using the Itemfinder"); + static const QString check_itemfinder_toolTip = Util::toHtmlParagraph("If checked, hidden item can only be picked up using the Itemfinder"); + this->check_itemfinder->setToolTip(check_itemfinder_toolTip); l_form_itemfinder->addRow("Requires Itemfinder", this->check_itemfinder); this->layout_contents->addWidget(hideable_itemfinder); @@ -906,9 +921,9 @@ void SecretBaseFrame::setup() { // item combo QFormLayout *l_form_base_id = new QFormLayout(); this->combo_base_id = new NoScrollComboBox(this); - this->combo_base_id->setToolTip("The secret base id which is inside this secret\n" - "base entrance. Secret base ids are meant to be\n" - "unique to each and every secret base entrance."); + static const QString combo_base_id_toolTip = Util::toHtmlParagraph("The secret base id that is inside this secret base entrance. " + "Secret base ids are meant to be unique to each and every secret base entrance."); + this->combo_base_id->setToolTip(combo_base_id_toolTip); l_form_base_id->addRow("Secret Base", this->combo_base_id); this->layout_contents->addLayout(l_form_base_id); @@ -960,7 +975,8 @@ void HealLocationFrame::setup() { // ID QFormLayout *l_form_id = new QFormLayout(); this->line_edit_id = new QLineEdit(this); - this->line_edit_id->setToolTip("The unique identifier for this heal location."); + static const QString line_edit_id_toolTip = Util::toHtmlParagraph("The unique identifier for this heal location."); + this->line_edit_id->setToolTip(line_edit_id_toolTip); this->line_edit_id->setPlaceholderText(projectConfig.getIdentifier(ProjectIdentifier::define_heal_locations_prefix) + "MY_MAP"); l_form_id->addRow("ID", this->line_edit_id); this->layout_contents->addLayout(l_form_id); @@ -970,7 +986,8 @@ void HealLocationFrame::setup() { QFormLayout *l_form_respawn_map = new QFormLayout(hideable_respawn_map); l_form_respawn_map->setContentsMargins(0, 0, 0, 0); this->combo_respawn_map = new NoScrollComboBox(hideable_respawn_map); - this->combo_respawn_map->setToolTip("The map where the player will respawn after whiteout."); + static const QString combo_respawn_map_toolTip = Util::toHtmlParagraph("The map where the player will respawn after whiteout."); + this->combo_respawn_map->setToolTip(combo_respawn_map_toolTip); l_form_respawn_map->addRow("Respawn Map", this->combo_respawn_map); this->layout_contents->addWidget(hideable_respawn_map); @@ -979,8 +996,8 @@ void HealLocationFrame::setup() { QFormLayout *l_form_respawn_npc = new QFormLayout(hideable_respawn_npc); l_form_respawn_npc->setContentsMargins(0, 0, 0, 0); this->combo_respawn_npc = new NoScrollComboBox(hideable_respawn_npc); - this->combo_respawn_npc->setToolTip("event_object ID of the NPC the player interacts with\n" - "upon respawning after whiteout."); + static const QString combo_respawn_npc_toolTip = Util::toHtmlParagraph("event_object ID of the NPC the player interacts with upon respawning after whiteout."); + this->combo_respawn_npc->setToolTip(combo_respawn_npc_toolTip); l_form_respawn_npc->addRow("Respawn NPC", this->combo_respawn_npc); this->layout_contents->addWidget(hideable_respawn_npc); diff --git a/src/ui/maplisttoolbar.cpp b/src/ui/maplisttoolbar.cpp index 304d6490..f56be39b 100644 --- a/src/ui/maplisttoolbar.cpp +++ b/src/ui/maplisttoolbar.cpp @@ -93,7 +93,7 @@ void MapListToolBar::setEmptyFoldersVisible(bool visible) { } // Update tool tip to reflect what will happen if the button is pressed. - const QString toolTip = QString("%1 empty folders in the list.").arg(visible ? "Hide" : "Show"); + const QString toolTip = Util::toHtmlParagraph(QString("%1 empty folders in the list.").arg(visible ? "Hide" : "Show")); ui->button_ToggleEmptyFolders->setToolTip(toolTip); const QSignalBlocker b(ui->button_ToggleEmptyFolders); diff --git a/src/ui/projectsettingseditor.cpp b/src/ui/projectsettingseditor.cpp index 5bcf6399..ccbf1ec3 100644 --- a/src/ui/projectsettingseditor.cpp +++ b/src/ui/projectsettingseditor.cpp @@ -173,7 +173,10 @@ void ProjectSettingsEditor::initUi() { bool ProjectSettingsEditor::disableParsedSetting(QWidget * widget, const QString &identifier, const QString &filepath) { if (project && project->disabledSettingsNames.contains(identifier)) { widget->setEnabled(false); - widget->setToolTip(QString("This value has been set using '%1' in %2").arg(identifier).arg(filepath)); + QString toolTip = QString("This value has been set using '%1' in %2").arg(identifier).arg(filepath); + if (!widget->toolTip().isEmpty()) + toolTip.prepend(QString("%1\n\n").arg(widget->toolTip())); + widget->setToolTip(Util::toHtmlParagraph(toolTip)); return true; } return false;