Skip to content

Commit

Permalink
Good ol initial push
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoNyaa committed Jun 14, 2024
1 parent f7d106f commit 84dd858
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
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:
cli: v3.0.0-beta.1
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@main
id: build

- uses: actions/upload-artifact@v3
with:
name: Build Output
path: ${{ steps.build.outputs.build-output }}
58 changes: 58 additions & 0 deletions .gitignore
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/
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(CopyLevelInfo 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})
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# A message from the dev of Copy Level Info

This mod is not meant to be publicly expanded on and only exists to purely make my life easier recording videos.

## Code quality
It's probably bad but I know jack shit about CPP, its amazing this even compiles let alone function as expected at all.
22 changes: 22 additions & 0 deletions about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copy Level Info

This mod allows the user to copy some basic information about a level to their clipboard at the click of a button.

## What is copied to the clipboard
The following information is copied to the clipboard with some extra stuff inserted here and there to keep things neat and tidy.

- Level Author
- Level Name
- Level ID
- Song Link

## Formatting
All the information listed above is formatted as follows:

{Level Author} - {Level Name} (Geometry Dash)
\=============================================
Level ID: {Level ID}
Song: {Song Link}

Note: The divider constructed of the equals symbol (=) is dynamic, meaning that it is always the same length in terms of characters as the first line of text.
If line one was 23 characters long, the divider will be a string of 23 equal symbols (=), if line one was 56 characters long, the divider would be 56 characters long.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# v1.0.0
* Initial release of the project and hopefully the last, CPP is really not a fun language.

# v1.1.0
* Updated to GD v2.206 and Geode V3
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"geode": "3.0.0-alpha.2",
"gd": "2.206",
"version": "v1.1.0",
"id": "neonyaa.copy_level_info",
"name": "Copy Level Info",
"developer": "NeoNyaa",
"description": "A simple mod which allows the user to copy the level name and ID to the clipboard.",
"tags": [
"enhancement",
"interface",
"utility"
],
"resources": {
"sprites": [
"resources/Copy.png"
]
}
}
Binary file added resources/Copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/InfoLayer.hpp>

using namespace geode::prelude;

class $modify(InfoLayer) {
void onCopyLevelID(CCObject*) {
/*
Get the name of the author and the level name then string them together
seperating them with " - " and append it with "(Geometry Dash)" lastly,
store the result in a variable called "ytVideoTitle" for later use
*/
std::string ytVideoTitle = fmt::format("{} - {} (Geometry Dash)", this->m_level->m_creatorName, this->m_level->m_levelName);

/*
Get the length of the "ytVideoTitle" variable and use the returned value to create
a string of "=" symbols which is the same length as the "ytVideoTitle" variable
*/
std::string ytVideoDivider = std::string(ytVideoTitle.length(), '=');

// Get the ID of the level and store it in a variabled called "ytVideoDescLevelID" for later use
std::string ytVideoDescLevelID = std::to_string(this->m_level->m_levelID.value());

// Get the ID of the level song and store it in a variabled called "ytVideoDescSongLink" for later use
std::string ytVideoDescSongLink = std::to_string(this->m_level->m_songID);

// Prepare and copy the formatted data above to the clipboard for easy pasting wherever the user wants
clipboard::write(fmt::format("{}\n{}\nLevel ID: {}\nSong: https://www.newgrounds.com/audio/listen/{}\n", ytVideoTitle, ytVideoDivider, ytVideoDescLevelID, ytVideoDescSongLink));

// Notify the player to let them know that all the level information has been copied to their clipboard
Notification::create(("Level info copied to clipboard!"), CCSprite::create("Copy.png"_spr), 3)->show();
}
};

0 comments on commit 84dd858

Please sign in to comment.