mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-04 15:50:42 -07:00
Initial commit for GitHub migration based on spice2x-25-03-03
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include "overlay/window.h"
|
||||
|
||||
namespace overlay::windows {
|
||||
|
||||
struct CardEntry {
|
||||
std::string name = "unnamed";
|
||||
std::string id = "E004010000000000";
|
||||
std::string search_string = "";
|
||||
float color[3] {};
|
||||
};
|
||||
|
||||
class CardManager : public Window {
|
||||
public:
|
||||
|
||||
CardManager(SpiceOverlay *overlay);
|
||||
~CardManager() override;
|
||||
|
||||
void build_content() override;
|
||||
|
||||
private:
|
||||
|
||||
std::filesystem::path config_path;
|
||||
bool config_dirty = false;
|
||||
std::vector<CardEntry> cards;
|
||||
char name_buffer[65] {};
|
||||
char card_buffer[17] {};
|
||||
float color_buffer[3] {};
|
||||
|
||||
CardEntry *current_card = nullptr;
|
||||
|
||||
std::string search_filter = "";
|
||||
std::string search_filter_in_lower_case = "";
|
||||
|
||||
void config_load();
|
||||
void config_save();
|
||||
|
||||
void generate_search_string(CardEntry *card);
|
||||
void generate_random_color();
|
||||
|
||||
void build_card();
|
||||
void open_card_editor();
|
||||
void build_card_editor();
|
||||
void build_card_list();
|
||||
void build_footer();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user