From 9f9733736af90144af80fc94bbdb9af7e7111373 Mon Sep 17 00:00:00 2001 From: user666 Date: Thu, 15 Aug 2024 12:44:04 +0400 Subject: [PATCH] ever --- mod.json | 12 ++++++++++-- src/main.cpp | 13 +++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/mod.json b/mod.json index 185235e..764cc0f 100644 --- a/mod.json +++ b/mod.json @@ -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": { @@ -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 + } + } } diff --git a/src/main.cpp b/src/main.cpp index 1cccf57..a5d614e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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; @@ -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()) { @@ -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");