Skip to content

Commit

Permalink
fetcher: Don't show icons for empty file slots
Browse files Browse the repository at this point in the history
  • Loading branch information
ry755 committed May 5, 2024
1 parent 979617e commit d0290b7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions applications/fetcher/Browser.okm
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,19 @@ MODULE Browser;
overlay := get_window_overlay_number(PTROF(browserWindow));
WHILE i <| 12 DO
icon := PTROF(browserIcons[i]);
tempFileIconResPtr := get_resource(browserIconsResPtr, icon^.text + string_length(icon^.text) - 3, 4096);
IF tempFileIconResPtr THEN
set_tilemap(tempFileIconResPtr, 32, 32);
draw_tile_to_overlay(0, icon^.x, icon^.y, overlay);
free_memory(tempFileIconResPtr);
ELSE
tempFileIconResPtr := get_resource(browserIconsResPtr, "msc", 4096);
IF CompareString("<empty>", icon^.text) = 0 THEN
tempFileIconResPtr := get_resource(browserIconsResPtr, icon^.text + string_length(icon^.text) - 3, 4096);
IF tempFileIconResPtr THEN
set_tilemap(tempFileIconResPtr, 32, 32);
draw_tile_to_overlay(0, icon^.x, icon^.y, overlay);
free_memory(tempFileIconResPtr);
ELSE
tempFileIconResPtr := get_resource(browserIconsResPtr, "msc", 4096);
IF tempFileIconResPtr THEN
set_tilemap(tempFileIconResPtr, 32, 32);
draw_tile_to_overlay(0, icon^.x, icon^.y, overlay);
free_memory(tempFileIconResPtr);
END;
END;
END;
i := i + 1;
Expand Down

0 comments on commit d0290b7

Please sign in to comment.