Skip to content

Commit 1ce742c

Browse files
authored
Merge pull request #18 from ReDevCafe/dev
2 parents 1410b63 + 30b5888 commit 1ce742c

5 files changed

Lines changed: 30 additions & 27 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 3.6)
2-
PROJECT(FantasyLifeI-ModLoader LANGUAGES CXX C)
1+
cmake_minimum_required(VERSION 3.10)
2+
project(FantasyLifeI-ModLoader LANGUAGES CXX C)
33

44
set(VERSION 1.00)
55
option(MLDEBUG "Enable ModLoader debug code" ON)

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
### How to install the Mod Loader
77
1. Locate your game's binaries folder
88
```mathematica
9-
Fantasy Life I/Game/Binaries/Win64
10-
11-
[ THIS ONE ]
9+
Fantasy Life I/
10+
└── Game/
11+
└── Binaries/
12+
└── Win64 ← [ THIS ONE]
1213
```
1314
2. Place **both** of the following files into that folder:
1415
- `ModLoader.dll`
1516
- `version.dll`
1617
> [!IMPORTANT]
17-
> `ModLoader.dll` and `version.dll` can be built from source or downloaded from our [release](https://github.com/AmeliaCute/FantasyLifeI-ModLoader/releases)
18+
> `ModLoader.dll` and `version.dll` can be built from source or downloaded from our [release](https://github.com/ReDevCafe/FantasyLifeI-API/releases)
1819
1920
Your directory should now look like:
2021
```mathematica
@@ -24,7 +25,7 @@ Fantasy Life I/
2425
└── Win64/
2526
├── NFL1-Win64-Shipping.exe
2627
├── ModLoader.dll
27-
── version.dll
28+
── version.dll
2829
```
2930
3. When you launch Fantasy Life I, the mod loader will automatically start alongside the game
3031

@@ -33,27 +34,29 @@ Fantasy Life I/
3334
> If you're interested in making your own mods for Fantasy Life I, there's a ready-to-use template available here:
3435
> [Fantasy Life I Mod Template](https://github.com/ReDevCafe/FantasyLifeI-ModTemplate)
3536
36-
1. At the root of your game install directory, create a folder named `Mods` if it doesn't already exist:
37+
1. Inside the Game/Contents directory of your game installation, create a folder named `Mods` if it doesn't already exist:
3738
```mathematica
3839
Fantasy Life I/
39-
├── Mods/
4040
└── Game/
41-
└── Binaries/...
41+
└── Contents/
42+
└── Mods/
4243
```
4344

4445
2. For each mod. create a subfolder inside `Mods` and drop in **both**:
4546
- `Mod.json`
4647
- The compiled mod DLL (e.g. `MyMod.mod`)
4748

4849
> [!WARNING]
49-
> Both files are required for the mod to be recognized and initialized by the mod loader so if a mod doesn't include them, there's a good chaance the developer messed up their export. <br />
50+
> Both files are required for the mod to be recognized and initialized by the mod loader so if a mod doesn't include them, there's a good chance the developer messed up their export. <br />
5051
5152
Example layout:
5253
```mathematica
5354
Fantasy Life I/
54-
└── Mods/
55-
├── MyMod/
56-
│ ├── Mod.json
57-
│ └── MyMod.mod
58-
└── OtherMod/...
55+
└── Game/
56+
└── Contents/
57+
└── Mods/
58+
├── MyMod/
59+
│ ├── Mod.json
60+
│ └── MyMod.mod
61+
└── OtherMod/...
5962
```

include

Submodule include updated 129 files

src/ModEnvironnement.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,26 @@ int ModEnvironnement::SetupEnvironnement(std::string modDirs)
102102
std::vector<ModObject*> tempModList;
103103
for (const auto& entry : std::filesystem::directory_iterator(modDirs))
104104
{
105-
if (!std::filesystem::is_directory(entry))
106-
{
107-
ModLoader::logger->error("Invalid object inside the mods folder");
108-
return 0;
105+
std::filesystem::path entryPath = entry.path();
106+
if (!std::filesystem::is_directory(entry))
107+
{
108+
ModLoader::logger->verbose("Invalid entry: ", entryPath);
109+
continue; // Just skip it
109110
}
110111

111-
std::filesystem::path entryPath = entry.path();
112112
std::filesystem::path modJsonPath = entryPath / "Mod.json";
113113
if (!std::filesystem::exists(modJsonPath))
114114
{
115-
ModLoader::logger->error("Invalid mod packet inside of", entryPath, " Missing: ", modJsonPath);
116-
return 0;
115+
ModLoader::logger->warn("Invalid mod packet inside of ", entryPath, " Missing: ", modJsonPath);
116+
continue;
117117
}
118118

119119
ModObject* mod = new ModObject(parseModMeta(modJsonPath), entryPath);
120120
std::filesystem::path modLibPath = entryPath / (mod->getMeta().name + ".mod");
121121
if (!std::filesystem::exists(modLibPath))
122122
{
123-
ModLoader::logger->error("Invalid mod packet inside of", entryPath, " Missing: ", modLibPath);
124-
return 0;
123+
ModLoader::logger->warn("Invalid mod packet inside of ", entryPath, " Missing: ", modLibPath);
124+
continue;
125125
}
126126

127127
tempModList.push_back(mod);

src/ModLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DWORD WINAPI ModLoader::init(LPVOID lpParam) {
1717
gameData->initOthersData();
1818

1919
gameCache = new GameCache();
20-
modEnvironnement = new ModEnvironnement("../../../Mods");
20+
modEnvironnement = new ModEnvironnement("../../Content/Mods");
2121
modEnvironnement->PreLoad();
2222

2323
gameCache->PostLoadCache();

0 commit comments

Comments
 (0)