Lemmings Forums

NeoLemmix => NeoLemmix Main => Archived Bugs & Suggestions => Topic started by: WillLem on April 14, 2023, 03:44:20 AM

Title: [BUG] Selected button redrawn after backskip / Skill panel sound muted post-fix
Post by: WillLem on April 14, 2023, 03:44:20 AM
This double-bug (https://www.lemmingsforums.net/index.php?topic=6195.msg98290#msg98290) is present in NeoLemmix as well (mods: by all means merge these topics).

The current fix for the first bug causes the second bug:

1) The 'selected' graphic is re-drawn over the pause button after subsequent backwards framesteps.

2) The skill panel sound (SFX_SKILLBUTTON / 'changeop') doesn't trigger.
Title: Re: [BUG] Selected button redrawn after backskip / Skill panel sound muted post-fix
Post by: WillLem on April 20, 2023, 04:32:18 PM
I think this should do it. This fix for bug 2 keeps the current fix for bug 1 intact:

Moved this...:

(in procedure TBaseSkillPanel.DrawHighlight)

if (fLastHighlitSkill <> spbNone) and (fLastHighlitSkill <> fHighlitSkill) then
    SoundManager.PlaySound(SFX_SKILLBUTTON);


...to here:

procedure TBaseSkillPanel.DrawButtonSelector(aButton: TSkillPanelButton; Highlight: Boolean);
begin
  if fGameWindow.IsHyperSpeed then Exit;
  if aButton = spbNone then Exit;
  if (aButton <= LAST_SKILL_BUTTON) then
  begin
    if (fLastHighlitSkill <> spbNone) and (fLastHighlitSkill <> fHighlitSkill) then      <--------------------------------------
    SoundManager.PlaySound(SFX_SKILLBUTTON);                                             <--------------------------------------
    if (fHighlitSkill = aButton) and Highlight then Exit;
    if (fHighlitSkill = spbNone) and not Highlight then Exit;
  end;
  if fButtonRects[aButton].Left <= 0 then Exit;

  RemoveHighlight(aButton);
  if Highlight then
    DrawHighlight(aButton);
end;
Title: Re: [BUG] Selected button redrawn after backskip / Skill panel sound muted post-fix
Post by: namida on July 20, 2023, 12:08:16 AM
Fixed the followup issue in commit d41be5d.