diff --git a/Nenyoo/lib/tests/load_yim_test.lua b/Nenyoo/lib/tests/load_yim_test.lua index 733716f..5267606 100644 --- a/Nenyoo/lib/tests/load_yim_test.lua +++ b/Nenyoo/lib/tests/load_yim_test.lua @@ -240,6 +240,32 @@ for _, row in ipairs(kortz_info.rows) do end assert(colored_status, "Colored YimMenu status text lost its color") assert(expanded_help, "YimMenu help marker was not expanded in the panel") +local tooltip_explanations = { + "Enables the Trick or Treat event", + "Enables the Snowmen Collectibles event", + "Enables the Yeti Hunt event", + "Enables the special liveries for Knife", +} +local found_explanations = {} +for id in pairs(compat.info_pages) do + local page = compat.info_for_page(id) + for _, row in ipairs(page.rows) do + assert(row.text ~= "[?]", "Unexpanded help marker on " .. tostring(page.title)) + for i, explanation in ipairs(tooltip_explanations) do + if row.text:find(explanation, 1, true) then found_explanations[i] = true end + end + end +end +for i, explanation in ipairs(tooltip_explanations) do + assert(found_explanations[i], "Help text did not reach the panel: " .. explanation) +end +for _, action in ipairs(actions) do + assert(action.label ~= "[?]", "Help marker became an action label") +end +for _, input in ipairs(inputs) do + assert(input.label ~= "[?]", "Help marker became an input label") +end +assert(not list_names["[?]"], "Help marker became a submenu label") current_page_id = apartment_id panel_draw() local found_instruction = false diff --git a/Nenyoo/lib/yim_compat.lua b/Nenyoo/lib/yim_compat.lua index b9e3dcd..eec7846 100644 --- a/Nenyoo/lib/yim_compat.lua +++ b/Nenyoo/lib/yim_compat.lua @@ -496,7 +496,11 @@ local function record_text(value, color) if value == nil or value == "" then return end local label = tostring(value) if current_section.tooltip then - if current_section.last_ref then + if current_section.last_info_row then + local row = current_section.last_info_row + if row.text == "[?]" then row.text = label + else row.tooltip = label end + elseif current_section.last_ref then menu.set_help_text(current_section.last_ref, label) end return @@ -509,7 +513,9 @@ local function record_text(value, color) rows[#rows + 1] = row current_section.last_info_row = row current_section.last_ref = nil - if #compact <= 60 then current_section.last_text = compact:gsub(":$", "") end + if compact ~= "[?]" and #compact <= 60 then + current_section.last_text = compact:gsub(":$", "") + end end ImGui.Text = record_text ImGui.TextUnformatted = ImGui.Text