-
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.
- Loading branch information
0 parents
commit b4ff1c8
Showing
11 changed files
with
357 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,55 @@ | ||
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@v4 | ||
|
||
- name: Build the mod | ||
uses: geode-sdk/build-geode-mod@main | ||
with: | ||
bindings: geode-sdk/bindings | ||
bindings-ref: main | ||
combine: true | ||
target: ${{ matrix.config.target }} | ||
|
||
package: | ||
name: Package builds | ||
runs-on: ubuntu-latest | ||
needs: ['build'] | ||
|
||
steps: | ||
- uses: geode-sdk/build-geode-mod/combine@main | ||
id: build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
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,64 @@ | ||
# 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 | ||
# Ignore platform specific build folders | ||
build-*/ | ||
|
||
# Workspace files are user-specific | ||
*.sublime-workspace | ||
|
||
# ILY vscode | ||
**/.vscode | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# clangd | ||
.cache/ | ||
|
||
# Visual Studio | ||
.vs/ | ||
|
||
# CLion | ||
.idea/ | ||
/cmake-build-*/ |
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 "arm64;x86_64") | ||
set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
|
||
project(CustomGeodeUI VERSION 1.0.0) | ||
|
||
add_library(${PROJECT_NAME} SHARED | ||
src/main.cpp | ||
# Add any extra C++ source 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,23 @@ | ||
# CustomGeodeUI | ||
This is where she makes a mod. | ||
|
||
<img src="logo.png" width="150" alt="the mod's logo" /> | ||
|
||
*Update logo.png to change your mod's icon (please)* | ||
|
||
## Getting started | ||
We recommend heading over to [the getting started section on our docs](https://docs.geode-sdk.org/getting-started/) for useful info on what to do next. | ||
|
||
## Build instructions | ||
For more info, see [our docs](https://docs.geode-sdk.org/getting-started/create-mod#build) | ||
```sh | ||
# Assuming you have the Geode CLI set up already | ||
geode build | ||
``` | ||
|
||
# Resources | ||
* [Geode SDK Documentation](https://docs.geode-sdk.org/) | ||
* [Geode SDK Source Code](https://github.com/geode-sdk/geode/) | ||
* [Geode CLI](https://github.com/geode-sdk/cli) | ||
* [Bindings](https://github.com/geode-sdk/bindings/) | ||
* [Dev Tools](https://github.com/geode-sdk/DevTools) |
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 @@ | ||
# Template Mod | ||
|
||
Edit about.md to change this |
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 @@ | ||
# 1.0.0 | ||
- Edit this file to change your mod's changelog. |
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,28 @@ | ||
{ | ||
"geode": "4.0.0-beta.1", | ||
"gd": { | ||
"win": "2.2074", | ||
"android": "2.2074", | ||
"mac": "2.2074", | ||
"ios": "2.2074" | ||
}, | ||
"id": "sheepdotcom.geode-ui-tweaks", | ||
"name": "Geode UI Tweaks", | ||
"version": "v0.0.1", | ||
"developer": "sheepdotcom", | ||
"description": "Tweak the Geode UI a bit more.", | ||
"settings": { | ||
"transparent-lists": { | ||
"name": "Transparent Lists", | ||
"description": "Makes the mod list background transparent. Best used with geode theme enabled.", | ||
"type": "bool", | ||
"default": false | ||
}, | ||
"larger-logos": { | ||
"name": "Larger Logos", | ||
"description": "Increases the size of the logos on mod items.", | ||
"type": "bool", | ||
"default": false | ||
} | ||
} | ||
} |
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,157 @@ | ||
#include "Geode/loader/Event.hpp" | ||
#include "Geode/loader/Loader.hpp" | ||
#include <Geode/Geode.hpp> | ||
#include <Geode/ui/GeodeUI.hpp> | ||
#include <Geode/loader/SettingV3.hpp> | ||
#include <Geode/utils/ColorProvider.hpp> | ||
|
||
using namespace geode::prelude; | ||
|
||
CCNode* modsLayerReference = nullptr; | ||
|
||
bool isGeodeTheme(bool forceDisableTheme = false) { | ||
return !forceDisableTheme && Loader::get()->getInstalledMod("geode.loader")->getSettingValue<bool>("enable-geode-theme"); | ||
} | ||
|
||
void modsLayerModify(CCNode* modsLayer) { | ||
auto mod = Mod::get(); | ||
if (auto modListFrame = modsLayer->getChildByID("mod-list-frame")) { | ||
if (auto modList = modListFrame->getChildByID("ModList")) { | ||
auto searchMenu = modList->getChildByID("top-container")->getChildByID("search-menu"); | ||
auto searchBG = searchMenu->getChildByID("search-id"); | ||
auto frameBG = modListFrame->getChildByID("frame-bg"); | ||
|
||
if (!searchMenu->getChildByID("search-bg"_spr)) { | ||
auto searchInput = searchMenu->getChildByID("search-input"); | ||
auto searchFiltersMenu = searchMenu->getChildByID("search-filters-menu"); | ||
|
||
auto someBG = CCLayerColor::create(ccColor4B{}); | ||
someBG->setPosition(searchMenu->getScaledContentSize() / 2); | ||
someBG->ignoreAnchorPointForPosition(false); | ||
someBG->setScale(0.7f); | ||
someBG->setContentSize(ccp(350.f, 30.f) / someBG->getScale()); | ||
someBG->setColor(ccColor3B{0, 0, 0}); | ||
someBG->setOpacity(isGeodeTheme() ? 50 : 90); | ||
someBG->setID("search-bg"_spr); | ||
|
||
searchMenu->addChild(someBG); | ||
} | ||
|
||
auto someBG = searchMenu->getChildByID("search-bg"_spr); | ||
|
||
frameBG->setVisible(!mod->getSettingValue<bool>("transparent-lists")); | ||
searchBG->setVisible(!mod->getSettingValue<bool>("transparent-lists")); | ||
someBG->setVisible(mod->getSettingValue<bool>("transparent-lists")); | ||
|
||
if (auto scrollLayer = static_cast<ScrollLayer*>(modList->getChildByID("ScrollLayer"))) { | ||
CCObject* obj; | ||
CCARRAY_FOREACH(scrollLayer->m_contentLayer->getChildren(), obj) { | ||
// should be mod items right | ||
auto node = static_cast<CCNode*>(obj); | ||
if (node->getID() == "ModItem") { | ||
if (auto bg = static_cast<CCScale9Sprite*>(node->getChildByID("bg"))) { | ||
if (mod->getSettingValue<bool>("transparent-lists")) { | ||
if ((bg->getColor() == ccColor3B{255, 255, 255} && bg->getOpacity() == 25) || (bg->getColor() == ccColor3B{0, 0, 0} && bg->getOpacity() == 90)) { // Enabled | ||
bg->setOpacity(isGeodeTheme() ? 50 : 90); | ||
bg->setColor(ccColor3B{0, 0, 0}); | ||
} | ||
else if (bg->getColor() == ccColor3B{153, 245, 245} && bg->getOpacity() == 25) { // Restart Required | ||
bg->setOpacity(90); | ||
bg->setColor(ccColor3B{245, 27, 27}); | ||
} | ||
else if (bg->getColor() == ccColor3B{255, 255, 255} && bg->getOpacity() == 10) { // Disabled | ||
bg->setOpacity(50); | ||
bg->setColor(ccColor3B{205, 205, 205}); | ||
} | ||
else if (bg->getColor() == ccColor3B{235, 35, 112} && bg->getOpacity() == 25) { // Error | ||
bg->setOpacity(90); | ||
bg->setColor(ccColor3B{245, 27, 27}); | ||
} | ||
} | ||
} | ||
if (auto logoSprite = node->getChildByID("logo-sprite")) { | ||
if (mod->getSettingValue<bool>("larger-logos") && (logoSprite->getScale() == 0.4f || logoSprite->getScale() == 0.6f)) { | ||
logoSprite->setScale(logoSprite->getScale() == 0.6f ? 0.7f : 0.5f); | ||
} else if (!mod->getSettingValue<bool>("larger-logos") && (logoSprite->getScale() == 0.5f || logoSprite->getScale() == 0.7f)) { | ||
logoSprite->setScale(logoSprite->getScale() == 0.7f ? 0.6f : 0.4f); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#include <Geode/modify/CCLayer.hpp> | ||
|
||
class ModsLayer : public CCNode {}; | ||
|
||
class $modify(CustomModsLayer, CCLayer) { | ||
bool init() { | ||
auto winSize = CCDirector::sharedDirector()->getWinSize(); | ||
|
||
if (!CCLayer::init()) return false; | ||
|
||
if (auto modslayer = typeinfo_cast<ModsLayer*>(this)) { | ||
queueInMainThread([this] { | ||
modsLayerReference = this; | ||
modsLayerModify(this); | ||
}); | ||
} | ||
|
||
return true; | ||
} | ||
}; | ||
|
||
#include <Geode/modify/CCDirector.hpp> | ||
|
||
class $modify(CCDirector) { | ||
bool replaceScene(CCScene* pScene) { | ||
// No crash when ModsLayer no longer exists | ||
if (CCDirector::sharedDirector()->getRunningScene()->getChildByID("ModsLayer")) { | ||
if (modsLayerReference) { | ||
modsLayerReference = nullptr; | ||
} | ||
} | ||
|
||
return CCDirector::replaceScene(pScene); | ||
} | ||
}; | ||
|
||
#include <Geode/modify/CCScheduler.hpp> | ||
|
||
class $modify(CCScheduler) { | ||
void update(float dt) { | ||
if (modsLayerReference) { | ||
modsLayerModify(modsLayerReference); | ||
} | ||
CCScheduler::update(dt); | ||
} | ||
}; | ||
|
||
/*$execute { | ||
new EventListener<EventFilter<ModItemUIEvent>>(+[](ModItemUIEvent* event) { | ||
auto mod = Mod::get(); | ||
auto modItem = event->getItem(); | ||
if (auto bg = static_cast<CCScale9Sprite*>(modItem->querySelector("bg"))) { | ||
if (mod->getSettingValue<bool>("transparent-lists")) { | ||
if ((bg->getColor() == ccColor3B{255, 255, 255} && bg->getOpacity() == 25) || (bg->getColor() == ccColor3B{0, 0, 0} && bg->getOpacity() == 90)) { | ||
bg->setOpacity(isGeodeTheme() ? 50 : 90); | ||
bg->setColor(ccColor3B{0, 0, 0}); | ||
} | ||
} | ||
} | ||
return ListenerResult::Propagate; | ||
}); | ||
new EventListener<EventFilter<ModLogoUIEvent>>(+[](ModLogoUIEvent* event) { | ||
auto logo = event->getSprite(); | ||
queueInMainThread([logo] { | ||
auto mod = Mod::get(); | ||
if (mod->getSettingValue<bool>("larger-logos")) { | ||
logo->setScale(0.5f); | ||
} | ||
}); | ||
return ListenerResult::Propagate; | ||
}); | ||
}*/ |
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 @@ | ||
Edit this file to change your mod's support info, or delete it if you don't need it. |