Skip to content

Commit

Permalink
add IDs to LevelListCells
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jan 13, 2024
1 parent bcb1284 commit 3555684
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/hooks/LevelListCell.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <Geode/Bindings.hpp>
#include <Geode/modify/LevelListCell.hpp>

#include "../managers/BetterInfoCache.h"
#include "../layers/UnregisteredProfileLayer.h"
#include "../utils.hpp"

using namespace geode::prelude;

class $modify(BILevelListCell, LevelListCell) {
/*
* Hooks
*/

void loadFromList(GJLevelList* list) {

LevelListCell::loadFromList(list);

//TODO: layout for ID node in Node ID mod

auto idTextNode = CCLabelBMFont::create(fmt::format("#{}", m_levelList->m_listID).c_str(), "chatFont.fnt");
idTextNode->setPosition({346,m_height - 1});
idTextNode->setAnchorPoint({1,1});
idTextNode->setScale(0.6f);
idTextNode->setColor({51,51,51});
idTextNode->setOpacity(152);
idTextNode->setID("list-id-label"_spr);
if(Mod::get()->getSettingValue<bool>("white-id")){
idTextNode->setColor({255,255,255});
idTextNode->setOpacity(200);
}

m_mainLayer->addChild(idTextNode);
}
};

0 comments on commit 3555684

Please sign in to comment.