Skip to content

Commit

Permalink
Update libtesla; Hide PV_MARK
Browse files Browse the repository at this point in the history
  • Loading branch information
nastys committed Apr 8, 2020
1 parent 28bd3fa commit cfcba5e
Show file tree
Hide file tree
Showing 10 changed files with 1,679 additions and 441 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ include $(DEVKITPRO)/libnx/switch_rules
# NACP building is skipped as well.
#---------------------------------------------------------------------------------
APP_TITLE := MEGAHAKUS
APP_VERSION := 2.4.0

TARGET := $(notdir $(CURDIR))
BUILD := build
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MEGAHAKUS 2.2.0
# MEGAHAKUS 2.4.0
A Tesla overlay for 初音ミク Project DIVA MEGA39's.

![screenshot](https://github.com/nastys/MEGAHAKUS/raw/master/preview.jpg)
Expand Down Expand Up @@ -48,7 +48,8 @@ R: +1.0%
Thanks to SwigS-27 for the resolution scale address.

## Debug mode
Currently works in handheld mode only unless ``D-pad cursor`` is enabled, and button releases are a bit buggy.
NOTE: Not compatible with DLC pack 2nd+.
Currently, button releases are a bit buggy.
```
Joystick (default)/D-pad: move cursor
L/R/Joystick: hold/push to move faster
Expand Down
4 changes: 2 additions & 2 deletions libs/libtesla/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "DKP Aarch64 Windows",
"includePath": [
"C:/devkitPro/devkitA64/aarch64-none-elf/include/**",
"C:/devkitPro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
"C:/devkitPro/devkitA64/lib/gcc/aarch64-none-elf/9.2.0/include/**",
"C:/devkitPro/libnx/include/**",
"C:/devkitPro/portlibs/switch/include/**",
"${workspaceFolder}/include/**"
Expand All @@ -24,7 +24,7 @@
"name": "DKP Aarch64 Linux",
"includePath": [
"/opt/devkitpro/devkitA64/aarch64-none-elf/include/**",
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/9.2.0/include/**",
"/opt/devkitpro/libnx/include/**",
"/opt/devkitpro/portlibs/switch/include/**",
"${workspaceFolder}/include/**"
Expand Down
4 changes: 3 additions & 1 deletion libs/libtesla/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"thread": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"map": "cpp"
"map": "cpp",
"stack": "cpp",
"list": "cpp"
}
}
6 changes: 3 additions & 3 deletions libs/libtesla/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ It's main goal is to make sure all overlays look and feel similar and don't diff
## Screenshots

<div>
<img src="./resources/ovl_cheats.jpg" style="width: 50%; float: center">
<img src="./resources/ovl_stats.jpg" style="width: 50%; float: right">
<img src="https://i.imgur.com/jJpxYjb.jpg" style="width: 50%; float: center">
<img src="https://i.imgur.com/nBUc7ps.jpg" style="width: 50%; float: right">
</div>

`Or rather screen pictures. Overlays do NOT show up on Screenshots.`
`Overlays do NOT show up on Screenshots. These pictures were taken using a capture card`

## Example

Expand Down
4 changes: 3 additions & 1 deletion libs/libtesla/example/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ include $(DEVKITPRO)/libnx/switch_rules
# of a homebrew executable (.nro). This is intended to be used for sysmodules.
# NACP building is skipped as well.
#---------------------------------------------------------------------------------
APP_TITLE := Tesla Overlay Template

APP_TITLE := Tesla Example
VERSION_VERSION := 1.3.0

TARGET := $(notdir $(CURDIR))
BUILD := build
Expand Down
62 changes: 56 additions & 6 deletions libs/libtesla/example/source/main.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,72 @@
#define TESLA_INIT_IMPL // If you have more than one file using the tesla header, only define this in the main one
#include <tesla.hpp> // The Tesla Header


class GuiSecondary : public tsl::Gui {
public:
GuiSecondary() {}

virtual tsl::elm::Element* createUI() override {
auto *rootFrame = new tsl::elm::OverlayFrame("Tesla Example", "v1.3.1 - Secondary Gui");

rootFrame->setContent(new tsl::elm::DebugRectangle(tsl::gfx::Color{ 0x8, 0x3, 0x8, 0xF }));

return rootFrame;
}
};

class GuiTest : public tsl::Gui {
public:
GuiTest(u8 arg1, u8 arg2, bool arg3) { }

// Called when this Gui gets loaded to create the UI
// Allocate all your elements on the heap. libtesla will make sure to clean them up when not needed anymore
// Allocate all elements on the heap. libtesla will make sure to clean them up when not needed anymore
virtual tsl::elm::Element* createUI() override {
auto rootFrame = new tsl::elm::OverlayFrame("Tesla Template", "v1.1.0");
// A OverlayFrame is the base element every overlay consists of. This will draw the default Title and Subtitle.
// If you need more information in the header or want to change it's look, use a HeaderOverlayFrame.
auto frame = new tsl::elm::OverlayFrame("Tesla Example", "v1.3.0");

// A list that can contain sub elements and handles scrolling
auto list = new tsl::elm::List();

list->addItem(new tsl::elm::ListItem("Test List Item"));
list->addItem(new tsl::elm::ToggleListItem("Test Toggle List Item", true));
// List Items
list->addItem(new tsl::elm::CategoryHeader("List items"));

rootFrame->setContent(list);
auto *clickableListItem = new tsl::elm::ListItem("Clickable List Item", "...");
clickableListItem->setClickListener([](u64 keys) {
if (keys & KEY_A) {
tsl::changeTo<GuiSecondary>();
return true;
}

return rootFrame;
return false;
});

list->addItem(clickableListItem);
list->addItem(new tsl::elm::ListItem("Default List Item"));
list->addItem(new tsl::elm::ToggleListItem("Toggle List Item", true));

// Custom Drawer, a element that gives direct access to the renderer
list->addItem(new tsl::elm::CategoryHeader("Custom Drawer", true));
list->addItem(new tsl::elm::CustomDrawer([](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) {
renderer->drawCircle(x + 40, y + 40, 20, true, renderer->a(0xF00F));
renderer->drawCircle(x + 50, y + 50, 20, true, renderer->a(0xF0F0));
renderer->drawRect(x + 130, y + 30, 60, 40, renderer->a(0xFF00));
renderer->drawString("Hello :)", false, x + 250, y + 70, 20, renderer->a(0xFF0F));
renderer->drawRect(x + 40, y + 90, 300, 10, renderer->a(0xF0FF));
}), 100);

// Track bars
list->addItem(new tsl::elm::CategoryHeader("Track bars"));
list->addItem(new tsl::elm::TrackBar("\u2600"));
list->addItem(new tsl::elm::StepTrackBar("\uE13C", 20));
list->addItem(new tsl::elm::NamedStepTrackBar("\uE132", { "Selection 1", "Selection 2", "Selection 3" }));

// Add the list to the frame for it to be drawn
frame->setContent(list);

// Return the frame to have it become the top level element of this Gui
return frame;
}

// Called once every frame to update values
Expand Down
Loading

0 comments on commit cfcba5e

Please sign in to comment.