Skip to content

Commit bec5abd

Browse files
committed
More final fixes
1 parent 4a29575 commit bec5abd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+456
-275
lines changed

Goldleaf/include/cnt/cnt_Content.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ namespace cnt {
7272

7373
constexpr size_t MaxContentCount = 7;
7474

75-
struct ApplicationContentEntry {
75+
struct ApplicationContent {
76+
NcmContentMetaKey meta_key;
7677
std::optional<NcmContentId> cnt_ids[MaxContentCount];
7778
};
7879

@@ -89,7 +90,7 @@ namespace cnt {
8990
NsExtApplicationView view;
9091
NsApplicationControlData control_data;
9192
std::vector<NsApplicationContentMetaStatus> meta_status_list;
92-
std::vector<ApplicationContentEntry> contents;
93+
std::vector<ApplicationContent> contents;
9394
NsExtApplicationOccupiedSize occupied_size;
9495
u32 max_version;
9596
u32 launch_required_version;
@@ -109,17 +110,18 @@ namespace cnt {
109110
ApplicationPlayStats GetUserPlayStats(const AccountUid user_id) const;
110111
};
111112

112-
constexpr u32 MaxApplicationCount = 64000;
113-
114113
void InitializeApplications();
115114
void FinalizeApplications();
116115

117116
void NotifyApplicationsChanged();
118117

119118
std::vector<Application> &GetApplications();
120-
std::optional<std::reference_wrapper<Application>> ExistsApplicationContent(const u64 app_id);
119+
120+
std::optional<std::reference_wrapper<Application>> ExistsApplicationContent(const u64 program_id, const NcmContentMetaType content_type);
121+
std::optional<std::reference_wrapper<Application>> ExistsApplicationAnyContents(const u64 app_id);
121122

122123
void RemoveApplicationById(const u64 app_id);
124+
void RemoveApplicationContentById(const Application &app, const u32 cnt_idx);
123125
Result UpdateApplicationVersion(const Application &app);
124126
std::string GetExportedApplicationIconPath(const u64 app_id);
125127
std::string GetExportedApplicationNacpPath(const u64 app_id);

Goldleaf/include/cnt/cnt_Ticket.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace cnt {
5151
TicketType type;
5252

5353
inline std::optional<std::reference_wrapper<Application>> IsUsed() const {
54-
return ExistsApplicationContent(esGetRightsIdApplicationId(&this->rights_id));
54+
return ExistsApplicationAnyContents(esGetRightsIdApplicationId(&this->rights_id));
5555
}
5656

5757
std::string ToString() const;

Goldleaf/include/nsp/nsp_Installer.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace nsp {
4545
using OnStartWriteFunction = std::function<void(const ContentWriteProgress&)>;
4646
using OnContentWriteFunction = std::function<void(const ContentWriteProgress&)>;
4747

48-
struct InstallableProgram {
48+
struct InstallableContent {
4949
NcmContentMetaKey meta_key;
5050
NacpStruct nacp_data;
5151
std::string icon_path;
@@ -71,12 +71,12 @@ namespace nsp {
7171
std::string cert_file_name;
7272
NcmContentInfo meta_cnt_info;
7373
std::vector<NcmContentInfo> contents;
74-
std::vector<InstallableProgram> programs;
74+
std::vector<InstallableContent> inst_contents;
7575

76-
Result StartProgramInstallation(const InstallableProgram &program);
76+
Result StartProgramInstallation(const InstallableContent &program);
7777

7878
public:
79-
Installer(const std::string &path, fs::Explorer *exp, const NcmStorageId st_id) : pfs0_file(exp, path), storage_id(st_id), contents(), programs() {}
79+
Installer(const std::string &path, fs::Explorer *exp, const NcmStorageId st_id) : pfs0_file(exp, path), storage_id(st_id), contents(), inst_contents() {}
8080
~Installer();
8181

8282
Result PrepareInstallation();
@@ -94,8 +94,8 @@ namespace nsp {
9494
return this->keygen;
9595
}
9696

97-
inline std::vector<InstallableProgram> &GetPrograms() {
98-
return this->programs;
97+
inline std::vector<InstallableContent> &GetInstallablePrograms() {
98+
return this->inst_contents;
9999
}
100100

101101
inline std::vector<NcmContentInfo> &GetContents() {

Goldleaf/include/ui/ui_ApplicationListLayout.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace ui {
3636
ApplicationListLayout();
3737
PU_SMART_CTOR(ApplicationListLayout)
3838

39+
void ReloadApplications();
3940
void Reload();
4041

4142
inline void NotifyApplicationsChanged() {

Goldleaf/include/ui/ui_FileContentLayout.hpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,16 @@ namespace ui {
2727
class FileContentLayout : public pu::ui::Layout {
2828
private:
2929
u32 line_offset;
30+
u32 x_offset;
3031
u32 available_line_count;
32+
u32 max_line_length;
3133
std::vector<std::string> read_lines;
34+
size_t cur_read_lines_max_length;
3235
bool read_hex;
3336
std::string path;
3437
pu::ui::elm::TextBlock::Ref cnt_text;
3538
fs::Explorer *file_exp;
3639

37-
void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const pu::ui::TouchPoint touch_pos);
38-
39-
public:
40-
FileContentLayout();
41-
PU_SMART_CTOR(FileContentLayout)
42-
43-
void LoadFile(const std::string &path, const std::string &pres_path, fs::Explorer *exp, const bool read_hex);
44-
void ScrollUp();
45-
void ScrollDown();
46-
4740
inline std::vector<std::string> ReadLines(const u32 line_offset, const u32 count) {
4841
if(this->read_hex) {
4942
return this->file_exp->ReadFileFormatHex(this->path, line_offset, count);
@@ -53,13 +46,19 @@ namespace ui {
5346
}
5447
}
5548

56-
inline void UpdateLines() {
57-
std::string new_cnt;
58-
for(auto &line: this->read_lines) {
59-
new_cnt += line + "\n";
60-
}
61-
this->cnt_text->SetText(new_cnt);
62-
}
49+
void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const pu::ui::TouchPoint touch_pos);
50+
bool ScrollUp();
51+
bool ScrollDown();
52+
bool MoveLeft();
53+
bool MoveRight();
54+
void UpdateLineLimits();
55+
void UpdateLines();
56+
57+
public:
58+
FileContentLayout();
59+
PU_SMART_CTOR(FileContentLayout)
60+
61+
void LoadFile(const std::string &path, const std::string &pres_path, fs::Explorer *exp, const bool read_hex);
6362
};
6463

6564
}

Goldleaf/romfs/Strings/de.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"Update ID:",
494494
"Application record last event:",
495495
"Application view flags:",
496-
"View occupied size",
496+
"View size",
497497
"View play stats",
498498
"Total",
499499
"Occupied size",

Goldleaf/romfs/Strings/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"Update ID:",
494494
"Application record last event:",
495495
"Application view flags:",
496-
"View occupied size",
496+
"View size",
497497
"View play stats",
498498
"Total",
499499
"Occupied size",

Goldleaf/romfs/Strings/es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"Update ID:",
494494
"Application record last event:",
495495
"Application view flags:",
496-
"View occupied size",
496+
"View size",
497497
"View play stats",
498498
"Total",
499499
"Occupied size",

Goldleaf/romfs/Strings/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"Update ID:",
494494
"Application record last event:",
495495
"Application view flags:",
496-
"View occupied size",
496+
"View size",
497497
"View play stats",
498498
"Total",
499499
"Occupied size",

Goldleaf/romfs/Strings/it.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"Update ID:",
494494
"Application record last event:",
495495
"Application view flags:",
496-
"View occupied size",
496+
"View size",
497497
"View play stats",
498498
"Total",
499499
"Occupied size",

0 commit comments

Comments
 (0)