Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix skill upgrade tooltip not updating #3393

Merged
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
9 changes: 9 additions & 0 deletions A3A/addons/core/functions/REINF/fn_FIAskillAdd.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ skillFIA = skillFIA + 1;
[_titleStr, format [localize "STR_A3A_fn_reinf_FIASkAdd_upgraded",skillFIA,FactionGet(reb,"name")]] call A3A_fnc_customHint;
publicVariable "skillFIA";
server setVariable ["resourcesFIA",_resourcesFIA,true];

//update tooltip
_display = findDisplay 100;
if (str (_display) != "no display") then
{
_ChildControl = _display displayCtrl 109;
Comment on lines +20 to +23
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General code quality notes:

  • _display and _childControl should be declared private.
  • Better check is isNull _display.
  • If the file's new or already using 4-space tabs then you should use 4-space tabs (ugh).

Doesn't matter here because the function is garbage tier code quality already, and the private doesn't matter for the call contexts currently used.

_ChildControl ctrlSetTooltip format [localize "STR_A3A_fn_dialogs_dialogHQ_upgrade",1000 + (1.5*((skillFIA) *750)),skillFIA];
};

[] spawn A3A_fnc_statistics;
{
_costs = server getVariable _x;
Expand Down