overlay: update UI for card manager (#294)

## Link to GitHub Issue, if one exists
n/a

## Description of change
Change the usage pattern for Card Manager UI.

### Previous behavior

Previously, it was a list of cards that you select, and click a button
to insert as P1 or P2.

This is fine, but users got confused when they pressed `Insert Card`
overlay key and got a different card inserted, or when auto-insert
didn't work as expected.

Additionally, if you play a game without continue (IIDX/DDR for
example), then it's cumbersome to bring up the overlay and click on
insert card every time.

### New behavior

Insert Card overlay now lets you pick a card and *slot* it into P1 or P2
side.

From that point on, the slotted card number is used as the override,
replacing what was previously passed to `-card0` or `-card1`. This means
that `Insert Card` button and auto-insert will pick up the new card and
use that instead.

## Compiling
👍 

## Testing
Tested 1p-only game (popn) and 2p games (DDR, IIDX).
This commit is contained in:
bicarus-dev
2025-04-07 01:49:07 -07:00
committed by GitHub
parent f7c274591a
commit 48186245fe
5 changed files with 233 additions and 107 deletions
+9 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <filesystem>
#include <optional>
#include "overlay/window.h"
@@ -10,6 +11,7 @@ namespace overlay::windows {
std::string name = "unnamed";
std::string id = "E004010000000000";
std::string search_string = "";
bool read_only = false;
float color[3] {};
};
@@ -29,7 +31,10 @@ namespace overlay::windows {
char name_buffer[65] {};
char card_buffer[17] {};
float color_buffer[3] {};
std::optional<CardEntry> card_cmd_overrides[2];
std::optional<CardEntry> loaded_card[2];
CardEntry *current_card = nullptr;
std::string search_filter = "";
@@ -41,10 +46,13 @@ namespace overlay::windows {
void generate_search_string(CardEntry *card);
void generate_random_color();
void build_card();
bool build_card(int reader);
void open_card_editor();
void build_card_editor();
void build_card_list();
void build_card_selectable(CardEntry &card);
void build_footer();
void insert_card_over_api(int reader, CardEntry &card);
};
}