Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyMC9730 committed Nov 27, 2024
1 parent 409c901 commit 274b627
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 20 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- name: Windows
os: windows-latest

# - name: macOS
# os: macos-latest
- name: macOS
os: macos-latest

- name: Android32
os: ubuntu-latest
Expand All @@ -31,13 +31,17 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build the mod
uses: geode-sdk/build-geode-mod@main
with:
build-config: 'RelWithDebInfo'
bindings: geode-sdk/bindings
bindings-ref: main
combine: true
export-pdb: true
target: ${{ matrix.config.target }}

package:
Expand All @@ -52,4 +56,4 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: Build Output
path: ${{ steps.build.outputs.build-output }}
path: ${{ steps.build.outputs.build-output }}
16 changes: 10 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Macos be like
**/.DS_Store

Expand All @@ -49,10 +44,19 @@ build-*/

# ILY vscode
**/.vscode
.idea/

# Local History for Visual Studio Code
.history/

# clangd
.cache/

# Visual Studio
.vs/

# CLion
.idea/
/cmake-build-*/

.vs
out
28 changes: 28 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"configurations": [
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
},
{
"name": "x64-Clang-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "clang_cl_x64_x64" ],
"variables": []
}
]
}
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# v1.1.1
## GDHistory Provider
- Fixed level download issue
## UI
- Fixed a typo
## Technical Changes
- Geode version has been switched to `4.0.1`
- Added mod tags

# v1.1.0
## GDHistory Provider
- All requests are now cached
Expand Down
15 changes: 8 additions & 7 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{
"geode": "3.2.0",
"geode": "4.0.1",
"gd": {
"android": "2.206",
"win": "2.206"
"android": "2.2074",
"win": "2.2074"
},
"version": "v1.1.0",
"version": "v1.1.1",
"id": "dogotrigger.level_history",
"name": "Level History",
"developer": "dogotrigger",
"description": "Look and play through deleted and outdated levels using GDHistory or other sources!",
"dependencies": [
{"id": "hjfod.gmd-api", "importance": "required", "version": ">=1.2.0"},
{"id": "geode.node-ids", "importance": "required", "version": ">=1.12.0"}
{"id": "hjfod.gmd-api", "importance": "required", "version": ">=1.4.1"},
{"id": "geode.node-ids", "importance": "required", "version": ">=1.17.0"}
],
"repository": "https://github.com/SergeyMC9730/levelhistory",
"issues": {
"url": "https://github.com/SergeyMC9730/levelhistory/issues",
"info": "Any bugs with Level History should be reported here."
}
},
"tags": ["online", "enhancement", "utility"]
}
13 changes: 10 additions & 3 deletions src/GDHistoryProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,20 @@ void GDHistoryProvider::getLevelData(int id, std::function<void(LevelProvider *,
auto levels = this->askMultipleLevels();

for (auto lvl : levels) {
if (lvl->m_isEditable) {
log::info("{}", lvl->m_dislikes);

if (lvl->m_dislikes >= 1) {
propLevel = lvl;

// log::info("BREAKING");

break;
}
}

if (!propLevel) {
// log::info("propLevel is nullptr");

this->cleanupLevels(true);
this->_serverResponseParsed = old_vec;

Expand All @@ -245,9 +251,8 @@ void GDHistoryProvider::getLevelData(int id, std::function<void(LevelProvider *,
return;
}

// log::info("votes: {}", propLevel->m_demonVotes);
if (propLevel->m_demonVotes <= 0) {
// log::info("votes: {}", propLevel->m_demonVotes);

this->cleanupLevels(true);
this->_serverResponseParsed = old_vec;

Expand All @@ -257,6 +262,8 @@ void GDHistoryProvider::getLevelData(int id, std::function<void(LevelProvider *,
return;
}

log::info("(GDHistoryProvider) record for {} is {}", id, propLevel->m_demonVotes);

this->setParameter(LPFeatures::SpecificRecord, propLevel->m_demonVotes);

this->cleanupLevels(true);
Expand Down
3 changes: 3 additions & 0 deletions src/GeodeNetwork.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "GeodeNetwork.hpp"
using namespace geode::prelude;

void GeodeNetwork::setOkCallback(std::function<void(GeodeNetwork *)> ok) {
_onOk = ok;
Expand Down Expand Up @@ -41,6 +42,8 @@ void GeodeNetwork::setupListener() {
if (geode::utils::web::WebResponse* res = e->getValue()) {
this->_data = res->string().unwrapOr("Not a string");

// log::info("_data = {}", this->_data);

if (res->ok() && this->_onOk != nullptr) {
this->_onOk(this);

Expand Down
18 changes: 17 additions & 1 deletion src/ProviderPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ void ProviderPopup::lambdaOnDownloadLevel(SearchInstance *si, LoadingCircleLayer
existingCircle->m_pCircle->setOpacity(0);

if (level == nullptr) {
auto error = fmt::format("<cr>No levels cannot be found: </c><cy>{}</c>", prov->getErrorCodeDescription(prov->getErrorCode()));
auto error = fmt::format("<cr>No levels can be found: </c><cy>{}</c>", prov->getErrorCodeDescription(prov->getErrorCode()));
FLAlertLayer::create("Error", error, "OK")->show();
return;
}
Expand Down Expand Up @@ -973,9 +973,25 @@ void ProviderPopup::setupSettingsPage(CCLayer *providerBox) {
settings->updateLayout();
}

CCMenu* btnMenu = CCMenu::create();

btnMenu->setContentSize(csz);
btnMenu->setPosition(0, 0);

page->addChild(btnMenu);

{
CCMenuItemToggler* toggler = GameToolbox::createToggleButton("View Deleted Levels", menu_selector(ProviderPopup::onViewDeletedLevels), ProviderPopup::get()->_viewDeletedLevels, btnMenu, { 0, 0 }, btnMenu, btnMenu, 0.6f, 0.6f, 50.f, { 5, 0 }, "bigFont.fnt", false, 1, nullptr);

}

settings->setPosition(csz.width / 2, (csz.height - settings->getContentSize().height) / 2 + 30);
}

void ProviderPopup::onViewDeletedLevels(CCObject* sender) {

}

ProviderPopup *ProviderPopup::get() {
CCScene *currentScene = CCScene::get();
auto popup_ = currentScene->getChildByID("provider-popup");
Expand Down
3 changes: 3 additions & 0 deletions src/ProviderPopup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ProviderPopup : public FLAlertLayer {
static void setColorToButtonSprite(ButtonSprite *spr, cocos2d::_ccColor3B color);

bool _locked = false;
bool _viewDeletedLevels = false;
public:
static ProviderPopup *get();

Expand All @@ -65,6 +66,8 @@ class ProviderPopup : public FLAlertLayer {
void onToggler1PressMaybe(cocos2d::CCObject *sender);
void onExitButton(CCObject *sender);

void onViewDeletedLevels(CCObject* sender);

void update(float delta) override;

static ProviderPopup* create(std::vector<std::shared_ptr<LevelProvider>> providers);
Expand Down

0 comments on commit 274b627

Please sign in to comment.