mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-30 11:17:08 -05:00
Compare commits
16 commits
569cff8432
...
84d9975c87
Author | SHA1 | Date | |
---|---|---|---|
|
84d9975c87 | ||
|
adfc942fa0 | ||
|
0da931619a | ||
|
bff34729a7 | ||
|
db2e48eb59 | ||
|
3222c12e90 | ||
|
f45b8b7128 | ||
|
0da9cef29f | ||
|
9a46231420 | ||
|
cded0523a5 | ||
|
2e039a9cea | ||
|
ae24abbcec | ||
|
9c9c75d46b | ||
|
d117d50fb0 | ||
|
b80efe0517 | ||
|
7d40c8188f |
7 changed files with 75 additions and 20 deletions
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
|
@ -154,23 +154,20 @@ jobs:
|
|||
has-sccache: ${{ inputs.use-ccache }}
|
||||
if: inputs.build-debug-info
|
||||
|
||||
- name: Setup caches
|
||||
uses: ./.github/actions/setup-cache
|
||||
with:
|
||||
host: mac
|
||||
target: mac
|
||||
use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
|
||||
# due to very strange performance issues, sccache is currently disabled for macos. sorry
|
||||
|
||||
# - name: Setup caches
|
||||
# uses: ./.github/actions/setup-cache
|
||||
# with:
|
||||
# host: mac
|
||||
# target: mac
|
||||
# use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
|
||||
|
||||
- name: Setup Ninja
|
||||
uses: ./.github/actions/setup-ninja
|
||||
with:
|
||||
host: mac
|
||||
|
||||
- name: Install LLVM
|
||||
run: |
|
||||
brew install llvm
|
||||
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Setup CLI
|
||||
uses: geode-sdk/cli/.github/actions/setup@main
|
||||
|
||||
|
@ -180,9 +177,8 @@ jobs:
|
|||
-DCMAKE_C_COMPILER=clang
|
||||
-DCMAKE_CXX_COMPILER=clang++
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
|
||||
-DCMAKE_AR='/usr/bin/ar'
|
||||
-DCMAKE_RANLIB='/usr/bin/ranlib'
|
||||
-DGEODE_DISABLE_PRECOMPILED_HEADERS=Off
|
||||
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
|
||||
-DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF
|
||||
${{ steps.build-debug-info.outputs.extra-configure }}
|
||||
|
||||
- name: Build
|
||||
|
|
|
@ -133,18 +133,29 @@ endif()
|
|||
if (DEFINED GEODE_CCACHE_VARIANT)
|
||||
if (NOT DEFINED GEODE_DISABLE_PRECOMPILED_HEADERS)
|
||||
if (${GEODE_CCACHE_VARIANT} STREQUAL "sccache" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
message(NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID}, PCH will be enabled.")
|
||||
set(GEODE_DISABLE_PRECOMPILED_HEADERS OFF)
|
||||
if (DEFINED CMAKE_OSX_ARCHITECTURES AND (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64;x86_64" OR CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64;arm64"))
|
||||
message(NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID} while building multiple architectures, PCH will be disabled due to issues with sccache.")
|
||||
set(GEODE_DISABLE_PRECOMPILED_HEADERS ON)
|
||||
else()
|
||||
message(NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID}, PCH will be enabled.")
|
||||
set(GEODE_DISABLE_PRECOMPILED_HEADERS OFF)
|
||||
endif()
|
||||
else()
|
||||
message(NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID}, PCH will be disabled.")
|
||||
set(GEODE_DISABLE_PRECOMPILED_HEADERS ON)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(NOTICE "Not using a caching compiler (ccache/sccache). "
|
||||
"It is recommended to install one to improve build times.")
|
||||
message(NOTICE "We recommend sccache, check its README for installation instructions, "
|
||||
"normally you can just use your usual package manager (e.g. 'scoop install sccache').")
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
# when building for multiple architectures, a caching compiler is not recommended
|
||||
message(NOTICE "Not using a caching compiler (ccache/sccache).")
|
||||
else()
|
||||
message(NOTICE "Not using a caching compiler (ccache/sccache). "
|
||||
"It is recommended to install one to improve build times.")
|
||||
message(NOTICE "We recommend sccache, check its README for installation instructions, "
|
||||
"normally you can just use your usual package manager (e.g. 'scoop install sccache').")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED GEODE_DISABLE_PRECOMPILED_HEADERS)
|
||||
message(NOTICE "Because of this, PCH will be enabled.")
|
||||
set(GEODE_DISABLE_PRECOMPILED_HEADERS OFF)
|
||||
|
|
BIN
loader/resources/copy.png
Normal file
BIN
loader/resources/copy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
|
@ -156,6 +156,7 @@ public:
|
|||
});
|
||||
|
||||
auto req = web::WebRequest();
|
||||
req.userAgent(getServerUserAgent());
|
||||
m_downloadListener.setFilter(req.get(version.downloadURL));
|
||||
ModDownloadEvent(m_id).post();
|
||||
}
|
||||
|
|
|
@ -375,6 +375,17 @@ bool ModsLayer::init() {
|
|||
folderBtn->setID("mods-folder-button");
|
||||
actionsMenu->addChild(folderBtn);
|
||||
|
||||
auto copySpr = createGeodeCircleButton(
|
||||
CCSprite::createWithSpriteFrameName("copy.png"_spr), 1.f,
|
||||
CircleBaseSize::Medium
|
||||
);
|
||||
copySpr->setScale(.8f);
|
||||
auto copyBtn = CCMenuItemSpriteExtra::create(
|
||||
copySpr, this, menu_selector(ModsLayer::onCopy)
|
||||
);
|
||||
copyBtn->setID("copy-button");
|
||||
actionsMenu->addChild(copyBtn);
|
||||
|
||||
actionsMenu->setLayout(
|
||||
ColumnLayout::create()
|
||||
->setAxisAlignment(AxisAlignment::Start)
|
||||
|
@ -702,6 +713,40 @@ void ModsLayer::onSettings(CCObject*) {
|
|||
openSettingsPopup(Mod::get());
|
||||
}
|
||||
|
||||
void ModsLayer::onCopy(CCObject*) {
|
||||
auto mods = Loader::get()->getAllMods();
|
||||
if (mods.empty()) {
|
||||
Notification::create("No mods installed", NotificationIcon::Info, 0.5f)->show();
|
||||
return;
|
||||
}
|
||||
|
||||
std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) {
|
||||
auto const s1 = a->getID();
|
||||
auto const s2 = b->getID();
|
||||
return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), [](auto a, auto b) {
|
||||
return std::tolower(a) < std::tolower(b);
|
||||
});
|
||||
});
|
||||
|
||||
std::stringstream ss;
|
||||
using namespace std::string_view_literals;
|
||||
for (int i = 0; i < mods.size(); i++) {
|
||||
auto& mod = mods[i];
|
||||
ss << fmt::format("{} | [{}] {}",
|
||||
mod->isEnabled() ? "x"sv :
|
||||
mod->hasProblems() ? "!"sv :
|
||||
" "sv,
|
||||
mod->getVersion().toVString(), mod->getID()
|
||||
);
|
||||
if (i != mods.size() - 1) {
|
||||
ss << "\n";
|
||||
}
|
||||
}
|
||||
clipboard::write(ss.str());
|
||||
|
||||
Notification::create("Mods list copied to clipboard", NotificationIcon::Info, 0.5f)->show();
|
||||
}
|
||||
|
||||
ModsLayer* ModsLayer::create() {
|
||||
auto ret = new ModsLayer();
|
||||
if (ret->init()) {
|
||||
|
|
|
@ -80,6 +80,7 @@ protected:
|
|||
void onRefreshList(CCObject*);
|
||||
void onTheme(CCObject*);
|
||||
void onSettings(CCObject*);
|
||||
void onCopy(CCObject*);
|
||||
void onBack(CCObject*);
|
||||
|
||||
void updateState();
|
||||
|
|
|
@ -103,6 +103,7 @@ bool FiltersPopup::setup(ModListSource* src) {
|
|||
|
||||
m_developerNameInput = TextInput::create(inputContainer->getContentWidth(), "Developer Name");
|
||||
m_developerNameInput->setTextAlign(TextInputAlign::Left);
|
||||
m_developerNameInput->setFilter("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-");
|
||||
m_developerNameInput->setString(src->getQuery().developer.value_or(""));
|
||||
inputContainer->addChildAtPosition(m_developerNameInput, Anchor::Center);
|
||||
|
||||
|
|
Loading…
Reference in a new issue