Skip to content

Commit

Permalink
fix(indentation): broken admonition content
Browse files Browse the repository at this point in the history
  • Loading branch information
saibotk committed Jul 4, 2024
1 parent f4817f4 commit d674bed
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 48 deletions.
26 changes: 13 additions & 13 deletions docs/developers/basics/creating-an-addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ Additionally a [linter](<https://en.wikipedia.org/wiki/Lint_(software)>) is a ni
Additionally there are other lua addons available. All addons can be easily installed from inside VSCode itself with a single click.

???+ abstract "Ready to Use Editor With Version Control and GMod Linting"
![My VSCode](../../assets/images/article/vscode.png)
![My VSCode](../../assets/images/article/vscode.png)

### Version Control

It is generally recommended to use [Git](https://git-scm.com/) for the management of projects. Especially if they are software related. We're using [GitHub](http://github.com/) as our hosting platform, however you are free to use any alternative that you like. GitHub also offers an easy to use client that is really beginner friendly. It is called [GitHub Desktop](https://desktop.github.com/).

???+ abstract "Easy to Use Graphical Interface for GitHub"
![My Addons Folder](../../assets/images/article/github.png)
![My Addons Folder](../../assets/images/article/github.png)

Once your software is set up, you can create your first repository. Personally I do not like to create my local repository folders inside the garrysmod `addons/` folder since I prefer to have all my projects inside one folder to keep them organised. This creates a problem though, since it is really tedious to copy the contents from the `addons/` folder to your projects folder and back. [Symbolic links](https://en.wikipedia.org/wiki/Symbolic_link) are a neat solution for this. Personally on windows I use a graphical interface ([tutorial on setup and use](https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/)), however it is up to your own preferences.

Expand All @@ -27,7 +27,7 @@ Once your software is set up, you can create your first repository. Personally I
All your addon files have to be placed into `GarrysMod/garrysmod/addons` and are automatically loaded when the game is started. Adding a new addon folder into this directory needs a restart of the game however.

???+ abstract "`addons/` Folder With Many Addons as Symbolic Links Inside"
![My Addons Folder](../../assets/images/article/folder.png)
![My Addons Folder](../../assets/images/article/folder.png)

See [this source](https://wiki.facepunch.com/gmod/Lua_Folder_Structure) for a detailed overview over the standard Garry's Mod project structure.

Expand Down Expand Up @@ -70,19 +70,19 @@ The most easy way of publishing your addon is with the [GMPublisher](https://git
In order to upload your addon to the Steam Workshop, you need to first compile it into a .gma file.

1. Your addon file must contain an "addon.json" within the `<addon name>/` directory of your folder. This consists of a key:value pair table with information used by the Steam
Workshop to create tags for uploads.
Workshop to create tags for uploads.
It should have a structure like this:

???+ abstract "Example addon.json file"
![addon_json.png](../../assets/images/article/addon_json.png)
???+ abstract "Example addon.json file"
![addon_json.png](../../assets/images/article/addon_json.png)

Type is the category which this addon fits into best. One of:
"ServerContent", "gamemode", "map", "weapon", "vehicle", "npc", "tool", "effects", "model".
Type is the category which this addon fits into best. One of:
"ServerContent", "gamemode", "map", "weapon", "vehicle", "npc", "tool", "effects", "model".

Tags are what describes your addon best. Choose two of:
"fun", "roleplay", "scenic", "movie", "realism", "cartoon", "water", "comic", "build".
Tags are what describes your addon best. Choose two of:
"fun", "roleplay", "scenic", "movie", "realism", "cartoon", "water", "comic", "build".

Ignore is what files (you can use the \* as a wildcard to ignore file extensions - e.g. \*.txt) you dont want gmad to compile for use in the resulting .gma file.
Ignore is what files (you can use the \* as a wildcard to ignore file extensions - e.g. \*.txt) you dont want gmad to compile for use in the resulting .gma file.

1. Navigate to your GarrysMod bin directory. (Usually in `Steam/steamapps/common/GarrysMod/bin`).

Expand All @@ -91,14 +91,14 @@ In order to upload your addon to the Steam Workshop, you need to first compile i
Alternatively you can use the cmd which gives you better error messages. Navigate to the GMod bin folder on the cmd and type gmad.exe, this gives you the gmad usage info. Input the directory to your addon folder and specify the output file directory and name.

???+ abstract "gmad help output"
![gmad_info.png](../../assets/images/article/gmad_info.png)
![gmad_info.png](../../assets/images/article/gmad_info.png)

1. Navigate to the bin folder via cmd to use gmpublish.exe.

1. Type `gmpublish.exe` to view usage information, input your icon and `*.gma` paths in their respective fields.

???+ abstract "gmpublish help output"
![gmpublish_info.png](../../assets/images/article/gmpublish_info.png)
![gmpublish_info.png](../../assets/images/article/gmpublish_info.png)

1. You have now published your addon onto the steam workshop. Visit the addon in the workshop via the link that gmpublish gives you to add information to it and make it public.

Expand Down
52 changes: 26 additions & 26 deletions docs/developers/content-creation/creating-a-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ The `classData` argument is a table that contains all the important class settin
### General Class Settings

???+ example "Setting the Class Color"
The class color is stored in the color variable. This color value is used to display the class in the HUD and in other places like targetID.
The class color is stored in the color variable. This color value is used to display the class in the HUD and in other places like targetID.

```lua
classData.color = <Color> -- [default: Color(255, 155, 0, 255)]
```

???+ example "Setting the Language"
The language for the class consists of two parts: The name and the description. At least the name should be set, but it is good practise to set the description as well.
The language for the class consists of two parts: The name and the description. At least the name should be set, but it is good practise to set the description as well.

The existing language identifiers can be found [inside these files](https://github.com/TTT-2/TTT2/tree/master/gamemodes/terrortown/gamemode/shared/lang). Currently these identifiers exist: `English`, `Deutsch`, `Русский`, `Polski`, `Italiano`

Expand All @@ -51,14 +51,14 @@ The language for the class consists of two parts: The name and the description.
```

???+ example "Setting a Class to Be Passive"
By default, classes are active. This means that they have an ability that is enabled on keypress and can only be used once activated. Besides these active feature, classes can have passive features as well (like armor for a class). However, if your class should only have passive features, set this variable to `true`.
By default, classes are active. This means that they have an ability that is enabled on keypress and can only be used once activated. Besides these active feature, classes can have passive features as well (like armor for a class). However, if your class should only have passive features, set this variable to `true`.

```lua
classData.passive = <boolean> -- [default: false]
```

???+ example "Surpress Keep on Respawn"
If `true`, the player won't get the class back on respawn, no matter how the ConVar `ttt_classes_keep_on_respawn` is set.
If `true`, the player won't get the class back on respawn, no matter how the ConVar `ttt_classes_keep_on_respawn` is set.

```lua
classData.surpressKeepOnRespawn = <boolean> -- [default: false]
Expand All @@ -67,7 +67,7 @@ If `true`, the player won't get the class back on respawn, no matter how the Con
See [the Vendetta](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_vendetta.lua) for an example.

???+ example "Class is Active During Death"
Should be set to `true`, if the class is getting active after the players death and should not get removed after death. This information is important for other addons like "TTTC Class Dropper".
Should be set to `true`, if the class is getting active after the players death and should not get removed after death. This information is important for other addons like "TTTC Class Dropper".

```lua
classData.activeDuringDeath = <boolean> -- [default: false]
Expand All @@ -76,7 +76,7 @@ Should be set to `true`, if the class is getting active after the players death
See [the Vendetta](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_vendetta.lua) for an example.

???+ example "Deactivate Automatic Class Handling"
The class system handles each feature in predefined functions. However you might want to create a really custom class that does not rely on any standard implementations. By setting this variable to `true`, none of the following functions and tables will be used.
The class system handles each feature in predefined functions. However you might want to create a really custom class that does not rely on any standard implementations. By setting this variable to `true`, none of the following functions and tables will be used.

```lua
classData.deactivated = <boolean> -- [default: false]
Expand All @@ -87,28 +87,28 @@ The class system handles each feature in predefined functions. However you might
### Passive Ability

???+ example "Passive Weapons"
A table of weapons given to the player once the class is set, they are automatically removed when the class is removed from the player. You can use the hook `TTTCPreventClassEquipment` to prevent the weapon hand-out and `TTTCPreventClassRemovement` to prevent the weapon removal to happen.
A table of weapons given to the player once the class is set, they are automatically removed when the class is removed from the player. You can use the hook `TTTCPreventClassEquipment` to prevent the weapon hand-out and `TTTCPreventClassRemovement` to prevent the weapon removal to happen.

```lua
classData.passiveWeapons = {}
```

???+ example "Passive Items"
A table of items given to the player once the class is set, they are automatically removed when the class is removed from the player. You can use the hook `TTTCPreventClassEquipment` to prevent the item hand-out and `TTTCPreventClassRemovement` to prevent the item removal to happen.
A table of items given to the player once the class is set, they are automatically removed when the class is removed from the player. You can use the hook `TTTCPreventClassEquipment` to prevent the item hand-out and `TTTCPreventClassRemovement` to prevent the item removal to happen.

```lua
classData.passiveItems = {}
```

???+ example "On Class Set Callback"
A function that is called when this class is given to a player after class change or on respawn. You can use the hook `TTTCPreventClassEquipment` to prevent this function to happen.
A function that is called when this class is given to a player after class change or on respawn. You can use the hook `TTTCPreventClassEquipment` to prevent this function to happen.

```lua
classData.OnSet = function(ply) -- [default: nil]
```

???+ example "On Class Unset Callback"
A function that is called when this class is removed from a player. You can use the hook `TTTCPreventClassRemovement` to prevent this function to happen.
A function that is called when this class is removed from a player. You can use the hook `TTTCPreventClassRemovement` to prevent this function to happen.

```lua
classData.OnUnset = function(ply) -- [default: nil]
Expand All @@ -117,21 +117,21 @@ A function that is called when this class is removed from a player. You can use
### Active Ability

???+ example "Active Weapons"
A table of weapons given to the player once the class is activated, they are automatically removed when the class is deactivated or removed from the player.
A table of weapons given to the player once the class is activated, they are automatically removed when the class is deactivated or removed from the player.

```lua
classData.weapons = {}
```

???+ example "Passive Items"
A table of items given to the player once the class is activated, they are automatically removed when the class is deactivated or removed from the player.
A table of items given to the player once the class is activated, they are automatically removed when the class is deactivated or removed from the player.

```lua
classData.items = {}
```

???+ example "Active Time"
The time how long the ability is enabled after the player activated it. If set to `0`, `onActivate` isn't called. You have to use `onDeactivated` in this case. This can be used for classes that have no active ability, but an ability that triggers an event.
The time how long the ability is enabled after the player activated it. If set to `0`, `onActivate` isn't called. You have to use `onDeactivated` in this case. This can be used for classes that have no active ability, but an ability that triggers an event.

```lua
classData.time = <number> -- [default: 60]
Expand All @@ -140,63 +140,63 @@ The time how long the ability is enabled after the player activated it. If set t
See [the Nebula](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_nebula.lua) for an example of an event ability with a time of `0`.

???+ example "Cooldown Time"
The cooldown time after the usage of the active ability.
The cooldown time after the usage of the active ability.

```lua
classData.cooldown = <number> -- [default: 60]
```

???+ example "Charging Time"
Defines how long the activation key must be pressed to activate the ability, `nil` for instant activation.
Defines how long the activation key must be pressed to activate the ability, `nil` for instant activation.

```lua
classData.charging = <number> -- [default: nil]
```

???+ example "Max Activation Amount Per Round"
Defines how many times an ability can be activated per round, `nil` for infinite times.
Defines how many times an ability can be activated per round, `nil` for infinite times.

```lua
classData.amount = <number> -- [default: nil]
```

???+ example "Endless Class Ability"
If `true`, the time of an ability is infinite and `time` is ignored.
If `true`, the time of an ability is infinite and `time` is ignored.

```lua
classData.endless = <boolean> -- [default: false]
```

???+ example "Unstoppable Class Ability"
If `true`, the player can not disable the ability once they pressed the ability key.
If `true`, the player can not disable the ability once they pressed the ability key.

```lua
classData.unstoppable = <boolean> -- [default: false]
```

???+ example "Avoid Weapon Reset"
By default, all weapons from the player inventory get removed once they activate their class ability. These weapons are given back after the ability is deactivated. If set to `true`, the player keeps his weapons while the class ability is active.
By default, all weapons from the player inventory get removed once they activate their class ability. These weapons are given back after the ability is deactivated. If set to `true`, the player keeps his weapons while the class ability is active.

```lua
classData.avoidWeaponReset = <boolean> -- [default: false]
```

???+ example "On Class Activate Callback"
A function that is called on activation of an ability. If `avoidWeaponReset` is set to `false` weapons will be removed prior to this function call.
A function that is called on activation of an ability. If `avoidWeaponReset` is set to `false` weapons will be removed prior to this function call.

```lua
classData.OnAbilityActivate = function(ply) -- [default: nil]
```

???+ example "On Class Deactivate Callback"
A function that is called on deactivation of an ability. If `avoidWeaponReset` is set to `false` weapons will be given back prior to this function call.
A function that is called on deactivation of an ability. If `avoidWeaponReset` is set to `false` weapons will be given back prior to this function call.

```lua
classData.OnAbilityDeactivate = function(ply) -- [default: nil]
```

???+ example "On Class Prepare Callback"
A function that is called prior to `OnAbilityActivate`. If this function is set, the ability will be activated on the next ability-key press. This can be used to have a two step activation procedure
A function that is called prior to `OnAbilityActivate`. If this function is set, the ability will be activated on the next ability-key press. This can be used to have a two step activation procedure

```lua
classData.OnStartPrepareAbilityActivation = function(ply) -- [default: nil]
Expand All @@ -205,7 +205,7 @@ A function that is called prior to `OnAbilityActivate`. If this function is set,
See [the Frost](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_frost.lua) for an example.

???+ example "On Class Finish Prepare Callback"
This function will only be called if `OnStartPrepareAbilityActivation` was set. It is called on the second press of the ability key and is done directly before `OnAbilityActivate`. If the ability was canceled in this process, this function is called prior to `OnAbilityDeactivate`.
This function will only be called if `OnStartPrepareAbilityActivation` was set. It is called on the second press of the ability key and is done directly before `OnAbilityActivate`. If the ability was canceled in this process, this function is called prior to `OnAbilityDeactivate`.

```lua
classData.OnFinishPrepareAbilityActivation = function(ply) -- [default: nil]
Expand All @@ -214,14 +214,14 @@ This function will only be called if `OnStartPrepareAbilityActivation` was set.
See [the Frost](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_frost.lua) for an example.

???+ example "On Class Charge Callback"
This function is called once every frame after while a player is in the charging process, if the function is set and it returns `nil` or `false`, the charging process is stopped.
This function is called once every frame after while a player is in the charging process, if the function is set and it returns `nil` or `false`, the charging process is stopped.

```lua
classData.OnCharge = function(ply) -- [default: nil]
```

???+ example "Check Class Activation Callback"
This function is called when the ability should be activated. Activation fails if the function is set and it returns `nil` or `false`.
This function is called when the ability should be activated. Activation fails if the function is set and it returns `nil` or `false`.

```lua
classData.CheckActivation = function(ply) -- [default: nil]
Expand All @@ -232,7 +232,7 @@ This function is called when the ability should be activated. Activation fails i
The `conVarData` table holds all default values for the convars to modify the class.

???+ example "Class Random"
This defines the spawn chance of a class.
This defines the spawn chance of a class.

```lua
conVarData.random = <number> -- [default: 100]
Expand Down
Loading

0 comments on commit d674bed

Please sign in to comment.