-
Notifications
You must be signed in to change notification settings - Fork 2
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 cac95ad
Showing
9 changed files
with
231 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,56 @@ | ||
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: | ||
cli: "v3.0.0-beta.1" | ||
bindings: elnexreal/geode-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,58 @@ | ||
# 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 | ||
.idea/ | ||
|
||
# clangd | ||
.cache/ | ||
|
||
# Visual Studio | ||
.vs/ |
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,24 @@ | ||
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(MenuLoopRandomizer VERSION 1.0.0) | ||
|
||
add_library(${PROJECT_NAME} SHARED | ||
src/main.cpp | ||
# Add any extra C++ source files here | ||
) | ||
|
||
set(GEODE_BINDINGS_REPO_PATH "D:\\Projects\\geode\\bindings") | ||
|
||
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,22 @@ | ||
# MenuLoopRandomizer | ||
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 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/) | ||
* [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,14 @@ | ||
# Menu Loop Randomizer | ||
|
||
Are you bored of hearing the same menu song <cr>over & over</cr>? Well... **No more of that!** | ||
|
||
This mod allows you to change the menu song every time you open the game, picking from the songs you downloaded through Newgrounds. | ||
|
||
# Notes | ||
|
||
- The song changes every time you restart the game, so you will not get another song every time you go back to the menu. | ||
- In the future i'll add a setting to toggle between using NG songs or your own songs. | ||
|
||
# Thanks to! | ||
|
||
- [hiimjustin000](https://github.com/hiimjustin000) <cj>for helping me with the bindings problem (i was using an outdated version of geode LMAO)</cj> |
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 @@ | ||
# v1.0.0 | ||
|
||
- Initial release |
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": "3.0.0-alpha.2", | ||
"gd": { | ||
"android": "2.206", | ||
"win": "2.206" | ||
}, | ||
"version": "v1.0.0", | ||
"id": "elnexreal.menu_loop_randomizer", | ||
"name": "Menu Loop Randomizer", | ||
"developer": "elnexreal", | ||
"description": "Randomize your menu loop when opening the game.", | ||
"links": { | ||
"community": "https://discord.gg/vfFazvmKKb", | ||
"source": "https://github.com/elnexreal/menu_loop_randomizer", | ||
"homepage": "https://github.com/elnexreal" | ||
} | ||
} |
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,37 @@ | ||
#include <Geode/Geode.hpp> | ||
#include <Geode/modify/GameManager.hpp> | ||
#include <random> | ||
#include <vector> | ||
|
||
using namespace geode::prelude; | ||
|
||
std::string selectedSong; | ||
|
||
$execute { | ||
std::vector<std::string> songs; | ||
|
||
// get the path for the songs | ||
std::filesystem::path ngSongsPath = CCFileUtils::get()->getWritablePath(); | ||
|
||
// add all the mp3 files to the vector | ||
for (auto &song : std::filesystem::directory_iterator(ngSongsPath)) { | ||
if (song.path().string().ends_with(".mp3")) | ||
songs.push_back(song.path().string()); | ||
} | ||
|
||
// select a random item from the vector and return the path | ||
std::random_device rd; | ||
std::mt19937 gen(rd()); | ||
std::uniform_int_distribution<> dist(0, songs.size() - 1); | ||
int randomIndex = dist(gen); | ||
|
||
selectedSong = songs[randomIndex]; | ||
} | ||
|
||
struct GameManagerHook : Modify<GameManagerHook, GameManager> { | ||
gd::string getMenuMusicFile() { | ||
// return GameManager::getMenuMusicFile(); | ||
|
||
return selectedSong; | ||
} | ||
}; |