Skip to content

Commit 27b49a9

Browse files
committed
kabcorp last typed thing
1 parent 5fc6c0a commit 27b49a9

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/hUGEDriver

src/trackergrid.pas

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ TTrackerGrid = class(TCustomControl)
112112
Performed: TUndoDeque;
113113
Recall: TRedoStack;
114114

115+
LastFxParam: array [0..15] of Byte;
116+
115117
FHighlightedRow: Integer;
116118
FFontSize: Integer;
117119
procedure SetFontSize(AValue: Integer);
@@ -316,6 +318,8 @@ constructor TTrackerGrid.Create(
316318
PatternMap: TPatternMap;
317319
NumColumns: Integer;
318320
NumRows: Integer);
321+
var
322+
I: Integer;
319323
begin
320324
inherited Create(AOwner);
321325

@@ -337,6 +341,9 @@ constructor TTrackerGrid.Create(
337341
Performed := TUndoDeque.Create;
338342
Recall := TRedoStack.Create;
339343

344+
for I := Low(LastFxParam) to High(LastFxParam) do
345+
LastFxParam[I] := Byte(0);
346+
340347
DoubleBuffered := True;
341348
ControlStyle := ControlStyle + [csCaptureMouse, csClickEvents, csDoubleClicks];
342349
Self.Parent := Parent;
@@ -1067,7 +1074,11 @@ procedure TTrackerGrid.InputEffectCode(Key: Word);
10671074
EffectCode := 0;
10681075
EffectParams.Value := 0;
10691076
end
1070-
else KeycodeToHexNumber(Key, EffectCode);
1077+
else begin
1078+
KeycodeToHexNumber(Key, EffectCode);
1079+
if EffectParams.Value = 0 then
1080+
EffectParams.Value := LastFxParam[EffectCode];
1081+
end;
10711082

10721083
Invalidate;
10731084
EndUndoAction;
@@ -1083,8 +1094,10 @@ procedure TTrackerGrid.InputEffectParams(Key: Word);
10831094
EffectCode := 0;
10841095
EffectParams.Value := 0;
10851096
end
1086-
else if KeycodeToHexNumber(Key, Temp) then
1097+
else if KeycodeToHexNumber(Key, Temp) then begin
10871098
EffectParams.Value := ((EffectParams.Value mod $10) * $10) + Temp;
1099+
LastFxParam[EffectCode] := EffectParams.Value;
1100+
end;
10881101

10891102
Invalidate;
10901103
EndUndoAction;

0 commit comments

Comments
 (0)