-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit be56cd6
Showing
11 changed files
with
210 additions
and
0 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,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
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,54 @@ | ||
name: Build Geode Mod | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- name: Windows | ||
os: windows-latest | ||
|
||
#- name: macOS | ||
# os: macos-latest | ||
|
||
- name: Android32 | ||
os: ubuntu-latest | ||
target: Android32 | ||
|
||
- name: Android64 | ||
os: ubuntu-latest | ||
target: Android64 | ||
|
||
name: ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build the mod | ||
uses: geode-sdk/build-geode-mod@main | ||
with: | ||
sdk: nightly | ||
combine: true | ||
target: ${{ matrix.config.target }} | ||
|
||
package: | ||
name: Package builds | ||
runs-on: ubuntu-latest | ||
needs: ['build'] | ||
|
||
steps: | ||
- uses: geode-sdk/build-geode-mod@combine | ||
id: build | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: Build Output | ||
path: ${{ steps.build.outputs.build-output }} |
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,53 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
# Macos be like | ||
**/.DS_Store | ||
|
||
# Cache files for Sublime Text | ||
*.tmlanguage.cache | ||
*.tmPreferences.cache | ||
*.stTheme.cache | ||
|
||
# Ignore build folders | ||
**/build | ||
|
||
# Workspace files are user-specific | ||
*.sublime-workspace | ||
|
||
# ILY vscode | ||
**/.vscode | ||
.idea/ | ||
|
||
# clangd | ||
.cache/ |
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,22 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_OSX_ARCHITECTURES "x86_64") | ||
set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
|
||
project(HideMainMenuUI VERSION 1.0.0) | ||
|
||
add_library(${PROJECT_NAME} SHARED | ||
src/main.cpp | ||
# Add your cpp files here | ||
) | ||
|
||
if (NOT DEFINED ENV{GEODE_SDK}) | ||
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode") | ||
else() | ||
message(STATUS "Found Geode: $ENV{GEODE_SDK}") | ||
endif() | ||
|
||
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode) | ||
|
||
setup_geode_mod(${PROJECT_NAME}) |
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,3 @@ | ||
# Hide Main Menu UI | ||
|
||
Adds a button to the main menu that hides the UI! |
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,3 @@ | ||
# Hide Main Menu UI | ||
|
||
Adds a button to the main menu that hides the UI! |
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,17 @@ | ||
{ | ||
"geode": "2.0.0-beta.15", | ||
"gd": "2.204", | ||
"version": "v1.0.0", | ||
"id": "capeling.hide_main_menu_ui", | ||
"name": "Hide Main Menu UI", | ||
"developer": "Capeling", | ||
"description": "Adds a button to the main menu that hides the UI!", | ||
"resources": { | ||
"spritesheets": { | ||
"EyeSheet": [ | ||
"resources/eye_closed.png", | ||
"resources/eye_open.png" | ||
] | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include <Geode/Geode.hpp> | ||
#include <Geode/modify/MenuLayer.hpp> | ||
|
||
using namespace geode::prelude; | ||
|
||
class $modify(MenuLayerExt, MenuLayer) { | ||
|
||
bool m_isHidden = false; | ||
CCSprite* m_eyeSprite; | ||
CCMenuItemToggler* m_eyeButton; | ||
CCMenu* m_eyeMenu; | ||
|
||
bool init() { | ||
if(!MenuLayer::init()) | ||
return false; | ||
auto winSize = CCDirector::sharedDirector()->getWinSize(); | ||
auto on = CircleButtonSprite::create(CCSprite::createWithSpriteFrameName("eye_open.png"_spr), CircleBaseColor::Green, CircleBaseSize::Small); | ||
|
||
auto offEye = CCSprite::createWithSpriteFrameName("eye_closed.png"_spr); | ||
offEye->setOpacity(255 / 2.5); | ||
|
||
auto off = CircleButtonSprite::create(offEye, CircleBaseColor::Gray, CircleBaseSize::Small); | ||
off->setOpacity(255 / 2.5); | ||
|
||
m_eyeButton = CCMenuItemToggler::create(on, off, this, menu_selector(MenuLayerExt::onToggleHide)); | ||
m_eyeMenu = CCMenu::create(); | ||
|
||
m_eyeMenu->setPosition({winSize.width - 25, winSize.height - 25}); | ||
m_eyeMenu->setID("hide-ui-menu"); | ||
|
||
m_eyeMenu->addChild(m_eyeButton); | ||
addChild(m_eyeMenu); | ||
return true; | ||
} | ||
|
||
void onToggleHide(CCObject* sender) { | ||
m_isHidden = !m_isHidden; | ||
MenuLayerExt::updateMenu(); | ||
} | ||
|
||
void updateMenu() { | ||
if(m_isHidden) { | ||
for(int i = 0; i < this->getChildrenCount(); i++) { | ||
auto node = static_cast<CCNode*>(this->getChildren()->objectAtIndex(i)); | ||
|
||
if(node->getID() != "main-menu-bg" && node->getID() != "hide-ui-menu") | ||
node->setVisible(false); | ||
} | ||
} else { | ||
for(int i = 0; i < this->getChildrenCount(); i++) { | ||
auto node = static_cast<CCNode*>(this->getChildren()->objectAtIndex(i)); | ||
node->setVisible(true); | ||
} | ||
} | ||
} | ||
}; |