-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f445df4
commit 7efc007
Showing
8 changed files
with
200 additions
and
22 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"geode": "2.0.0", | ||
"version": "v0.0.1", | ||
"version": "v1.0.0-beta.1", | ||
"gd": { | ||
"win": "2.204", | ||
"mac": "2.200", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#pragma once | ||
|
||
#include <Geode/Geode.hpp> | ||
#include <Geode/utils/web.hpp> | ||
#include <Geode/ui/TextInput.hpp> | ||
|
||
using namespace geode::prelude; | ||
|
||
#include "CCLabelBMFontExt.h" | ||
|
||
class EmojiInfoLayer : public CCLayerColor | ||
{ | ||
public: | ||
|
||
virtual void keyBackClicked() | ||
{ | ||
onClose(nullptr); | ||
} | ||
|
||
void onClose(CCObject*) | ||
{ | ||
CCTouchDispatcher::get()->removeDelegate(this); | ||
|
||
this->removeFromParent(); | ||
} | ||
|
||
bool init(std::string emoji) | ||
{ | ||
if (!CCLayerColor::init()) | ||
return false; | ||
|
||
this->setKeypadEnabled(true); | ||
|
||
auto panel = CCScale9Sprite::create("GJ_square01.png"); | ||
panel->setContentSize(ccp(240, 250)); | ||
this->addChildAtPosition(panel, Anchor::Center); | ||
|
||
auto title = CCLabelBMFont::create((std::string(":") + emoji + std::string(":")).c_str(), "bigFont.fnt"); | ||
title->setScale(0.65f); | ||
this->addChildAtPosition(title, Anchor::Center, ccp(0, 70 + 38)); | ||
|
||
std::string ss; | ||
|
||
for (size_t i = 0; i < emojis.size(); i++) | ||
{ | ||
if (emojis[i].first == emoji) | ||
{ | ||
ss = emojis[i].second; | ||
break; | ||
} | ||
} | ||
|
||
auto spr = CCSprite::createWithSpriteFrameName(ss.c_str()); | ||
spr->setScale(2); | ||
this->addChildAtPosition(spr, Anchor::Center); | ||
|
||
auto menu = CCMenu::create(); | ||
|
||
auto ok = CCMenuItemSpriteExtra::create(ButtonSprite::create("OK"), this, menu_selector(EmojiInfoLayer::onClose)); | ||
menu->addChildAtPosition(ok, Anchor::Center, ccp(0, -63 - 39)); | ||
|
||
this->addChild(menu); | ||
|
||
this->runAction(CCFadeTo::create(0.5f, 125)); | ||
this->ignoreAnchorPointForPosition(true); | ||
|
||
CCTouchDispatcher::get()->addTargetedDelegate(this, -169, true); | ||
CCTouchDispatcher::get()->addTargetedDelegate(menu, -170, true); | ||
|
||
return true; | ||
} | ||
|
||
static EmojiInfoLayer* create(std::string emoji) | ||
{ | ||
EmojiInfoLayer* pRet = new EmojiInfoLayer(); | ||
if (pRet && pRet->init(emoji)) { | ||
pRet->autorelease(); | ||
return pRet; | ||
} else { | ||
delete pRet; | ||
return nullptr; | ||
} | ||
} | ||
|
||
static void addToScene(std::string emoji) | ||
{ | ||
auto pRet = EmojiInfoLayer::create(emoji); | ||
|
||
CCScene::get()->addChild(pRet, CCScene::get()->getHighestChildZ() + 1); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters