Skip to content

Commit 8c1f0f3

Browse files
authored
Update Dependency to match 5.0.0 syntax (#98)
* Updated syntax for events * Fixed grammar * test
1 parent d6845b4 commit 8c1f0f3

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

mods/dependencies.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Dependency mods are like any other mods, except that they **include their header
1616

1717
Otherwise, dependency mods are just like normal mods; they may place hooks, patches, add features to the game, and be published on the mods index. However, **dependency mods should keep the features they add to a minimum**, and be focused on the specific features they're meant to add. For example, a custom keybinds dependency should only add the necessities for working with custom keybinds; it shouldn't also add a bunch of other features, like adding more icons or customizing menus.
1818

19-
If a dependency is required, it is **linked to**; this means that for the mod that depends on it to run, the dependency must be present. However, as sometimes you may want to only use a dependency if it is loaded, **dependencies may also be marked optional**. In this case, the dependency is not linked to, which means that you can't use any of the dependency's functions, but have to use Geode's functions for working with optional dependencies. See [Optional dependencies](#optional-dependencies) for more info.
19+
If a dependency is required, it is **linked to**; this means that for the mod that depends on it to run, the dependency must be present. However, as sometimes you may want to only use a dependency if it is loaded, **dependencies may also be marked optional**. In this case, the dependency is not linked to, which means that you can't use any of the dependency's functions, but have to use Geode's functions for working with optional dependencies. See [Optional dependencies](#Events) for more info.
2020

2121
## Adding dependencies
2222

@@ -33,17 +33,17 @@ Dependencies can be added to your mod by simply adding it to the `dependencies`
3333
"someones-mod": ">=v1.0.5",
3434
"someone-elses.mod": {
3535
"version": ">=v1.2.5",
36-
"importance": "required"
36+
"required": true
3737
}
3838
}
3939
}
4040
```
4141

42-
Dependencies can be specified by using an object that maps from a mod id to a version, or more information if needed. The dependency may have an [importance](#importance), which specifies if the dependency is required or not. If this is not specified, the dependency is marked as required.
42+
Dependencies can be specified by using an object that maps from a mod id to a version, or more information if needed. The dependency may also be set as required, which specifies if the mod is required or [optional](#Optional-Dependencies) for the dependant mod to load. If this is not specified, the dependency is marked as required.
4343

4444
The `version` field of a dependency may be written as `>=version`, `=version`, or `<=version`. The comparisons work as expected, with the addition that if the major versions are different, the comparison is always false. This means that if you depend on version `>=1.2.5` of a mod, version `v1.8.0` will be considered acceptable but `v2.0.0` will not. For this reason, [if you make a mod that is depended upon, you should follow strict semver](https://semver.org).
4545

46-
Once you have added a dependency to your `mod.json`, if you have [Geode CLI v1.4.0 or higher](/geode/installcli), it's headers are automatically added to your project. If you have the mod installed, the headers from the installed version will be used. If you don't have the mod installed, Geode will install it from the mods index. The added dependency files for your project can be found in `build/geode-deps/<dep.id>`. Geode automatically add `build/geode-deps` to your project's include path, and links whatever binaries are found in dependencies, meaning you most likely don't have to configure anything.
46+
Once you have added a dependency to your `mod.json`, if you have [Geode CLI v1.4.0 or higher](/geode/installcli), its headers are automatically added to your project. If you have the mod installed, the headers from the installed version will be used. If you don't have the mod installed, Geode will install it from the mods index. The added dependency files for your project can be found in `build/geode-deps/<dep.id>`. Geode automatically adds `build/geode-deps` to your project's include path, and links whatever binaries are found in dependencies, meaning you most likely don't have to configure anything.
4747

4848
## Example
4949

@@ -66,12 +66,7 @@ Now, if you reconfigure your CMake (or if you're using CMake Tools in VS Code, i
6666

6767
If you now go to compile and test your mod, everything should work out-of-the-box.
6868

69-
## Importance
70-
71-
> Possible values:
72-
> - `required` (default) - Dependency must be installed for this mod to work
73-
> - `recommended` - Dependency is not required, but is recommended and will be downloaded by default.
74-
> - `suggested` - Dependency is not required, and will not be downloaded by default.
69+
## Optional Dependencies
7570

7671
In case the dependency is **not required**, it is not linked to, which in turn means that you can't use any of its exported functions. In cases like these, the dependency should provide ways through Geode to dynamically call its functions, such as through events.
7772

@@ -200,3 +195,6 @@ void api::doSomething() {
200195
// ...
201196
}
202197
```
198+
199+
200+

0 commit comments

Comments
 (0)