Skip to content

Commit

Permalink
mostly bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Uproxide committed Jun 25, 2024
1 parent 5393792 commit 994bd4e
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 24 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(TWS VERSION 1.0.0)
project(TWS VERSION 1.3.1)

add_library(${PROJECT_NAME} SHARED
src/boobs.cpp
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.3.1
- Fix Crash when spamming Version Filter button
- Fix Filter Button alignment
- Make Happy Textures recommended (as THIS MODS DEPENDENCY, TP Creators this is entirely optional)
- Updated mod.json tags
- More links
- Support.md

# 1.3.0
- Version Filtering
- Version (And GD Version) in Info Popup
Expand Down
15 changes: 11 additions & 4 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"android": "2.206",
"mac": "2.206"
},
"version": "v1.3.0",
"version": "v1.3.1",
"id": "uproxide.textures",
"name": "Texture Workshop",
"developer": "Uproxide",
Expand All @@ -28,9 +28,16 @@
},
{
"id": "alphalaneous.happy_textures",
"version": ">=1.3.16",
"importance": "suggested"
"version": ">=1.3.17",
"importance": "recommended"
}
],
"repository": "https://github.com/Uproxide/Texture-Workshop"
"tags": [
"universal", "utility", "interface", "enhancement", "customization"
],
"links": {
"community": "https://discord.gg/uproxide-s-little-land-1204580412299542608",
"homepage": "https://uproxide.xyz",
"source": "https://github.com/Uproxide/Texture-Workshop"
}
}
9 changes: 7 additions & 2 deletions src/TWSFilters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ using namespace geode::prelude;

class TWSFilters : public Popup<> {
public:
CCMenuItemToggler* versionFilter;
static inline TWSFilters* get = nullptr;

bool setup() {
log::info("hai");
auto winSize = CCDirector::get()->getWinSize();

get = this;

this->setTitle("Filters");
m_title->setScale(0.85);
Expand All @@ -35,7 +40,7 @@ class TWSFilters : public Popup<> {
bg->addChild(menu);
menu->setPosition(0, 0);

auto versionFilter = CCMenuItemToggler::createWithStandardSprites(
versionFilter = CCMenuItemToggler::createWithStandardSprites(
this,
menu_selector(TWSFilters::onToggle),
1
Expand Down Expand Up @@ -63,7 +68,7 @@ class TWSFilters : public Popup<> {
case 1:
boobs::versionFilter = !boobs::versionFilter;
Mod::get()->setSavedValue<bool>("version-filter", boobs::versionFilter);
TextureWorkshopLayer::get->onRefresh(nullptr);
TextureWorkshopLayer::get->onGetTPsFinished();
break;
default:
break;
Expand Down
47 changes: 31 additions & 16 deletions src/TextureWorkshopLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,26 @@ bool TextureWorkshopLayer::init() {
inputNode->m_placeholderLabel->setScale(0.5);
inp->setDelegate(this);
inp->setCommonFilter(CommonFilter::Any);

auto inpMenu = CCMenu::create();
inpMenu->setContentSize(inp->getContentSize());
inp->addChild(inpMenu);


auto filterSpr = CCSprite::createWithSpriteFrameName("TWS_SearchButton.png"_spr);
filterSpr->setScale(0.9);
auto filterBtn = CCMenuItemSpriteExtra::create(
filterSpr,
this,
menu_selector(TextureWorkshopLayer::onFilter)
);
buttonMenu->addChild(filterBtn);
filterBtn->setPositionX(inp->getContentWidth() + 150);
filterBtn->setPositionY(director->getScreenTop() - 68);
inpMenu->addChild(filterBtn);
inpMenu->setLayout(
RowLayout::create()
->setAxisAlignment(AxisAlignment::End)
);
inpMenu->setPosition(inp->getContentSize() / 2);
filterBtn->setPositionX(filterBtn->getPositionX() + 5);

getTexturePacks();

Expand Down Expand Up @@ -218,7 +228,7 @@ void TextureWorkshopLayer::onSupport(CCObject*) {
void TextureWorkshopLayer::onCredits(CCObject*) {
FLAlertLayer::create(
"Credits",
"<cg>Uproxide</c> - Main Developer\n<cr>TheSillyDoggo</c> - Help with Searching\n<cl>Brift</c> - Sprites\n<cp>Riley</c> - Moral and Emotional Support\n\nSupporters:\nno one...",
"<cg>Uproxide</c> - Main Developer\n<cr>TheSillyDoggo</c> - Help with Searching\n<cl>Brift</c> - Sprites\n<cp>Riley</c> - Moral and Emotional Support",
"Ok"
)->show();
}
Expand Down Expand Up @@ -283,6 +293,10 @@ void TextureWorkshopLayer::parseJson(std::string str) {
}

void TextureWorkshopLayer::onGetTPsFinished() {
if (scroll || tpAmount) {
scroll->removeFromParent();
tpAmount->removeFromParent();
}
tps.clear();
auto director = CCDirector::sharedDirector();
auto winSize = director->getWinSize();
Expand Down Expand Up @@ -328,7 +342,6 @@ void TextureWorkshopLayer::onGetTPsFinished() {

tpCount += 1;

log::info("{}", Loader::get()->getGameVersion());
if (boobs::versionFilter) {
if (tpObject["gdVersion"].as_string() == Loader::get()->getGameVersion() || tpObject["gdVersion"].as_string() == "Any") {
TexturePack* tp = TexturePack::create(tpName, tpCreator, tpDownloadURL, tpIcon, tpDownloadVersion, tpDesc, gdVersion, featured);
Expand Down Expand Up @@ -407,21 +420,23 @@ void TextureWorkshopLayer::searchTPs() {
auto name = inp->getString();

if (inp->getString().starts_with("by:")) {
if(utils::string::toLower(tps[i]->creator).find(utils::string::toLower(name.substr(name.find(":") + 1, name.size() - name.find(":")))) != std::string::npos)
{
auto cell = TexturePackCell::create(tps[i], thing);
if(utils::string::toLower(tps[i]->creator).find(utils::string::toLower(name.substr(name.find(":") + 1, name.size() - name.find(":")))) != std::string::npos)
{
auto cell = TexturePackCell::create(tps[i], thing);

content->addChild(cell);
}
} else {
if (utils::string::toLower(tps[i]->name).find(utils::string::toLower(inp->getString())) != std::string::npos)
{
auto cell = TexturePackCell::create(tps[i], thing);
content->addChild(cell);
}
} else {
if (utils::string::toLower(tps[i]->name).find(utils::string::toLower(inp->getString())) != std::string::npos)
{
auto cell = TexturePackCell::create(tps[i], thing);

content->addChild(cell);
content->addChild(cell);
}
}
}
}



float height = std::max<float>(scroll->getContentSize().height, 35 * content->getChildrenCount());

Expand Down
12 changes: 12 additions & 0 deletions support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Thank you!
Thank you for using my mods!
genuinely i never knew my stupid little mods would get so popular!
however, these mods arent free for me. Servers for this mod alone cost 15 Bucks (USD) a MONTH!
and that mostly comes out my pocket

But YOU Could Help!

By visiting the kofi and donating, you will get a special role in the discord server and my eternal thanks :3
Thanks again for using my stupid little mods!

https://ko-fi.com/uproxide

0 comments on commit 994bd4e

Please sign in to comment.