Skip to content

Commit

Permalink
fix changing tile in map editor changes tool + not needing to hold sh…
Browse files Browse the repository at this point in the history
…ift to show sprites (nesbox#2631)
  • Loading branch information
Miguel-hrvs authored Jul 13, 2024
1 parent d21a052 commit e1a5c92
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/studio/editors/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,23 +1214,29 @@ static void copyFromClipboard(Map* map)
}
}

static inline bool keyWasPressedOnce(Map* map, s32 key)
{
tic_mem* tic = map->tic;

return tic_api_keyp(tic, key, -1, -1);
}

// tic_api_key(tic,

static void processKeyboard(Map* map)
{
tic_mem* tic = map->tic;

if(isIdle(map))
{
if(tic_api_key(tic, tic_key_shift))
if(!sheetVisible(map) && keyWasPressedOnce(map, tic_key_shift))
{
if(!sheetVisible(map))
{
map->anim.movie = resetMovie(&map->anim.show);
map->sheet.keep = false;
}
map->sheet.keep = true;
}
else
{
if(!map->sheet.keep && sheetVisible(map))
if(map->sheet.keep && sheetVisible(map) && keyWasPressedOnce(map, tic_key_shift))
map->anim.movie = resetMovie(&map->anim.hide);
}
}
Expand Down

0 comments on commit e1a5c92

Please sign in to comment.