Skip to content

Commit

Permalink
changed almost everything
Browse files Browse the repository at this point in the history
  • Loading branch information
mishpro-programm committed Mar 28, 2024
1 parent 11677c4 commit c020326
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 58 deletions.
24 changes: 22 additions & 2 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 Down Expand Up @@ -51,3 +51,23 @@ jobs:
with:
name: mishpro.comments_in_pause_menu.geode
path: ${{ steps.build.outputs.build-output }}
hash:
name: Generate hashes
runs-on: ubuntu-latest
needs: ['package']

steps:
- uses: MCJack123/ghaction-generate-release-hashes@v3
name: SHA256
with:
hash-type: sha256
file-name: sha256.txt
- uses: MCJack123/ghaction-generate-release-hashes@v3
name: MD5
with:
hash-type: md5
file-name: md5.txt
- uses: actions/upload-artifact@v4
with:
name: hashes
path: *.txt
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(LevelinfoinPausemenu VERSION 1.0.0)
project(CommentsinPausemenu VERSION 1.0.0)

add_library(${PROJECT_NAME} SHARED
src/main.cpp
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Comments in Pause menu
Adds a button in pause menu to view info and comments for level (works even for official levels)
Adds a button that allows you to view comments on a level without leaving it (works even for official levels)

You can use this mod as text chat for globed, or just to read comments don't exiting level
You can use this mod as text chat for globed
# Credits
[dankmeme](https://github.com/dankmeme01)
6 changes: 4 additions & 2 deletions about.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Comments in Pause menu
Adds a button in pause menu to view info and comments for level (works even for official levels)
Adds a button that allows you to view comments on a level without leaving it (works even for official levels)

You can use this mod as text chat for globed, or just to read comments don't exiting level
You can use this mod as text chat for globed
# Credits
[dankmeme](https://github.com/dankmeme01)
5 changes: 3 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"gd": {
"android": "2.205",
"win": "2.204",
"ios": "2.205"
"ios": "2.205",
"mac": "2.200"
},
"version": "v1.0.2",
"version": "v1.1.0",
"id": "mishpro.comments_in_pause_menu",
"name": "Comments in Pause menu",
"developer": "mishpro",
Expand Down
62 changes: 13 additions & 49 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ using namespace geode::prelude;

#include <Geode/modify/PauseLayer.hpp>
#include <Geode/modify/PlayLayer.hpp>
//#include <Geode/modify/ProfilePage.hpp>
//#include <Geode/modify/InfoLayer.hpp>
#include <Geode/modify/CCLayer.hpp>
#include <Geode/modify/LevelInfoLayer.hpp>
class $modify(MyPauseLayer, PauseLayer) {
void customSetup(){
PauseLayer::customSetup();
auto menu = this->getChildByID("right-button-menu");
auto sprite = CCSprite::createWithSpriteFrameName("GJ_chatBtn_001.png");
sprite->setScale(0.65f);
//auto sprite = ButtonSprite::create("Info");
auto btn = CCMenuItemSpriteExtra::create(sprite, this, menu_selector(MyPauseLayer::onLevelInfo));
menu->setLayout(ColumnLayout::create()->setAxisAlignment(AxisAlignment::End));
menu->addChild(btn);
btn->setID("level-info-button");
//btn->setScale(0.675f, 0.675f);
menu->updateLayout();
}
void onLevelInfo(CCObject* sender){
Expand All @@ -28,7 +25,6 @@ class $modify(MyPauseLayer, PauseLayer) {
return;
}
auto level = playLayer->m_level;
log::error("userid: {}, accountid: {}", level->m_userID.value(), level->m_accountID.value());
auto infoLayer = InfoLayer::create(level, nullptr, nullptr);
infoLayer->setZOrder(11);
infoLayer->setScale(0.f);
Expand All @@ -38,21 +34,8 @@ class $modify(MyPauseLayer, PauseLayer) {
auto scene = CCDirector::sharedDirector()->getRunningScene();
scene->addChild(infoLayer);
}
void onExitH(){
auto* arr = this->getParent()->getChildren();
for(size_t i = arr->count(); i>0; i--){
auto* obj = arr->objectAtIndex(i-1);
if(auto* alert = typeinfo_cast<FLAlertLayer*>(obj)){
alert->retain();
alert->keyBackClicked();
Loader::get()->queueInMainThread([alert] {
alert->release();
});
}
}
PauseLayer::onExit();
}
};
//i copied this code from globed (tysm dankmeme)
class $modify(FixedPlayLayer, PlayLayer) {
bool isCurrentPlayLayer(){
auto playLayer = geode::cocos::getChildOfType<PlayLayer>(cocos2d::CCScene::get(), 0);
Expand Down Expand Up @@ -84,7 +67,6 @@ class $modify(FixedPlayLayer, PlayLayer) {
});
}
};
#ifndef GEODE_IS_WINDOWS
class $modify(MyCCLayer, CCLayer){
void onEnter(){
if(reinterpret_cast<void*>(PlayLayer::get()) == reinterpret_cast<void*>(this)){
Expand All @@ -95,37 +77,19 @@ class $modify(MyCCLayer, CCLayer){
}
}
};
#endif
/*class $modify(InfoLayer) {
void onMore(CCObject* sender){
auto s = static_cast<CCNode*>(sender);
auto infoLayer = static_cast<InfoLayer*>(s->getParent()->getParent()->getParent());
if(PlayLayer::get() && infoLayer->m_level->m_accountID.value() == 0){
FLAlertLayer::create("Error", "Sorry, but you can't view info about green player", "OK")->show();
} else {
InfoLayer::onMore(sender);
}
}
void onOriginal(CCObject* s){
if(!PlayLayer::get()){
InfoLayer::onOriginal(s);
}
}
};
class $modify(ProfilePage) {
void onMyLevels(CCObject* s){
if(!PlayLayer::get()){
ProfilePage::onMyLevels(s);
} else {
FLAlertLayer::create("Error", "Sorry, but now you're not able to view player levels while playing level", "OK")->show();
class $modify(LevelInfoLayer) {
void onPlay(CCObject* s){
if(PlayLayer::get()){
FLAlertLayer::create("Error", "Can't open level while already in another level", "OK")->show();
return;
}
LevelInfoLayer::onPlay(s);
}
void onMyLists(CCObject* s){
if(!PlayLayer::get()){
ProfilePage::onMyLists(s);
} else {
FLAlertLayer::create("Error", "Sorry, but now you're not able to view player lists while playing level", "OK")->show();
void tryCloneLevel(CCObject* s){
if(PlayLayer::get()){
FLAlertLayer::create("Error", "Can't clone level while already in another level", "OK")->show();
return;
}
LevelInfoLayer:tryCloneLevel(s);
}
};
*/

0 comments on commit c020326

Please sign in to comment.