Skip to content

Commit

Permalink
update yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Jan 19, 2024
1 parent d41e0b8 commit 9bdc8b5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: Windows
os: windows-latest

- name: macOS
os: macos-latest
# - name: macOS
# os: macos-latest

- name: Android32
os: ubuntu-latest
target: Android32

- name: Android64
os: ubuntu-latest
target: Android64

name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
Expand All @@ -27,17 +36,19 @@ jobs:
uses: geode-sdk/build-geode-mod@main
with:
combine: true
sdk: nightly
target: ${{ matrix.config.target }}

package:
name: Package builds
runs-on: ubuntu-latest
needs: ['build']

steps:
- uses: geode-sdk/build-geode-mod@combine
- uses: geode-sdk/build-geode-mod/combine@main
id: build

- uses: actions/upload-artifact@v3
with:
name: Build Output
path: ${{ steps.build.outputs.build-output }}
path: ${{ steps.build.outputs.build-output }}
6 changes: 5 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"geode": "v2.0.0",
"version": "v1.3.0",
"version": "v1.4.0",
"gd": {
"win": "2.204",
"android": "2.200"
},
"id": "geode.texture-loader",
"name": "Texture Loader",
"developer": "Geode Team",
Expand Down
12 changes: 6 additions & 6 deletions src/Pack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <Geode/loader/Loader.hpp>
#include <Geode/utils/file.hpp>

Result<PackInfo> PackInfo::from(json::Value const& json) {
Result<PackInfo> PackInfo::from(matjson::Value const& json) {
auto info = PackInfo();

auto copyJson = json;
Expand All @@ -24,7 +24,7 @@ Result<PackInfo> PackInfo::from(json::Value const& json) {
root.needs("version").into(info.m_version);

// has single "creator" key?
if (auto creator = root.has("creator").as<json::Type::String>()) {
if (auto creator = root.has("creator").as<matjson::Type::String>()) {
info.m_creators = { creator.get<std::string>() };
}
// otherwise use "creators" key
Expand Down Expand Up @@ -96,7 +96,7 @@ Result<> Pack::parsePackJson() {
if (!data) {
return Err(data.error());
}
auto res = PackInfo::from(json::Value::from_str(data.value()));
auto res = PackInfo::from(matjson::Value::from_str(data.value()));
if (!res) {
return Err(res.unwrapErr());
}
Expand All @@ -123,12 +123,12 @@ Result<std::shared_ptr<Pack>> Pack::from(ghc::filesystem::path const& dir) {
return Ok(pack);
}

json::Value json::Serialize<std::shared_ptr<Pack>>::to_json(std::shared_ptr<Pack> const& pack) {
return json::Object({
matjson::Value matjson::Serialize<std::shared_ptr<Pack>>::to_json(std::shared_ptr<Pack> const& pack) {
return matjson::Object({
{ "path", pack->getPath() }
});
}

std::shared_ptr<Pack> json::Serialize<std::shared_ptr<Pack>>::from_json(json::Value const& value) {
std::shared_ptr<Pack> matjson::Serialize<std::shared_ptr<Pack>>::from_json(matjson::Value const& value) {
return Pack::from(value["path"].as<ghc::filesystem::path>()).unwrap();
}
10 changes: 5 additions & 5 deletions src/Pack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <Geode/utils/VersionInfo.hpp>
#include <Geode/ui/EnterLayerEvent.hpp>
#include "Edit.hpp"
#include <json/stl_serialize.hpp>
#include <matjson/stl_serialize.hpp>

using namespace geode::prelude;

Expand All @@ -20,7 +20,7 @@ struct PackInfo {
std::vector<std::string> m_creators;
std::vector<ghc::filesystem::path> m_edits;

static Result<PackInfo> from(json::Value const& json);
static Result<PackInfo> from(matjson::Value const& json);
};

class Pack {
Expand All @@ -45,7 +45,7 @@ class Pack {
};

template <>
struct json::Serialize<std::shared_ptr<Pack>> {
static json::Value to_json(std::shared_ptr<Pack> const& pack);
static std::shared_ptr<Pack> from_json(json::Value const& value);
struct matjson::Serialize<std::shared_ptr<Pack>> {
static matjson::Value to_json(std::shared_ptr<Pack> const& pack);
static std::shared_ptr<Pack> from_json(matjson::Value const& value);
};

0 comments on commit 9bdc8b5

Please sign in to comment.