Skip to content

Commit

Permalink
gg
Browse files Browse the repository at this point in the history
  • Loading branch information
Uproxide committed Jun 7, 2024
1 parent 15b053e commit df193e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
11 changes: 1 addition & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(TWS VERSION 1.0.0)

if("${GEODE_TARGET_PLATFORM}" STREQUAL "iOS")
message(STATUS "building for ios uwu")
unset(CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES arm64)
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
set(CMAKE_SYSTEM_NAME "iOS")
endif()

add_library(${PROJECT_NAME} SHARED
src/main.cpp
src/TextureWorkshopLayer.cpp
Expand All @@ -26,7 +18,6 @@ else()
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
endif()


add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)

setup_geode_mod(${PROJECT_NAME})
setup_geode_mod(${PROJECT_NAME})
12 changes: 6 additions & 6 deletions src/TexturePackCell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TexturePackCell : public CCLayerColor {
this->setPositionY(207);
float scale = CCDirector::sharedDirector()->getContentScaleFactor()/4;

ghc::filesystem::path filePath = fmt::format("{}/packs/{}.zip", Loader::get()->getInstalledMod("geode.texture-loader")->getConfigDir(), tp->name);
std::filesystem::path filePath = fmt::format("{}/packs/{}.zip", Loader::get()->getInstalledMod("geode.texture-loader")->getConfigDir(), tp->name);

gradient = CCLayerGradient::create(ccc4(0, 0, 0, 100), ccc4(0, 255, 0, 100));
gradient->setContentSize(this->getContentSize());
Expand All @@ -53,7 +53,7 @@ class TexturePackCell : public CCLayerColor {

std::string versionSaveThing = fmt::format("{} Version", tp->name);

if (ghc::filesystem::exists(filePath)) {
if (std::filesystem::exists(filePath)) {
if (Mod::get()->getSavedValue<std::string>(versionSaveThing) == tp->version) {
gradient = CCLayerGradient::create(ccc4(0, 0, 0, 100), ccc4(0, 255, 0, 100));
gradient->setContentSize(this->getContentSize());
Expand Down Expand Up @@ -196,9 +196,9 @@ class TexturePackCell : public CCLayerColor {
menu_selector(TexturePackCell::onDelete)
);

if (!ghc::filesystem::exists(filePath)) {
if (!std::filesystem::exists(filePath)) {
viewBtnMenu->addChild(downloadButton);
} else if (ghc::filesystem::exists(filePath) && Mod::get()->getSavedValue<std::string>(versionSaveThing) != tp->version) {
} else if (std::filesystem::exists(filePath) && Mod::get()->getSavedValue<std::string>(versionSaveThing) != tp->version) {
viewBtnMenu->addChild(downloadButton);
} else {
viewBtnMenu->addChild(deleteButton);
Expand Down Expand Up @@ -239,7 +239,7 @@ class TexturePackCell : public CCLayerColor {
})
.expect([this, fileName](std::string const& err) {
Notification::create("Download Failed", CCSprite::createWithSpriteFrameName("GJ_deleteIcon_001.png"))->show();
ghc::filesystem::remove(fileName);
std::filesystem::remove(fileName);
});
}

Expand All @@ -256,7 +256,7 @@ class TexturePackCell : public CCLayerColor {
[this](auto, bool btn2) {
if (btn2) {
std::string fileName = fmt::format("{}/packs/{}.zip", Loader::get()->getInstalledMod("geode.texture-loader")->getConfigDir(), texturePack->name);
ghc::filesystem::remove(fileName);
std::filesystem::remove(fileName);
Notification::create(fmt::format("Deleted {}!", texturePack->name), CCSprite::createWithSpriteFrameName("GJ_completesIcon_001.png"))->show();
auto workshopLayer = TextureWorkshopLayer::scene();
CCDirector::sharedDirector()->pushScene(workshopLayer);
Expand Down
8 changes: 4 additions & 4 deletions src/TexturePackInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TexturePackInfo : public Popup<TexturePack*> {

texturePack = tp;

ghc::filesystem::path filePath = fmt::format("{}/packs/{}.zip", Loader::get()->getInstalledMod("geode.texture-loader")->getConfigDir(), tp->name);
std::filesystem::path filePath = fmt::format("{}/packs/{}.zip", Loader::get()->getInstalledMod("geode.texture-loader")->getConfigDir(), tp->name);

auto winSize = CCDirector::get()->getWinSize();
float scale = CCDirector::sharedDirector()->getContentScaleFactor()/4;
Expand Down Expand Up @@ -128,7 +128,7 @@ class TexturePackInfo : public Popup<TexturePack*> {
viewBtnMenu->setLayout(RowLayout::create());
viewBtnMenu->setContentSize(downloadButtonSpr->getContentSize());

if (!ghc::filesystem::exists(filePath)) {
if (!std::filesystem::exists(filePath)) {
viewBtnMenu->addChild(downloadButton);
downloadButton->setPosition(downloadButtonSpr->getContentSize() / 2);
} else {
Expand Down Expand Up @@ -156,7 +156,7 @@ class TexturePackInfo : public Popup<TexturePack*> {
.expect([this](std::string const& err) {
Notification::create("Download Failed", CCSprite::createWithSpriteFrameName("GJ_deleteIcon_001.png"))->show();
std::string fileName = fmt::format("{}/packs/{}.zip", Loader::get()->getInstalledMod("geode.texture-loader")->getConfigDir(), texturePack->name);
ghc::filesystem::remove(fileName);
std::filesystem::remove(fileName);
});
}

Expand All @@ -168,7 +168,7 @@ class TexturePackInfo : public Popup<TexturePack*> {
[this](auto, bool btn2) {
if (btn2) {
std::string fileName = fmt::format("{}/packs/{}.zip", Loader::get()->getInstalledMod("geode.texture-loader")->getConfigDir(), texturePack->name);
ghc::filesystem::remove(fileName);
std::filesystem::remove(fileName);
Notification::create(fmt::format("Deleted {}!", texturePack->name), CCSprite::createWithSpriteFrameName("GJ_completesIcon_001.png"))->show();
auto workshopLayer = TextureWorkshopLayer::scene();
this->onClose(nullptr);
Expand Down

0 comments on commit df193e5

Please sign in to comment.