Skip to content

Commit

Permalink
Try to fix workflows v2
Browse files Browse the repository at this point in the history
  • Loading branch information
XorTroll committed Sep 16, 2023
1 parent 0ec9117 commit cea9f55
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Update packages
run: |
sudo -n apt-get update
sudo -n apt-get upgrade -y git
sudo -n apt-get upgrade -y git maven
- name: Silence all git safe directory warnings
run: git config --system --add safe.directory '*'
Expand Down
4 changes: 3 additions & 1 deletion projects/uMenu/include/ul/menu/ui/ui_MainMenuLayout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace ul::menu::ui {
// TODONEW: config in theme?
static constexpr u8 SuspendedScreenAlphaIncrement = 6;

static constexpr s64 MessagesWaitTimeoutSeconds = 1;

private:
enum class SuspendedImageMode {
ShowingAfterStart = 0,
Expand Down Expand Up @@ -53,7 +55,7 @@ namespace ul::menu::ui {
QuickMenu::Ref quick_menu;
InputBar::Ref input_bar;
std::chrono::steady_clock::time_point startup_tp;
bool launch_fail_warn_shown;
bool start_time_elapsed;
u8 min_alpha;
u8 target_alpha;
SuspendedImageMode mode;
Expand Down
14 changes: 10 additions & 4 deletions projects/uMenu/source/ul/menu/ui/ui_MainMenuLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ namespace ul::menu::ui {
}
}

MainMenuLayout::MainMenuLayout(const u8 *captured_screen_buf, const u8 min_alpha) : last_has_connection(false), last_battery_lvl(0), last_is_charging(false), cur_folder_path(""), launch_fail_warn_shown(false), min_alpha(min_alpha), target_alpha(0), mode(SuspendedImageMode::ShowingAfterStart), suspended_screen_alpha(0xFF) {
MainMenuLayout::MainMenuLayout(const u8 *captured_screen_buf, const u8 min_alpha) : last_has_connection(false), last_battery_lvl(0), last_is_charging(false), cur_folder_path(""), start_time_elapsed(false), min_alpha(min_alpha), target_alpha(0), mode(SuspendedImageMode::ShowingAfterStart), suspended_screen_alpha(0xFF) {
// TODONEW: like nxlink but for sending themes and quickly being able to test them?

if(captured_screen_buf != nullptr) {
Expand Down Expand Up @@ -667,9 +667,15 @@ namespace ul::menu::ui {
this->battery_icon->SetImage(TryFindImage(g_Theme, battery_img));
}

const auto now_tp = std::chrono::steady_clock::now();
// Wait a bit before handling sent messages
if(std::chrono::duration_cast<std::chrono::milliseconds>(now_tp - this->startup_tp).count() >= 1000) {
if(!this->start_time_elapsed) {
const auto now_tp = std::chrono::steady_clock::now();
// Wait a bit before handling sent messages
if(std::chrono::duration_cast<std::chrono::seconds>(now_tp - this->startup_tp).count() >= MessagesWaitTimeoutSeconds) {
this->start_time_elapsed = true;
}
}

if(this->start_time_elapsed) {
if(g_MenuApplication->GetLaunchFailed()) {
g_MenuApplication->CreateShowDialog(GetLanguageString("app_launch"), GetLanguageString("app_unexpected_error"), { GetLanguageString("ok") }, true);
}
Expand Down

0 comments on commit cea9f55

Please sign in to comment.