mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-20 05:57:53 +00:00
profile_manager: Implement firmware avatar selector (#205)
Adds an option to set a user's profile image from the avatars in the firmware. Background color can be changed with a color picker. Also modifies profile image saving to account for this, and as a result images are now saved as JPEG with 100% quality. Any PNG, JPEG, or BMP can now also be used in the image file picker instead of just JPEG. Using ryujinx's implementation and other parts of the yuzu codebase for reference. Credit: Torzu, lui Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/56 Co-authored-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion> Co-committed-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion> Co-authored-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion> Co-authored-by: Maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/205 Co-authored-by: JPikachu <jpikachu@noreply.localhost> Co-committed-by: JPikachu <jpikachu@noreply.localhost>
This commit is contained in:
parent
77b226a162
commit
b2e602325c
17 changed files with 498 additions and 40 deletions
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
@ -25,6 +28,7 @@ class QStandardItem;
|
|||
class QStandardItemModel;
|
||||
class QTreeView;
|
||||
class QVBoxLayout;
|
||||
class QListWidget;
|
||||
|
||||
namespace Service::Account {
|
||||
class ProfileManager;
|
||||
|
@ -34,6 +38,26 @@ namespace Ui {
|
|||
class ConfigureProfileManager;
|
||||
}
|
||||
|
||||
class ConfigureProfileManagerAvatarDialog : public QDialog {
|
||||
public:
|
||||
explicit ConfigureProfileManagerAvatarDialog(QWidget* parent);
|
||||
~ConfigureProfileManagerAvatarDialog();
|
||||
|
||||
void LoadImages(const QVector<QPixmap>& avatar_images);
|
||||
bool AreImagesLoaded() const;
|
||||
QPixmap GetSelectedAvatar();
|
||||
|
||||
private:
|
||||
void SetBackgroundColor(const QColor& color);
|
||||
QPixmap CreateAvatar(const QPixmap& avatar);
|
||||
void RefreshAvatars();
|
||||
|
||||
QVector<QPixmap> avatar_image_store;
|
||||
QListWidget* avatar_list;
|
||||
QColor avatar_bg_color;
|
||||
QPushButton* bg_color_button;
|
||||
};
|
||||
|
||||
class ConfigureProfileManagerDeleteDialog : public QDialog {
|
||||
public:
|
||||
explicit ConfigureProfileManagerDeleteDialog(QWidget* parent);
|
||||
|
@ -71,13 +95,18 @@ private:
|
|||
void RenameUser();
|
||||
void ConfirmDeleteUser();
|
||||
void DeleteUser(const Common::UUID& uuid);
|
||||
void SetUserImage();
|
||||
void SetUserImage(const QImage& image);
|
||||
void SelectImageFile();
|
||||
void SelectFirmwareAvatar();
|
||||
bool LoadAvatarData();
|
||||
std::vector<uint8_t> DecompressYaz0(const FileSys::VirtualFile& file);
|
||||
|
||||
QVBoxLayout* layout;
|
||||
QTreeView* tree_view;
|
||||
QStandardItemModel* item_model;
|
||||
QGraphicsScene* scene;
|
||||
|
||||
ConfigureProfileManagerAvatarDialog* avatar_dialog;
|
||||
ConfigureProfileManagerDeleteDialog* confirm_dialog;
|
||||
|
||||
std::vector<QList<QStandardItem*>> list_items;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue