forked from XorTroll/uLaunch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new quick menu, controller applet...
- Loading branch information
XorTroll
committed
Nov 16, 2019
1 parent
71b7d03
commit 3a90499
Showing
16 changed files
with
377 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Changelog | ||
|
||
- Settings menu | ||
|
||
- New settings were added: | ||
|
||
- Console information upload (enable/disable) | ||
|
||
- Automatic titles' download (e/d) | ||
|
||
- Console auto-update (e/d) | ||
|
||
- Bluetooth (e/d) | ||
|
||
- 3.0 USB (e/d) | ||
|
||
- NFC (e/d) | ||
|
||
- Wireless LAN (e/d) | ||
|
||
- MAC address | ||
|
||
- Serial number | ||
|
||
- General | ||
|
||
- Custom icons in entry JSONs can now be used with normal titles too, not just homebrew. | ||
|
||
- Certain parts of the code/functionality were slightly improved (speed might be slightly faster in certain laggy moments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
|
||
#pragma once | ||
#include <q_Include.hpp> | ||
#include <pu/Plutonium> | ||
|
||
namespace ui | ||
{ | ||
enum class QuickMenuDirection | ||
{ | ||
Up, | ||
Down, | ||
Left, | ||
Right, | ||
UpLeft, | ||
UpRight, | ||
DownLeft, | ||
DownRight, | ||
None | ||
}; | ||
|
||
struct QuickMenuSubItem | ||
{ | ||
std::function<void()> on_select; | ||
pu::ui::render::NativeTexture nicon; | ||
}; | ||
|
||
class QuickMenu : public pu::ui::elm::Element | ||
{ | ||
static constexpr s32 MainItemSize = 300; | ||
static constexpr s32 SubItemsSize = 150; | ||
static constexpr s32 CommonAreaSize = 50; | ||
|
||
static constexpr s32 MainItemX = (1280 - MainItemSize) / 2; | ||
static constexpr s32 MainItemY = (720 - MainItemSize) / 2; | ||
|
||
public: | ||
QuickMenu(std::string main_icon); | ||
PU_SMART_CTOR(QuickMenu) | ||
~QuickMenu(); | ||
|
||
void SetEntry(QuickMenuDirection direction, std::string icon, std::function<void()> on_selected); | ||
void RemoveEntry(QuickMenuDirection direction); | ||
|
||
s32 GetX(); | ||
s32 GetY(); | ||
s32 GetWidth(); | ||
s32 GetHeight(); | ||
|
||
bool IsOn(); | ||
|
||
void OnRender(pu::ui::render::Renderer::Ref &Drawer, s32 X, s32 Y); | ||
void OnInput(u64 Down, u64 Up, u64 Held, pu::ui::Touch Pos); | ||
|
||
private: | ||
QuickMenuDirection GetCurrentDirection(); | ||
std::tuple<s32, s32> ComputePositionForDirection(QuickMenuDirection direction); | ||
bool on; | ||
s64 off_wait; | ||
pu::ui::render::NativeTexture nmain; | ||
u64 lastheld; | ||
s32 bgalpha; | ||
s32 fgalpha; | ||
std::map<QuickMenuDirection, QuickMenuSubItem> item_map; | ||
}; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.