Skip to content

Commit

Permalink
ever
Browse files Browse the repository at this point in the history
  • Loading branch information
user95401 committed Aug 15, 2024
1 parent 66a9dbf commit 9f97337
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
12 changes: 10 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"id": "user95401.geode-mod-comments",
"name": "Mod Comments",
"version": "v1.0.0-alpha.4",
"version": "v1.0.0-beta",
"developer": "user95401",
"description": "add comments in mod popups",
"links": {
Expand Down Expand Up @@ -37,5 +37,13 @@
"version": ">=v1.13.1",
"importance": "required"
}
]
],
"settings": {
"Clear Text For Comment Edit": {
"name": "Clear Text For Comment Edit",
"description": "clear data in input to start writing new text",
"type": "bool",
"default": false
}
}
}
13 changes: 7 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class IssueCommentItem : public CCLayer {
sprite->initWithFile(filep.string().c_str());
sprite->setScale(avatar->getContentWidth() / sprite->getContentSize().width);
auto error_code = std::error_code();
//std::filesystem::remove(filep, error_code);
std::filesystem::remove(filep, error_code);
};
auto req = web::WebRequest();
auto listener = new EventListener<web::WebTask>;
Expand All @@ -409,8 +409,6 @@ class IssueCommentItem : public CCLayer {
}
);
listener->setFilter(req.send("GET", m_json["user"]["avatar_url"].as_string()));
/* web::AsyncWebRequest().fetch(m_json["user"]["avatar_url"].as_string())
.into(filep).then(a).expect(b);*/
}
//text
if (auto text = CCNode::create()) {
Expand Down Expand Up @@ -476,14 +474,17 @@ class IssueCommentItem : public CCLayer {
);

//edit
auto comment_edit_input = TextInput::create(120.f, "ew");
auto comment_edit_input = TextInput::create(240.f, "...");
comment_edit_input->setString(mdarea->getString());
comment_edit_input->setVisible(0);
this->addChild(comment_edit_input);
this->addChild(comment_edit_input, 1);
auto comment_edit = CCMenuItemExt::createTogglerWithFilename(
"comment_upload.png"_spr, "comment_edit.png"_spr, 0.7f,
[this, mdarea, comment_edit_input](CCMenuItemToggler* item) {
if (not item->m_toggled) {
comment_edit_input->setString(mdarea->getString());
if (SETTING(bool, "Clear Text For Comment Edit"))
comment_edit_input->setString("");
else comment_edit_input->setString(mdarea->getString());
comment_edit_input->setCallback(
[mdarea, comment_edit_input](std::string str) {
auto endl_filtered = string::replace(str, "\\n", "\n");
Expand Down

0 comments on commit 9f97337

Please sign in to comment.