Skip to content

Commit

Permalink
Made some platform specific changes and added the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
SMJSGaming committed Jun 19, 2024
1 parent c9e10ca commit c93b8fb
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 36 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Geode Mod

on:
workflow_dispatch:
push:
branches:
- "main"
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
uses: geode-sdk/build-geode-mod@main
with:
combine: true
cli: 'v3.0.0-beta.1'
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 }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(GDIntercept VERSION 1.0.0)
project(GDIntercept VERSION 0.1.0)

file(GLOB_RECURSE SOURCES "src/*.cpp")
add_library(${PROJECT_NAME} SHARED ${SOURCES})
Expand Down
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ Release Todo:
☐ Add a send button
☐ Add a settings button
☐ Add more keybinds
☐ Make a proper menu icon
Nice To Haves:
☐ Custom theme support
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "3.0.0-beta.1",
"version": "v1.0.0-alpha.1",
"version": "v0.1.0-alpha.1",
"id": "smjs.gdintercept",
"name": "GDIntercept",
"developer": "SMJS",
Expand Down
74 changes: 40 additions & 34 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,50 +1,56 @@
#include <Geode/loader/SettingEvent.hpp>
#include <geode.custom-keybinds/include/Keybinds.hpp>
#include "include.hpp"
#include "scenes/InterceptPopup.hpp"
#include "objects/HttpInfo.hpp"

$execute {
using namespace keybinds;
#ifdef GEODE_IS_WINDOWS
#include <geode.custom-keybinds/include/Keybinds.hpp>

BindManager* manager = BindManager::get();
$execute {
using namespace keybinds;

manager->registerBindable({
"open_capture_menu"_spr,
"Open Capture Menu",
"Opens the menu with the captured packets",
{ Keybind::create(KEY_I, Modifier::Alt) },
"GD Intercept"
});
manager->registerBindable({
"copy_code_block"_spr,
"Copy Code Block",
"Copies the contents of the intercept menu code block to the clipboard",
{
Keybind::create(KEY_C, Modifier::Control),
Keybind::create(KEY_C, Modifier::Command)
},
"GD Intercept"
});
BindManager* manager = BindManager::get();

new EventListener([=](InvokeBindEvent* event) {
if (event->isDown()) {
InterceptPopup::scene();
}
manager->registerBindable({
"open_capture_menu"_spr,
"Open Capture Menu",
"Opens the menu with the captured packets",
{ Keybind::create(KEY_I, Modifier::Alt) },
"GD Intercept"
});
manager->registerBindable({
"copy_code_block"_spr,
"Copy Code Block",
"Copies the contents of the intercept menu code block to the clipboard",
{
Keybind::create(KEY_C, Modifier::Control),
// This will only work if this extension finally gets MacOS support
Keybind::create(KEY_C, Modifier::Command)
},
"GD Intercept"
});

return ListenerResult::Propagate;
}, InvokeBindFilter(nullptr, "open_capture_menu"_spr));
new EventListener([=](InvokeBindEvent* event) {
if (event->isDown()) {
InterceptPopup::scene();
}

new EventListener([=](InvokeBindEvent* event) {
InterceptPopup* popup = InterceptPopup::get();
return ListenerResult::Propagate;
}, InvokeBindFilter(nullptr, "open_capture_menu"_spr));

if (event->isDown() && popup) {
as<JSONCodeBlock*>(popup->m_mainLayer->getChildByID("info_code"_spr))->copyCode();
}
new EventListener([=](InvokeBindEvent* event) {
InterceptPopup* popup = InterceptPopup::get();

if (event->isDown() && popup) {
as<JSONCodeBlock*>(popup->m_mainLayer->getChildByID("info_code"_spr))->copyCode();
}

return ListenerResult::Propagate;
}, InvokeBindFilter(nullptr, "copy_code_block"_spr));
return ListenerResult::Propagate;
}, InvokeBindFilter(nullptr, "copy_code_block"_spr));
}
#endif

$execute {
listenForSettingChanges("remember-requests", +[](bool value) {
if (!value) {
for (int i = 1; i < HttpInfo::requests.size(); i++) {
Expand Down

0 comments on commit c93b8fb

Please sign in to comment.