The International Simutrans Forum

 

Author Topic: [r9497] tooltip is not shown for scripted tool icon in menubars  (Read 168 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH

  • Coder/patcher
  • Devotee
  • *
  • Posts: 411
  • Languages: JP,EN
[r9497] tooltip is not shown for scripted tool icon in menubars
« on: December 10, 2020, 12:01:33 PM »
In r9497, tooltip is not shown for scripted tool icon in menubars. I think this is because get_tooltip() function is not correctly overridden and tool_t::get_tooltip() is called, that returns empty text.

In tool_exec_script_t and tool_exec_two_click_script_t, there is a line
Code: [Select]
using exec_script_base_t::get_tooltip;
Replacing this code with
Code: [Select]
const char *get_tooltip(const player_t *pl) const OVERRIDE { return exec_script_base_t::get_tooltip(pl); }solved the problem with my compiler.

I think "using" statement cannot be a substitute of override, but Dwachs, does this statement work as override?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4821
  • Languages: EN, DE, AT
Re: [r9497] tooltip is not shown for scripted tool icon in menubars
« Reply #1 on: December 10, 2020, 12:36:45 PM »
Thanks for the report. I was under the impression that 'using' had this effect, which it has not, apparently.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4821
  • Languages: EN, DE, AT
Re: [r9497] tooltip is not shown for scripted tool icon in menubars
« Reply #2 on: December 11, 2020, 09:34:03 AM »
in r9498. Thank you