Skip to content

Commit 71b5e25

Browse files
committed
Various changes and some small features
1 parent 3b95a3e commit 71b5e25

39 files changed

+354
-48
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
- name: Build Goldleaf
4343
run: |
44-
python3 arc/arc.py gen_db default+Goldleaf/include/res/res_Account.rc.hpp+Goldleaf/include/res/res_ETicket.rc.hpp+Goldleaf/include/res/res_NS.rc.hpp+Goldleaf/include/res/res_Goldleaf.rc.hpp
44+
python3 arc/arc.py gen_db default+Goldleaf/include/res/res_Account.rc.hpp+Goldleaf/include/res/res_ETicket.rc.hpp+Goldleaf/include/res/res_NS.rc.hpp+Goldleaf/include/res/res_NFP.rc.hpp+Goldleaf/include/res/res_Goldleaf.rc.hpp
4545
python3 arc/arc.py gen_cpp rc GLEAF Goldleaf/include/res/res_Generated.gen.hpp
4646
make build -j$(nproc)
4747

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ target/
1515
.classpath
1616
.project
1717
*.gen.hpp
18+
*.zip

Goldleaf/include/cfg/cfg_Settings.hpp

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@
2424

2525
namespace cfg {
2626

27+
enum class MenuStickMoveSpeed : u32 {
28+
VerySlow,
29+
Slow,
30+
Medium,
31+
Fast,
32+
VeryFast,
33+
34+
Count
35+
};
36+
37+
inline u32 GetMenuStickMoveSpeedDelayMs(const MenuStickMoveSpeed speed) {
38+
switch(speed) {
39+
case MenuStickMoveSpeed::VerySlow: return 300;
40+
case MenuStickMoveSpeed::Slow: return 200;
41+
case MenuStickMoveSpeed::Fast: return 50;
42+
case MenuStickMoveSpeed::VeryFast: return 25;
43+
case MenuStickMoveSpeed::Medium: default: return 100;
44+
}
45+
}
46+
2747
namespace json {
2848

2949
struct GeneralSettings {
@@ -59,12 +79,14 @@ namespace cfg {
5979
std::optional<UiColorScheme> light_color_scheme;
6080
std::optional<UiColorScheme> dark_color_scheme;
6181
std::optional<u32> menu_item_size;
82+
std::optional<u32> menu_stick_move_speed;
6283

6384
static inline UiSettings MakeDefault() {
6485
return {
6586
.light_color_scheme = std::nullopt,
6687
.dark_color_scheme = std::nullopt,
67-
.menu_item_size = 100
88+
.menu_item_size = 100,
89+
.menu_stick_move_speed = static_cast<u32>(MenuStickMoveSpeed::Medium)
6890
};
6991
}
7092
};
@@ -146,7 +168,8 @@ namespace cfg {
146168

147169
inline void ApplyToMenu(pu::ui::elm::Menu::Ref menu) {
148170
menu->SetScrollbarColor(this->GetColorScheme().scroll_bar);
149-
menu->SetMoveWaitTimeMs(100);
171+
const auto speed = this->json_settings.ui.value().menu_stick_move_speed.value_or(static_cast<u32>(MenuStickMoveSpeed::Medium));
172+
menu->SetMoveWaitTimeMs(GetMenuStickMoveSpeedDelayMs(static_cast<MenuStickMoveSpeed>(speed)));
150173
menu->SetItemAlphaIncrementSteps(5);
151174
}
152175

Goldleaf/include/hos/hos_Common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace hos {
2727
u32 GetBatteryLevel();
2828
bool IsCharging();
2929

30+
NfpDate GetCurrentDate();
3031
std::string GetCurrentTime(const bool use_12h_time);
3132

3233
void LockExit();

Goldleaf/include/nfp/nfp_Amiibo.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace nfp {
103103
Result Initialize();
104104
bool IsReady();
105105
Result Open();
106-
Result GetAmiiboData(AmiiboData &out_data);
106+
Result GetAmiiboData(AmiiboData &out_data, bool &out_has_register_info);
107107
std::string ExportAsVirtualAmiibo(const AmiiboData &data);
108108
void Close();
109109
void Exit();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
R_DEFINE_NAMESPACE_RESULT_MODULE(nfp, 115);
2+
3+
namespace nfp {
4+
5+
R_DEFINE_ERROR_RESULT(InvalidAmiiboSettings, 120);
6+
7+
}

Goldleaf/include/ui/ui_InstallLayout.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace ui {
3434
InstallLayout();
3535
PU_SMART_CTOR(InstallLayout)
3636

37-
void StartInstall(const std::string &path, const std::string &pres_path, fs::Explorer *exp, const NcmStorageId storage_id, const bool omit_confirmation = false);
37+
bool StartInstall(const std::string &path, const std::string &pres_path, fs::Explorer *exp, const NcmStorageId storage_id, const bool omit_confirmation = false, const bool skip_if_already_installed = false);
3838
};
3939

4040
}

Goldleaf/include/ui/ui_OwnSettingsLayout.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ namespace ui {
5555
void ignore_required_fw_version_DefaultKey();
5656
void show_deletion_prompt_after_install_DefaultKey();
5757

58+
// UI
59+
pu::ui::elm::MenuItem::Ref menu_stick_move_speed_item;
60+
61+
void menu_stick_move_speed_DefaultKey();
62+
5863
void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const pu::ui::TouchPoint touch_pos);
5964
public:
6065
OwnSettingsLayout();

Goldleaf/romfs/Strings/de.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,5 +520,14 @@
520520
"Unmount drive",
521521
"The selected drive was successfully unmounted. You can now safely remove it.",
522522
"An error ocurred attempting to unmount the drive.",
523-
"Default"
523+
"Default",
524+
"Menu stick move speed",
525+
"Very slow",
526+
"Slow",
527+
"Normal",
528+
"Fast",
529+
"Very fast",
530+
"Please select a menu stick move speed:",
531+
"Would you like to automatically skip already installed NSPs?",
532+
"No new NSPs were installed."
524533
]

Goldleaf/romfs/Strings/en-US.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,5 +520,14 @@
520520
"Unmount drive",
521521
"The selected drive was successfully unmounted. You can now safely remove it.",
522522
"An error ocurred attempting to unmount the drive.",
523-
"Default"
523+
"Default",
524+
"Menu stick move speed",
525+
"Very slow",
526+
"Slow",
527+
"Normal",
528+
"Fast",
529+
"Very fast",
530+
"Please select a menu stick move speed:",
531+
"Would you like to automatically skip already installed NSPs?",
532+
"No new NSPs were installed."
524533
]

0 commit comments

Comments
 (0)