Author Topic: [BUG] Selected button redrawn after backskip / Skill panel sound muted post-fix  (Read 2566 times)

0 Members and 1 Guest are viewing this topic.

Offline WillLem

  • Posts: 3379
  • Unity isn't sameness, it's togetherness
    • View Profile
This double-bug 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.

Offline WillLem

  • Posts: 3379
  • Unity isn't sameness, it's togetherness
    • View Profile
I think this should do it. This fix for bug 2 keeps the current fix for bug 1 intact:

Moved this...:
Code: [Select]
(in procedure TBaseSkillPanel.DrawHighlight)

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

...to here:
Code: [Select]
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;
« Last Edit: April 21, 2023, 02:58:06 AM by WillLem »

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Fixed the followup issue in commit d41be5d.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)