Skip to content

Commit

Permalink
upgrade to geode 2.0.0-beta.27
Browse files Browse the repository at this point in the history
fix: game crashing after downloading nong and starting a level
  • Loading branch information
FlafyDev committed May 28, 2024
1 parent 717e596 commit 6a1fb12
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
jukeboxBindings = pkgs.fetchFromGitHub {
owner = "Fleeym";
repo = "sapphire-bindings";
rev = "nongd";
hash = "sha256-gc9GQxIYrlvr3Qnf1gKzOYSFxBB+A+eZFh1gvRz2q/A=";
rev = "3d4040749c1b96956fc4a460b91abbacc53db75b";
hash = "sha256-/UAugKml1iixIQ/JRVTO5Nic8lYV2P87/PregG+/4jQ=";
};
in pkgs.writeShellScript "fhs-script" ''
export GEODE_SDK="$HOME/Documents/Geode/"
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "2.0.0-beta.23",
"geode": "2.0.0-beta.27",
"gd": "2.204",
"version": "v0.0.3",
"id": "flafy.autonong",
Expand Down
4 changes: 2 additions & 2 deletions nix/geode-cli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
}:
stdenv.mkDerivation rec {
pname = "geode-cli";
version = "2.12.0";
version = "2.13.1";

src = fetchzip {
url = "https://github.com/geode-sdk/cli/releases/download/v${version}/geode-cli-v${version}-linux.zip";
hash = "sha256-CZZ9G5oSFcT3OL0n0kP7dRgOfzaVBklNb7V86irrtlo=";
hash = "sha256-2yT7x/m0V+is8k4R1ki/aqzCbyetBE6UXdr67/BnvDc=";
};

nativeBuildInputs = [autoPatchelfHook];
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/custom_song_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#include "../ui/an_dropdown_layer.hpp"

struct ANCustomSongWidget : geode::Modify<ANCustomSongWidget, CustomSongWidget> {
bool m_showNong;
CCMenu *m_nongMenu;
struct Fields {
bool m_showNong;
CCMenu *m_nongMenu;
};

std::set<int> getSongIds() {
std::set<int> songIds;
Expand Down
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

AutoNongManager::get()->loadIndexes();
// Reload the indexes every hour
AutoNongManager::get()->schedule(schedule_selector(AutoNongManager::loadIndexesSchedule), 60 * 60,
kCCRepeatForever, 0);
// AutoNongManager::get()->schedule(schedule_selector(AutoNongManager::loadIndexesSchedule), 60 *
// 60,
// kCCRepeatForever, 0);

// Reload the indexes on change
listenForSettingChanges(
"indexes", +[](MultiStringSettingStruct value) { AutoNongManager::get()->loadIndexes(); });
Expand Down
6 changes: 6 additions & 0 deletions src/ui/an_song_cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ bool ANSongCell::init(int songId, ANSong *song, ANDropdownLayer *parentPopup, CC
m_songId = songId;
m_anSong = song;
m_parentPopup = parentPopup;
m_parentPopupUID = parentPopup->m_uID;

CCMenuItemSpriteExtra *button;
CCSprite *spr;
Expand Down Expand Up @@ -108,6 +109,11 @@ void ANSongCell::onDeleteSong(CCObject *target) {
}

void ANSongCell::setSong() {
// m_parentPopup's data can corrupt at this point. This is how I verify it doesn't.
if (m_parentPopup->m_uID != m_parentPopupUID) {
return;
}

setButtonsVisible();
fs::path downloadPath = getFileDownloadPath(false);
const Ref<CustomSongWidget> customSongWidget = m_parentPopup->m_parentWidget;
Expand Down
1 change: 1 addition & 0 deletions src/ui/an_song_cell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class ANSongCell : public JBListCell {
int m_songId;
ANSong *m_anSong;
ANDropdownLayer *m_parentPopup;
unsigned int m_parentPopupUID;
CCLabelBMFont *m_songNameLabel;
CCLabelBMFont *m_artistNameLabel;
CCLabelBMFont *m_sourceLabel;
Expand Down

0 comments on commit 6a1fb12

Please sign in to comment.