Skip to content

Commit

Permalink
Fixes to scores menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Dec 5, 2024
1 parent 04cb3d9 commit 478501f
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 99 deletions.
14 changes: 14 additions & 0 deletions data/raw/keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4861,6 +4861,20 @@
{ "input_method": "keyboard_code", "mod": [ "ctrl" ], "key": "y" }
]
},
{
"type": "keybinding",
"id": "TOGGLE_MONSTER_GROUP",
"category": "SCORES_UI",
"name": "Toggle monster group",
"bindings": [ { "input_method": "keyboard_any", "key": "m" } ]
},
{
"type": "keybinding",
"id": "TOGGLE_NPC_GROUP",
"category": "SCORES_UI",
"name": "Toggle NPC group",
"bindings": [ { "input_method": "keyboard_any", "key": "n" } ]
},
{
"type": "keybinding",
"id": "HELP_KEYBINDINGS",
Expand Down
22 changes: 22 additions & 0 deletions src/enum_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,26 @@ inline bool operator!( E e )
return !static_cast<I>( e );
}

template<typename E>
static E &operator++( E &e )
{
using I = std::underlying_type_t<E>;
e = static_cast<E>( static_cast<I>( e ) + 1 );
if( e == enum_traits<E>::last ) {
e = enum_traits<E>::first;
}
return e;
}

template<typename E>
static E &operator--( E &e )
{
using I = std::underlying_type_t<E>;
if( e == enum_traits<E>::first ) {
e = enum_traits<E>::last;
}
e = static_cast<E>( static_cast<I>( e ) - 1 );
return e;
}

#endif // CATA_SRC_ENUM_TRAITS_H
Loading

0 comments on commit 478501f

Please sign in to comment.