Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions mod_nested_tooltips/ui/nested_tooltips_js_connection.nut
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ this.nested_tooltips_js_connection <- ::inherit("scripts/mods/msu/js_connection"
if (::getModSetting("mod_msu", "NestedTooltips_Bold").getValue()) styleString += "font-weight: bold;";
if (::getModSetting("mod_msu", "NestedTooltips_Italic").getValue()) styleString += "font-style: italic;";
if (::getModSetting("mod_msu", "NestedTooltips_Underline").getValue()) styleString += "text-decoration: underline;";

// replace tip of the day to show new style
local oldTipOfTheDay = ::MSU.NestedTooltips.TipOfTheDay;
::MSU.NestedTooltips.TipOfTheDay = format(::MSU.NestedTooltips.TipOfTheDayTemplate, styleString);
local hadTip = false;
for (local i = ::Const.TipOfTheDay.len() - 1; i >= 0; i--)
{
if (::Const.TipOfTheDay[i] == oldTipOfTheDay)
{
::Const.TipOfTheDay[i] = ::MSU.NestedTooltips.TipOfTheDay;
hadTip = true;
break;
}
}
// On game start/restart, add it to the array first
if (!hadTip)
{
::Const.TipOfTheDay.push(::MSU.NestedTooltips.TipOfTheDay);
}

this.m.JSHandle.asyncCall("updateNestedTooltipTextStyle", styleString);
}

Expand Down
4 changes: 3 additions & 1 deletion msu/msu_mod/~nested_tooltips/nested_tooltips.nut
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
::MSU.NestedTooltips <- {
SkillObjectsByFilename = {},
ItemObjectsByFilename = {},
PerkIDByFilename = {}
PerkIDByFilename = {},
TipOfTheDayTemplate = "MSU: You can hover over <span style='%s'>marked</span> text and certain icons in tooltips to show additional information.<br> Left-click on a nested tooltip to hide it, and right-click to hide all tooltips.",
TipOfTheDay = "" // placeholder, will be filled after replacing the template
};