Skip to content

Commit 2dc96f6

Browse files
committed
1.0.0..
0 parents  commit 2dc96f6

8 files changed

Lines changed: 283 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build Geode Mod
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "**"
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
config:
15+
- name: Windows
16+
os: windows-latest
17+
build-type: RelWithDebInfo
18+
19+
- name: macOS
20+
os: macos-latest
21+
22+
- name: iOS
23+
os: macos-latest
24+
target: iOS
25+
26+
- name: Android32
27+
os: ubuntu-latest
28+
target: Android32
29+
30+
- name: Android64
31+
os: ubuntu-latest
32+
target: Android64
33+
34+
name: ${{ matrix.config.name }}
35+
runs-on: ${{ matrix.config.os }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Build the mod
41+
uses: geode-sdk/build-geode-mod@main
42+
with:
43+
sdk: nightly
44+
bindings: geode-sdk/bindings
45+
build-config: ${{ matrix.config.build-type || 'Release' }}
46+
export-pdb: true
47+
bindings-ref: main
48+
combine: true
49+
target: ${{ matrix.config.target }}
50+
51+
package:
52+
name: Package builds
53+
runs-on: ubuntu-latest
54+
needs: ['build']
55+
56+
steps:
57+
- uses: geode-sdk/build-geode-mod/combine@main
58+
id: build
59+
60+
- uses: actions/upload-artifact@v4
61+
with:
62+
name: Build Output
63+
path: ${{ steps.build.outputs.build-output }}

.gitignore

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
# Macos be like
35+
**/.DS_Store
36+
37+
# Cache files for Sublime Text
38+
*.tmlanguage.cache
39+
*.tmPreferences.cache
40+
*.stTheme.cache
41+
42+
# Ignore build folders
43+
**/build
44+
# Ignore platform specific build folders
45+
build-*/
46+
47+
# Workspace files are user-specific
48+
*.sublime-workspace
49+
50+
# ILY vscode
51+
**/.vscode
52+
53+
# Local History for Visual Studio Code
54+
.history/
55+
56+
# clangd
57+
.cache/
58+
59+
# Visual Studio
60+
.vs/
61+
62+
# CLion
63+
.idea/
64+
/cmake-build-*/

CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
cmake_minimum_required(VERSION 3.21)
2+
set(CMAKE_CXX_STANDARD 20)
3+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4+
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS)
5+
set(CMAKE_OSX_ARCHITECTURES "arm64")
6+
else()
7+
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
8+
endif()
9+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
10+
11+
project(ClickableDots VERSION 1.0.0)
12+
13+
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.cpp)
14+
add_library(${PROJECT_NAME} SHARED ${SOURCES})
15+
16+
if (NOT DEFINED ENV{GEODE_SDK})
17+
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
18+
else()
19+
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
20+
endif()
21+
22+
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)
23+
24+
setup_geode_mod(${PROJECT_NAME})

about.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Clickable Dots
2+
3+
Lets you click tthe dots in the pages thingies to go to that page, works in level selector and editor
4+
5+
It also fixes the dots going offscreen in editor so that u can actually click them but you can toggle it off in mod settings

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 1.0.0
2+
3+
* firt

logo.png

20.1 KB
Loading

mod.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"geode": "4.5.0",
3+
"gd": {
4+
"win": "2.2074",
5+
"android": "2.2074",
6+
"mac": "2.2074",
7+
"ios": "2.2074"
8+
},
9+
"id": "zilko.clickable_dots",
10+
"links": {
11+
"source": "https://github.com/ZiLko/Clickable-Dots"
12+
},
13+
"tags": [
14+
"editor",
15+
"enhancement",
16+
"interface",
17+
"utility",
18+
"bugfix"
19+
],
20+
"name": "Clickable Dots",
21+
"version": "v1.0.0",
22+
"developer": "Zilko",
23+
"description": "Lets you click these page dots,",
24+
"settings": {
25+
"disable": {
26+
"name": "Disable",
27+
"description": "Disables the mod.",
28+
"type": "bool",
29+
"default": false
30+
},
31+
"fix-position": {
32+
"name": "Fix Dots Position",
33+
"description": "Fixes dots going off-screen when theres too many pages.",
34+
"type": "bool",
35+
"default": true
36+
}
37+
}
38+
}

src/main.cpp

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
using namespace geode::prelude;
2+
3+
#include <Geode/modify/BoomScrollLayer.hpp>
4+
5+
class $modify(ProBoomScrollLayer, BoomScrollLayer) {
6+
7+
struct Fields {
8+
std::unordered_map<CCSprite*, CCMenuItemSpriteExtra*> m_buttons;
9+
};
10+
11+
void onDot(CCObject* sender) {
12+
int page = static_cast<CCNode*>(sender)->getTag();
13+
14+
LevelEditorLayer::get() || GameManager::get()->getGameVariable("0168")
15+
? instantMoveToPage(page)
16+
: moveToPage(page);
17+
}
18+
19+
void updateButtons() {
20+
if (Mod::get()->getSettingValue<bool>("disable")) return;
21+
22+
CCArrayExt<CCSprite*> dots = CCArrayExt<CCSprite*>(m_dots);
23+
24+
if (dots.size() <= 0) return;
25+
26+
if (dots[0]->getPosition().x < 0 && Mod::get()->getSettingValue<bool>("fix-position")) {
27+
float width = CCDirector::get()->getWinSize().width;
28+
float realWidth = width - 50.f;
29+
float spacing = realWidth / (dots.size() - 1);
30+
float screenCenter = width / 2.f;
31+
float startX = screenCenter - realWidth / 2.f;
32+
33+
for (int i = 0; i < dots.size(); ++i)
34+
dots[i]->setPositionX(startX + i * spacing);
35+
}
36+
37+
auto f = m_fields.self();
38+
39+
for (CCSprite* dot : dots) {
40+
if (!f->m_buttons.contains(dot)) continue;
41+
42+
dot->setVisible(false);
43+
44+
CCMenuItemSpriteExtra* btn = f->m_buttons.at(dot);
45+
CCSprite* spr = static_cast<CCSprite*>(btn->getNormalImage());
46+
47+
btn->setPosition(dot->getPosition());
48+
spr->setScale(dot->getScale());
49+
spr->setColor(dot->getColor());
50+
}
51+
}
52+
53+
void updateDots(float dt) {
54+
BoomScrollLayer::updateDots(dt);
55+
56+
updateButtons();
57+
}
58+
59+
bool init(CCArray* p0, int p1, bool p2, CCArray* p3, DynamicScrollDelegate* p4) {
60+
if (!BoomScrollLayer::init(p0, p1, p2, p3, p4)) return false;
61+
62+
if (Mod::get()->getSettingValue<bool>("disable")) return true;
63+
64+
auto f = m_fields.self();
65+
66+
CCMenu* menu = CCMenu::create();
67+
menu->setPosition({0, 0});
68+
menu->setID("buttons-menu"_spr);
69+
70+
addChild(menu);
71+
72+
int i = 0;
73+
74+
for (CCSprite* dot : CCArrayExt<CCSprite*>(m_dots)) {
75+
CCMenuItemSpriteExtra* btn = CCMenuItemSpriteExtra::create(CCSprite::create("smallDot.png"), this, menu_selector(ProBoomScrollLayer::onDot));
76+
btn->setTag(i++);
77+
78+
menu->addChild(btn);
79+
80+
f->m_buttons[dot] = btn;
81+
}
82+
83+
return true;
84+
}
85+
86+
};

0 commit comments

Comments
 (0)