diff --git a/404.html b/404.html index 9c571a899..c30c3ddeb 100644 --- a/404.html +++ b/404.html @@ -13,7 +13,7 @@
Skip to content

404

PAGE NOT FOUND

But if you don't change your direction, and if you keep looking, you may end up where you are heading.

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/assets/development_core_getting-started.md.b61c982f.js b/assets/development_core_getting-started.md.a2867fbe.js similarity index 98% rename from assets/development_core_getting-started.md.b61c982f.js rename to assets/development_core_getting-started.md.a2867fbe.js index d164dfeb7..60e3de2b7 100644 --- a/assets/development_core_getting-started.md.b61c982f.js +++ b/assets/development_core_getting-started.md.a2867fbe.js @@ -1 +1 @@ -import{_ as e,o as t,c as o,S as r}from"./chunks/framework.f15d8f8c.js";const m=JSON.parse('{"title":"Getting started","description":"","frontmatter":{},"headers":[],"relativePath":"development/core/getting-started.md","filePath":"development/core/getting-started.md"}'),n={name:"development/core/getting-started.md"},a=r('

Getting started

This documentation page will help you set up a directory containing everything you need to start working on EvoSC#

Prerequisites

Start by installing Docker Engine and Docker Compose depending on your OS. You will also need .NET 7

Setting up a server

Go to the Trackmania player page, log into your Ubisoft account, click "servers" and create a new server account.
You will need the login and password for the server, so note them down.

Then, clone the repository for EvoSC# using git clone <repository link>

In the newly created directory, edit the docker-compose.yml file.
You will need to replace the MASTER_LOGIN and MASTER_PASSWORD lines with the server username and password you noted earlier.

If you are planning to open this server to the internet, you may want to change the MariaDB user info, but by default your server should be limited to your local network.

Boot up the Trackmania server using docker-compose up. If you want to have the server running in the background, you can add the -d argument.

Your server should be up and running! You can connect to it in Trackmania in the local section of the play menu.

Booting up EvoSC#

Go to the EvoSC directory, and run dotnet run. This will compile the source code and run the Application. If you want to build without running use dotnet build instead. You will need to do that every time before starting EvoSC if you modified the code, else the changes won't apply.

If you are using the default docker-compose setup in the EvoSC# repo readme, you should be good to go and EvoSC# should be up and running! EvoSC# is now up and running! Test it by connecting to the server: if there is a message with your login in the chat when connecting, everything should work.

If you get any errors or using another docker-compose file you may need to edit the main.toml file in EvoSC/config/main.toml to fit your needs or check the terminal for errors.

',15),i=[a];function s(d,c,l,u,h,p){return t(),o("div",null,i)}const f=e(n,[["render",s]]);export{m as __pageData,f as default}; +import{_ as e,o as t,c as o,S as r}from"./chunks/framework.f15d8f8c.js";const m=JSON.parse('{"title":"Getting started","description":"","frontmatter":{},"headers":[],"relativePath":"development/core/getting-started.md","filePath":"development/core/getting-started.md"}'),n={name:"development/core/getting-started.md"},a=r('

Getting started

This documentation page will help you set up a directory containing everything you need to start working on EvoSC#

Prerequisites

Start by installing Docker Engine and Docker Compose depending on your OS. You will also need .NET 8

Setting up a server

Go to the Trackmania player page, log into your Ubisoft account, click "servers" and create a new server account.
You will need the login and password for the server, so note them down.

Then, clone the repository for EvoSC# using git clone <repository link>

In the newly created directory, edit the docker-compose.yml file.
You will need to replace the MASTER_LOGIN and MASTER_PASSWORD lines with the server username and password you noted earlier.

If you are planning to open this server to the internet, you may want to change the MariaDB user info, but by default your server should be limited to your local network.

Boot up the Trackmania server using docker-compose up. If you want to have the server running in the background, you can add the -d argument.

Your server should be up and running! You can connect to it in Trackmania in the local section of the play menu.

Booting up EvoSC#

Go to the EvoSC directory, and run dotnet run. This will compile the source code and run the Application. If you want to build without running use dotnet build instead. You will need to do that every time before starting EvoSC if you modified the code, else the changes won't apply.

If you are using the default docker-compose setup in the EvoSC# repo readme, you should be good to go and EvoSC# should be up and running! EvoSC# is now up and running! Test it by connecting to the server: if there is a message with your login in the chat when connecting, everything should work.

If you get any errors or using another docker-compose file you may need to edit the main.toml file in EvoSC/config/main.toml to fit your needs or check the terminal for errors.

',15),i=[a];function s(d,c,l,u,h,p){return t(),o("div",null,i)}const f=e(n,[["render",s]]);export{m as __pageData,f as default}; diff --git a/assets/development_core_getting-started.md.b61c982f.lean.js b/assets/development_core_getting-started.md.a2867fbe.lean.js similarity index 100% rename from assets/development_core_getting-started.md.b61c982f.lean.js rename to assets/development_core_getting-started.md.a2867fbe.lean.js diff --git a/assets/development_core_index.md.9a200a43.js b/assets/development_core_index.md.f69adc19.js similarity index 56% rename from assets/development_core_index.md.9a200a43.js rename to assets/development_core_index.md.f69adc19.js index 8ceaaad8a..52bf8ede2 100644 --- a/assets/development_core_index.md.9a200a43.js +++ b/assets/development_core_index.md.f69adc19.js @@ -1 +1 @@ -import{_ as t,o,c as n,k as e,a}from"./chunks/framework.f15d8f8c.js";const x=JSON.parse('{"title":"About EvoSC#","description":"","frontmatter":{},"headers":[],"relativePath":"development/core/index.md","filePath":"development/core/index.md"}'),s={name:"development/core/index.md"},r=e("h1",{id:"about-evosc",tabindex:"-1"},[a("About EvoSC# "),e("a",{class:"header-anchor",href:"#about-evosc","aria-label":'Permalink to "About EvoSC#"'},"​")],-1),i=e("p",null,"EvoSC# (spoken: EvoSC Sharp) is a server controller for Trackmania 2020 dedicated servers. It has been written from the ground up in C# / .NET 6.0 to be modular, performant and easy to use. It is currently still in development, so expect braking changes to happen at any time.",-1),l=e("hr",null,null,-1),c=e("p",null,"This documentation is still being worked on, so please be patient while we fill in all the information.",-1),d=[r,i,l,c];function p(h,m,_,u,v,f){return o(),n("div",null,d)}const k=t(s,[["render",p]]);export{x as __pageData,k as default}; +import{_ as t,o,c as n,k as e,a}from"./chunks/framework.f15d8f8c.js";const x=JSON.parse('{"title":"About EvoSC#","description":"","frontmatter":{},"headers":[],"relativePath":"development/core/index.md","filePath":"development/core/index.md"}'),s={name:"development/core/index.md"},r=e("h1",{id:"about-evosc",tabindex:"-1"},[a("About EvoSC# "),e("a",{class:"header-anchor",href:"#about-evosc","aria-label":'Permalink to "About EvoSC#"'},"​")],-1),i=e("p",null,"EvoSC# (spoken: EvoSC Sharp) is a server controller for Trackmania 2020 dedicated servers. It has been written from the ground up in C# / .NET 8 to be modular, performant and easy to use. It is currently still in development, so expect breaking changes to happen at any time.",-1),l=e("hr",null,null,-1),c=e("p",null,"This documentation is still being worked on, so please be patient while we fill in all the information.",-1),d=[r,i,l,c];function p(h,m,_,u,v,f){return o(),n("div",null,d)}const k=t(s,[["render",p]]);export{x as __pageData,k as default}; diff --git a/assets/development_core_index.md.9a200a43.lean.js b/assets/development_core_index.md.f69adc19.lean.js similarity index 56% rename from assets/development_core_index.md.9a200a43.lean.js rename to assets/development_core_index.md.f69adc19.lean.js index 8ceaaad8a..52bf8ede2 100644 --- a/assets/development_core_index.md.9a200a43.lean.js +++ b/assets/development_core_index.md.f69adc19.lean.js @@ -1 +1 @@ -import{_ as t,o,c as n,k as e,a}from"./chunks/framework.f15d8f8c.js";const x=JSON.parse('{"title":"About EvoSC#","description":"","frontmatter":{},"headers":[],"relativePath":"development/core/index.md","filePath":"development/core/index.md"}'),s={name:"development/core/index.md"},r=e("h1",{id:"about-evosc",tabindex:"-1"},[a("About EvoSC# "),e("a",{class:"header-anchor",href:"#about-evosc","aria-label":'Permalink to "About EvoSC#"'},"​")],-1),i=e("p",null,"EvoSC# (spoken: EvoSC Sharp) is a server controller for Trackmania 2020 dedicated servers. It has been written from the ground up in C# / .NET 6.0 to be modular, performant and easy to use. It is currently still in development, so expect braking changes to happen at any time.",-1),l=e("hr",null,null,-1),c=e("p",null,"This documentation is still being worked on, so please be patient while we fill in all the information.",-1),d=[r,i,l,c];function p(h,m,_,u,v,f){return o(),n("div",null,d)}const k=t(s,[["render",p]]);export{x as __pageData,k as default}; +import{_ as t,o,c as n,k as e,a}from"./chunks/framework.f15d8f8c.js";const x=JSON.parse('{"title":"About EvoSC#","description":"","frontmatter":{},"headers":[],"relativePath":"development/core/index.md","filePath":"development/core/index.md"}'),s={name:"development/core/index.md"},r=e("h1",{id:"about-evosc",tabindex:"-1"},[a("About EvoSC# "),e("a",{class:"header-anchor",href:"#about-evosc","aria-label":'Permalink to "About EvoSC#"'},"​")],-1),i=e("p",null,"EvoSC# (spoken: EvoSC Sharp) is a server controller for Trackmania 2020 dedicated servers. It has been written from the ground up in C# / .NET 8 to be modular, performant and easy to use. It is currently still in development, so expect breaking changes to happen at any time.",-1),l=e("hr",null,null,-1),c=e("p",null,"This documentation is still being worked on, so please be patient while we fill in all the information.",-1),d=[r,i,l,c];function p(h,m,_,u,v,f){return o(),n("div",null,d)}const k=t(s,[["render",p]]);export{x as __pageData,k as default}; diff --git a/development/core/getting-started.html b/development/core/getting-started.html index 5af7b698b..90ce5b438 100644 --- a/development/core/getting-started.html +++ b/development/core/getting-started.html @@ -11,12 +11,12 @@ - + -
Skip to content
On this page

Getting started

This documentation page will help you set up a directory containing everything you need to start working on EvoSC#

Prerequisites

Start by installing Docker Engine and Docker Compose depending on your OS. You will also need .NET 7

Setting up a server

Go to the Trackmania player page, log into your Ubisoft account, click "servers" and create a new server account.
You will need the login and password for the server, so note them down.

Then, clone the repository for EvoSC# using git clone <repository link>

In the newly created directory, edit the docker-compose.yml file.
You will need to replace the MASTER_LOGIN and MASTER_PASSWORD lines with the server username and password you noted earlier.

If you are planning to open this server to the internet, you may want to change the MariaDB user info, but by default your server should be limited to your local network.

Boot up the Trackmania server using docker-compose up. If you want to have the server running in the background, you can add the -d argument.

Your server should be up and running! You can connect to it in Trackmania in the local section of the play menu.

Booting up EvoSC#

Go to the EvoSC directory, and run dotnet run. This will compile the source code and run the Application. If you want to build without running use dotnet build instead. You will need to do that every time before starting EvoSC if you modified the code, else the changes won't apply.

If you are using the default docker-compose setup in the EvoSC# repo readme, you should be good to go and EvoSC# should be up and running! EvoSC# is now up and running! Test it by connecting to the server: if there is a message with your login in the chat when connecting, everything should work.

If you get any errors or using another docker-compose file you may need to edit the main.toml file in EvoSC/config/main.toml to fit your needs or check the terminal for errors.

Made with ❤️ by EvoSC# Devs

- +
Skip to content
On this page

Getting started

This documentation page will help you set up a directory containing everything you need to start working on EvoSC#

Prerequisites

Start by installing Docker Engine and Docker Compose depending on your OS. You will also need .NET 8

Setting up a server

Go to the Trackmania player page, log into your Ubisoft account, click "servers" and create a new server account.
You will need the login and password for the server, so note them down.

Then, clone the repository for EvoSC# using git clone <repository link>

In the newly created directory, edit the docker-compose.yml file.
You will need to replace the MASTER_LOGIN and MASTER_PASSWORD lines with the server username and password you noted earlier.

If you are planning to open this server to the internet, you may want to change the MariaDB user info, but by default your server should be limited to your local network.

Boot up the Trackmania server using docker-compose up. If you want to have the server running in the background, you can add the -d argument.

Your server should be up and running! You can connect to it in Trackmania in the local section of the play menu.

Booting up EvoSC#

Go to the EvoSC directory, and run dotnet run. This will compile the source code and run the Application. If you want to build without running use dotnet build instead. You will need to do that every time before starting EvoSC if you modified the code, else the changes won't apply.

If you are using the default docker-compose setup in the EvoSC# repo readme, you should be good to go and EvoSC# should be up and running! EvoSC# is now up and running! Test it by connecting to the server: if there is a message with your login in the chat when connecting, everything should work.

If you get any errors or using another docker-compose file you may need to edit the main.toml file in EvoSC/config/main.toml to fit your needs or check the terminal for errors.

Made with ❤️ by EvoSC# Devs

+ \ No newline at end of file diff --git a/development/core/index.html b/development/core/index.html index 84667f0a1..8c080955b 100644 --- a/development/core/index.html +++ b/development/core/index.html @@ -11,12 +11,12 @@ - + -
Skip to content
On this page

About EvoSC#

EvoSC# (spoken: EvoSC Sharp) is a server controller for Trackmania 2020 dedicated servers. It has been written from the ground up in C# / .NET 6.0 to be modular, performant and easy to use. It is currently still in development, so expect braking changes to happen at any time.


This documentation is still being worked on, so please be patient while we fill in all the information.

Made with ❤️ by EvoSC# Devs

- +
Skip to content
On this page

About EvoSC#

EvoSC# (spoken: EvoSC Sharp) is a server controller for Trackmania 2020 dedicated servers. It has been written from the ground up in C# / .NET 8 to be modular, performant and easy to use. It is currently still in development, so expect breaking changes to happen at any time.


This documentation is still being worked on, so please be patient while we fill in all the information.

Made with ❤️ by EvoSC# Devs

+ \ No newline at end of file diff --git a/development/core/internal-modules.html b/development/core/internal-modules.html index 7fb337d67..68f336304 100644 --- a/development/core/internal-modules.html +++ b/development/core/internal-modules.html @@ -48,7 +48,7 @@ typeof(PlayerModule), // ... other modules };

Begin developing

If you have done all the steps explained on this page correctly, you should now be able to begin developing your internal module!

Again, for more information on developing modules, head over to the Module Documentation.

- + \ No newline at end of file diff --git a/development/core/project-overview.html b/development/core/project-overview.html index 141f0a88b..07c4a64a9 100644 --- a/development/core/project-overview.html +++ b/development/core/project-overview.html @@ -16,7 +16,7 @@
Skip to content
On this page

Overview of the Project

Project Structure

The project is separated into two main parts. The source code and the tests.

Main Source Code

The source code in src are structured into multiple projects that provides a set of functionalities. Each of the projects have a set of rules on which other projects can reference them.

ProjectDescriptionReferenceability
EvoSC.CommonCore functionality and common code.All other projects can reference this, but it cannot reference any other project.
EvoSC.CLIProvides code for the commandline interface.Only EvoSC can reference this project.
EvoSC.ModulesMain code that provides the module framework for the project.Can only be referenced by modules and EvoSC.
EvoSC.CommandsMain code that provides chat command parsing and handling.Can be referenced by modules, EvoSC.Modules and EvoSC
EvoSC.EvoSCThis is the EvoSC application itself as a console project.Cannot be referenced by any projects.

Reference Graph

The graph visualizes how projects can be referenced from eachother: Reference Graph

Internal Modules

There is an additional directory under src that isnt exactly a project directory in itself called Modules. But it contains multiple projects that form all the internal and core modules of EvoSC. These modules are referenced within the assembly of the main application itself and ship with it.

Tests

Each of the sub projects in EvoSC has corresponding test projects under the tests directory found in the root of the project. The tests provides unit and integration tests for the general functionality of the code.

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/action-pipelines/chat-router.html b/development/modules/action-pipelines/chat-router.html index 4a722b0bf..474c7e4cd 100644 --- a/development/modules/action-pipelines/chat-router.html +++ b/development/modules/action-pipelines/chat-router.html @@ -32,7 +32,7 @@ return _next(context); } }

The process for creating a component for the chat router is exactly the same as controller actions, except for the pipeline type we use PipelineType.ChatRouter instead.

In the ExecuteAsync method, we pass a ChatRouterPipelineContext, which contains information about the chat message. In this case, we replace a curse word with it's censored version so that fuck is displayed as f**k in the chat.

- + \ No newline at end of file diff --git a/development/modules/action-pipelines/introduction.html b/development/modules/action-pipelines/introduction.html index caf5975a1..3068bae04 100644 --- a/development/modules/action-pipelines/introduction.html +++ b/development/modules/action-pipelines/introduction.html @@ -16,7 +16,7 @@
Skip to content
On this page

Introduction to Action Pipelines

When an action occurs within the module, a series of tasks need to be executed and configured before the action's callback handler is invoked. This sequence of tasks is commonly referred to as an Action Pipeline. Essentially, an Action Pipeline is a collection of code components that run synchronously and have the ability to manipulate preceding actions or even terminate the entire process.

In EvoSC#, developers can leverage the extensibility of modules to hook into these pipelines. Action Pipelines provide a robust mechanism for controlling the module's behavior and enabling the inclusion of supplementary data in action handlers. They can be employed to perform various operations such as filtering chat messages, performing permission checks automatically, preprocessing data for all actions, and more.

Currently, there are two types of Action Pipelines available in EvoSC#: the ControllerAction pipeline and the ChatRouter pipeline.

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/action-pipelines/middlewares.html b/development/modules/action-pipelines/middlewares.html index 2ce35a8b9..45fe87c58 100644 --- a/development/modules/action-pipelines/middlewares.html +++ b/development/modules/action-pipelines/middlewares.html @@ -39,7 +39,7 @@ return _next(context); } }

Middlewares requires a certain signature to work. The first argument in the constructor must be a delegate to the next component. The next arguments works just like normal dependency injection. Next the method ExecuteAsync must be defined, and the argument for this method must be a class or interface that inherits IPipelineContext. EvoSC# will complain if these middleware classes are not set up correctly.

The Middleware attribute must be used to register the middleware and specify which pipeline the middleware is added to, using the For argument.

All controller contexts implements the IPipelineContext interface, and it is therefore possible to cast to these in order to obtain the context data. We take advantage of this here by checking if the controller action is a command, and if so log it.

We then have a very important step. Because in order for the pipeline to continue, we must call the next component in the pipeline ourselves. This is provided by an ActionDelegate in the constructor of the middleware.

If we wish to not continue the pipeline, we would simply omit calling the _next delegate. This will also prevent the action handler from being called entirely.

- + \ No newline at end of file diff --git a/development/modules/advanced/localization.html b/development/modules/advanced/localization.html index 6026725b9..f3bc43724 100644 --- a/development/modules/advanced/localization.html +++ b/development/modules/advanced/localization.html @@ -86,7 +86,7 @@ _locale = locale; } }

Referencing without Arguments

We can now access our locale like this if we don't have any arguments to pass:

csharp
var myString = _locale["MyLocaleName"];

Referencing with Arguments

If we have arguments, simply add arguments to the indexer:

csharp
var myString = _locale["MyLocaleName", arg1, arg2, ...];

Adding Multilingual Support

The process for adding languages is almost the same as creating the default localization file. But the difference is that you specify the define language as the file extension.

For example for German, the file would be called Localization.de.resx, French would be Localization.fr.resx and so on. You can find all the codes for each language here.

Configuring the Default Language

To configure the default language, you can find an option under the [Locale] section of the main.toml config file called defaultLanguage. The format of this value is the same language code as explained above under Adding Multilingual Support.

Player Specific Language

EvoSC# can adapt the output language depending on a player's selected language. To do this, prefix the locale reference with .PlayerLanguage.

For example:

csharp
var myString = _locale.PlayerLanguage.MyLocaleName;

or

csharp
var myString = _locale.PlayerLanguage["MyLocaleName"];

Whenever you prefix with .PlayerLanguage, it puts the locale instance in the state that any reference from this point on will use the player's selected language.

You can get a player's selected language from the Settings property from an IPlayer instance.

Arbitrary String Translations

It is possible to translate a string which contains localization references, and replace those references with the localization string. This is useful for refering to locales in compile-time constants such as command descriptions.

To reference a localization string, put the name in between two square brackets. For example: [MyLocaleName]

These can occur anywhere within a string, and you can put multiple of them. For example: My locale: [MyLocaleName]

To translate a string you can use the Translate method. For example:

csharp
var translatedString = _locale.Translate("My locale: [MyLocaleName]");
- + \ No newline at end of file diff --git a/development/modules/advanced/migrations.html b/development/modules/advanced/migrations.html index ea10a1203..66abc246b 100644 --- a/development/modules/advanced/migrations.html +++ b/development/modules/advanced/migrations.html @@ -28,7 +28,7 @@ Delete.Table("MyTable"); } }

The important part here is the naming convention. For the Migration attribute, we want to use the UNIX Timestamp in seconds as the version. The name of the file should be YYYYMMDDHHmm_MigrationName, where YY is the 4-digit year, MM is the 2-digit month, D is the 2-digit day of the month, HH is the 2-digit hour and mm is the 2-digit minute.

The time and date for the version and file name must be set to creation time of the migration.

- + \ No newline at end of file diff --git a/development/modules/advanced/services.html b/development/modules/advanced/services.html index 8055abc77..b9146d55a 100644 --- a/development/modules/advanced/services.html +++ b/development/modules/advanced/services.html @@ -63,7 +63,7 @@ return Task.CompletedTask; } }

The interface exposes two methods, StartAsync and StopAsync. They are pretty self explainatory, but StartAsync is automatically called when the module is enabled, and StopAsync is called when the module is disabled. This allows you to both start and stop any background service that might be running for a module.

WARNING

If you wish to interact with the background service, do not try to inject this service. Instead, create a singleton service, that the background service controls with the Start/Stop methods. You can then interact with the background service anywhere by injecting this new singleton service.

Keep in mind that you will need to make sure the singleton service is thread safe.

- + \ No newline at end of file diff --git a/development/modules/coding-guidelines.html b/development/modules/coding-guidelines.html index 8d12da6c4..89d4cb0e0 100644 --- a/development/modules/coding-guidelines.html +++ b/development/modules/coding-guidelines.html @@ -38,7 +38,7 @@ // Abstract the kick logic out of the controller and in a service _players.KickAsync(player); }

Services

Services should follow the Single Responsibility Principle. If a service becomes huge with lots of dependencies, it is usually a sign that you might want to split it up.

Use the appropriate lifestyle for a service. Always use Transient if state or context is not needed.

Unit Tests

As much of the code as possible within a module should also be covered by unit tests. We recommend using Moq 4 to mock objects for tests.

Avoid re-inventing the wheel

The module framework and core already does a lot of things for you, and the chances are that you don't have to re-create a common function. For example, there are dedicated services and helpers for editing Match Settings or building formatted chat messages. Another example could be showing Manialinks to newly connected players is as simple as sending a persistent Manialink. Even sending chat messages are simplified.

Have a look around in the documentation and available classes to see what is possible!

Events

It is recommended to fire events for actions or events that occur within a module, so that depending modules have a way to communicate.

Identifiers

When creating names for things such as events, permissions or anything that require some kind of "identifier" that are used to reference the certain object or action. It is recommended to avoid using string literals.

Most of these functions have support for Enum Identifier, so use this instead as much as possible. This is much more maintainable and less prone for error.

Localization

Localization should be used whenever possible to provide a consistent UX for players. It also makes it much easier to maintain and translate UI text.

Naming Conventions

Auditing

Whenever a protected or sensitive action occurs, always create an audit record.

- + \ No newline at end of file diff --git a/development/modules/controllers/chat-commands.html b/development/modules/controllers/chat-commands.html index 80c4e28a5..17bfe69e0 100644 --- a/development/modules/controllers/chat-commands.html +++ b/development/modules/controllers/chat-commands.html @@ -52,7 +52,7 @@ [CommandAlias("---", 0)] public async Task RateMapAsync(uint rating) => _server.SuccessMessageAsync($"You gave the rating: {rating}", Context.Player); }

We can use the CommandAlias attribute to define attributes for a given command on the same handler method. The way this works is that you can give aliases a set of pre-defined arguments that are automatically sent to the command. In this case, we create a set of pre-set ratings for each of the aliases. In the case where not all arguments are set within an alias, the user will have to send in the remaining arguments for the command.

Aliases does not care about command prefixes, so what you write is what you get. EvoSC# looks for the exact match of an alias, so you can have literally anything as an alias, any character or even entire sentences!

Hiding typed aliases

By default, when a player types a command alias, it is also shown in the chat that they typed it. You can prevent this, and make it act like a normal command by setting the hide parameter to true.

For example:

csharp
[CommandAlias("my-alias", false)]

In this case, when a player types my-alias in the chat, the chat message will not show up in the chat.

- + \ No newline at end of file diff --git a/development/modules/controllers/events.html b/development/modules/controllers/events.html index 68ec78592..f87cbb2eb 100644 --- a/development/modules/controllers/events.html +++ b/development/modules/controllers/events.html @@ -39,7 +39,7 @@ await _remote.InfoMessageAsync($"Player {player.NickName} joined the server!"); } }

And that's it! No need to inject the event manager service and much easier than using the Subscribe method directly.

TIP

We recommend using Controllers to subscribe to events as much as possible, as it is not only easier, but also more organized, readable and maintainable.

Event Priority

From the examples, you have gotten a taste of how priorities work. There are three levels of priority, low, medium and high. If priority is not set, the default priority is medium.

Subscriptions with higher priority will be called first.

INFO

By design, you cannot define your own priority values as this typically causes a mess when modules are fighting for priority.

Be wary and rational when using priorities. Most of the time default is good enough.

Async Subscriptions

By default, subscriptions are called in-order of their registration and priority. However, sometimes your event may take alot of computation time, which may block other events from firing.

You can then define your subscription as async. This prevents other events having to wait for your event to finish processing.

Raising Events

To create and fire a new event, which is called "raising an event" in EvoSC#, we can use the RaiseAsync method from the IEventManager service.

It takes the name and arguments of the event to raise. You can also specify the sender if that is required.

For example:

csharp
await eventManager.RaiseAsync(GbxRemoteEvent.PlayerConnect, new PlayerConnectGbxEventArgs { /* ... */});
- + \ No newline at end of file diff --git a/development/modules/controllers/introduction.html b/development/modules/controllers/introduction.html index c0daf09ef..1363e8e0b 100644 --- a/development/modules/controllers/introduction.html +++ b/development/modules/controllers/introduction.html @@ -21,7 +21,7 @@ }

This is the most basic controller definition and it does nothing as you didn't specify any action to respond to. So this brings us to the next point.

Controller Actions

An action refers to any type of event in the application. Whether it is from the event system, a chat command or a manialink action, it can all be handled through a controller.

Whenever an action occurs that a controller is subscribed to, the controller is instantiated for that particular action. Each action has a context attached to it.

The context contains information related to the action that occured. So for example, if a player triggered a chat command, the context holds information like what player triggered it, information about the command itself etc.

The context is highly dependent on the type of action that occured. This is important because you typically want to define your controller for one type of action only.

You will most likely never need to subscribe to multiple types of actions within the same controller. Currently, there are two types of actions:

ActionDescriptionContext
EventRaised by the event system and can be any generic event.IControllerContext
Chat CommandThe command system triggers these actions and occurs when a player calls a valid command.CommandInteractionContext

Controller Action Context

When you inherit the EvoScController base type, you must specify the type of context for your actions.

For example:

csharp
// IControllerContext context type, can be used for all actions
 EvoScController<IControllerContext>
csharp
// CommandInteractionContext context type, can be used for chat commands
 EvoScController<CommandInteractionContext>

All contextes will inherit the base type IControllerContext and you can use this type for any action type.

But the problem with IControllerContext is that it contains a very limited amount of information about the action that occured. Because events do not really have any context assigned to them, they are simply events with some arguments, you can use IControllerContext when subscribing to pure events.

WARNING

The most important thing to be aware of when specifying the context type is, if you have an action that is not supported by the context, the application will throw an error as it fails to cast the context to your specified context type.

Make sure you use the correct context type for the actions in your controller!

Subscribing to Actions

How this is done depends on the type of action and each requires their own page to explain it. We recommend you begin looking into how to subscribe to events.

- + \ No newline at end of file diff --git a/development/modules/controllers/manialink-actions.html b/development/modules/controllers/manialink-actions.html index 169e85d62..bb6029c64 100644 --- a/development/modules/controllers/manialink-actions.html +++ b/development/modules/controllers/manialink-actions.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/index.html b/development/modules/index.html index f77454f63..4d6fb49b2 100644 --- a/development/modules/index.html +++ b/development/modules/index.html @@ -16,7 +16,7 @@
Skip to content
On this page

Introduction to the EvoSC# Module Framework

EvoSC# is designed as a modular framework with individual modules responsible for a set of features. The core provides this framework and a library of tools and utilities for developing functionality and logic. The modules provides the actual functionality of the controller and controls the logic.

The framework itself provides a set of coding rules and patterns for developers to implement their desired functionality into the controller.

It is built around controllers which holds most of the logic. Controllers respond to actions and events, which are handled and responded to if desired.

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/actions.html b/development/modules/manialinks/actions.html index b5f1db853..fa27619f9 100644 --- a/development/modules/manialinks/actions.html +++ b/development/modules/manialinks/actions.html @@ -21,7 +21,7 @@ </frame>

In this example, when we call the action route/to/action. The entry value will be sent along with the action in a key-value relationship. In this case the name of the entry is nickname.

The TriggerPageAction function

In ManiaScript it is also possible to trigger page actions with the TriggerPageAction function. So you can call routes like:

main() {
     TriggerPageAction("route/to/action");
 }
- + \ No newline at end of file diff --git a/development/modules/manialinks/components/alert.html b/development/modules/manialinks/components/alert.html index 3fac1cb10..f0932536a 100644 --- a/development/modules/manialinks/components/alert.html +++ b/development/modules/manialinks/components/alert.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/button.html b/development/modules/manialinks/components/button.html index c7b942309..dfe1de31c 100644 --- a/development/modules/manialinks/components/button.html +++ b/development/modules/manialinks/components/button.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/checkbox.html b/development/modules/manialinks/components/checkbox.html index f8f32c122..0b09ae72c 100644 --- a/development/modules/manialinks/components/checkbox.html +++ b/development/modules/manialinks/components/checkbox.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/chip.html b/development/modules/manialinks/components/chip.html index 110319508..6761e21b1 100644 --- a/development/modules/manialinks/components/chip.html +++ b/development/modules/manialinks/components/chip.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/circle.html b/development/modules/manialinks/components/circle.html index 649b0013d..3ba86d7b6 100644 --- a/development/modules/manialinks/components/circle.html +++ b/development/modules/manialinks/components/circle.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/container.html b/development/modules/manialinks/components/container.html index f23aa2edc..f89b63d87 100644 --- a/development/modules/manialinks/components/container.html +++ b/development/modules/manialinks/components/container.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/dropdown.html b/development/modules/manialinks/components/dropdown.html index 7b67f2af7..64617ec07 100644 --- a/development/modules/manialinks/components/dropdown.html +++ b/development/modules/manialinks/components/dropdown.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/iconbutton.html b/development/modules/manialinks/components/iconbutton.html index 37a4a8657..735a07faa 100644 --- a/development/modules/manialinks/components/iconbutton.html +++ b/development/modules/manialinks/components/iconbutton.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/linkbutton.html b/development/modules/manialinks/components/linkbutton.html index 7a8c76ed5..fff425f42 100644 --- a/development/modules/manialinks/components/linkbutton.html +++ b/development/modules/manialinks/components/linkbutton.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/panel.html b/development/modules/manialinks/components/panel.html index fc218e14c..a458859e9 100644 --- a/development/modules/manialinks/components/panel.html +++ b/development/modules/manialinks/components/panel.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/quartercircle.html b/development/modules/manialinks/components/quartercircle.html index 6044f17ee..c879ffe92 100644 --- a/development/modules/manialinks/components/quartercircle.html +++ b/development/modules/manialinks/components/quartercircle.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/radiobutton.html b/development/modules/manialinks/components/radiobutton.html index f48e2b0cd..085fbcf2b 100644 --- a/development/modules/manialinks/components/radiobutton.html +++ b/development/modules/manialinks/components/radiobutton.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/rating.html b/development/modules/manialinks/components/rating.html index 7ada5da81..f442a83f4 100644 --- a/development/modules/manialinks/components/rating.html +++ b/development/modules/manialinks/components/rating.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/rectangle.html b/development/modules/manialinks/components/rectangle.html index ee0b74c9a..d8d191fde 100644 --- a/development/modules/manialinks/components/rectangle.html +++ b/development/modules/manialinks/components/rectangle.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/scrollbar.html b/development/modules/manialinks/components/scrollbar.html index 453fbe934..6c0e6b3d9 100644 --- a/development/modules/manialinks/components/scrollbar.html +++ b/development/modules/manialinks/components/scrollbar.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/separator.html b/development/modules/manialinks/components/separator.html index 295c22252..21b1d484b 100644 --- a/development/modules/manialinks/components/separator.html +++ b/development/modules/manialinks/components/separator.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/switch.html b/development/modules/manialinks/components/switch.html index 4278e7a74..b5b3dcfd1 100644 --- a/development/modules/manialinks/components/switch.html +++ b/development/modules/manialinks/components/switch.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/tag.html b/development/modules/manialinks/components/tag.html index 1390344ae..c2c1f5a35 100644 --- a/development/modules/manialinks/components/tag.html +++ b/development/modules/manialinks/components/tag.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/text.html b/development/modules/manialinks/components/text.html index af71b2243..7739db46b 100644 --- a/development/modules/manialinks/components/text.html +++ b/development/modules/manialinks/components/text.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/textinput.html b/development/modules/manialinks/components/textinput.html index 6c3c06811..7e32e9ddc 100644 --- a/development/modules/manialinks/components/textinput.html +++ b/development/modules/manialinks/components/textinput.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/widget.html b/development/modules/manialinks/components/widget.html index b769def60..74e28ece8 100644 --- a/development/modules/manialinks/components/widget.html +++ b/development/modules/manialinks/components/widget.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/components/window.html b/development/modules/manialinks/components/window.html index 3b8144c6a..707d30589 100644 --- a/development/modules/manialinks/components/window.html +++ b/development/modules/manialinks/components/window.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/controllers.html b/development/modules/manialinks/controllers.html index 222ba56ed..84dfffe91 100644 --- a/development/modules/manialinks/controllers.html +++ b/development/modules/manialinks/controllers.html @@ -93,7 +93,7 @@ return HideAsync(Context.Player, "MyModule.MyManialink"); } } - + \ No newline at end of file diff --git a/development/modules/manialinks/form-validation.html b/development/modules/manialinks/form-validation.html index 3aed4f709..a3d08496c 100644 --- a/development/modules/manialinks/form-validation.html +++ b/development/modules/manialinks/form-validation.html @@ -141,7 +141,7 @@ } } } - + \ No newline at end of file diff --git a/development/modules/manialinks/introduction.html b/development/modules/manialinks/introduction.html index c11f157b0..8a446c563 100644 --- a/development/modules/manialinks/introduction.html +++ b/development/modules/manialinks/introduction.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/manialinks/maniascript.html b/development/modules/manialinks/maniascript.html index 1c20df368..d7ce74977 100644 --- a/development/modules/manialinks/maniascript.html +++ b/development/modules/manialinks/maniascript.html @@ -20,7 +20,7 @@ }

We can now import this script into our template:

xml
<template>
     <script resource="MyModule.Scripts.PrintConsole" main="true" />
 </template>

Displaying this manialink in-game will log Hello there! to the script console.

One thing to note here is that we specify main="true" because this ManiaScript file contains the main function. If you want to include ManiaScript code that has functions, variables or structs to be used, but doesn't have a main function, you can omit this attribute.

- + \ No newline at end of file diff --git a/development/modules/manialinks/permissions.html b/development/modules/manialinks/permissions.html index 8194ef2c7..197874ca9 100644 --- a/development/modules/manialinks/permissions.html +++ b/development/modules/manialinks/permissions.html @@ -24,7 +24,7 @@ // ... } }

When you call AdminActions/KickPlayer/somePlayer, EvoSC will check if the the user that called it, has permission to execute this action. If so, the method will be executed, otherwise a message will be shown to the user that they don't have sufficient permissions.

- + \ No newline at end of file diff --git a/development/modules/manialinks/templates.html b/development/modules/manialinks/templates.html index 6380ba883..ad576f85b 100644 --- a/development/modules/manialinks/templates.html +++ b/development/modules/manialinks/templates.html @@ -57,7 +57,7 @@ { await _manialinks.HideManialinkAsync(Context.Player, "MyModule.HelloPlayer"); }

Sending /hide in the in-game chat will remove the shown text.

Because there doesn't exist a XMLRPC call to hide manialinks for specific players, we will need to do a trick instead. The way it works is that we display a new manialink, which has the same ID of the manialink we want to hide. But this manialink is empty and contains no UI elements or code. This will replace the manialink with the same ID, effectively hide it.

One problem with this is that the manialink still exists in the player's memory. To resolve this, we make use of the auto hide functionality of manialinks. The empty manialink is therefore automatically deleted and removed from memory after 3 seconds.

- + \ No newline at end of file diff --git a/development/modules/module-class.html b/development/modules/module-class.html index bc58ec011..e0b2ecc0b 100644 --- a/development/modules/module-class.html +++ b/development/modules/module-class.html @@ -50,7 +50,7 @@ // uninstall, remove and clean up any changes } }

Module Loading Process

Understanding the way modules are loaded and and the order in which the special module events are triggered can be useful.

On start up, the application looks for assemblies with a class that annotates the [Module] attribute. If this attribute is found, it checks if the class inherits EvoScModule.

If these two conditions are met, the application will look for any dependencies defined by the module. If there are any dependencies, these are loaded first.

Before the module class itself is loaded, the applicaiton looks for any framework defined entities, for example controllers, settings, permissions, middlewares, database migrations etc.

The module class is then loaded, which means the class itself is instantiated and the constructor called.

After the module is loaded, it is then installed. This sets up things like permissions or database migrations.

If installation is successful, the module is enabled. When a module is enabled, it adds things like controllers, middlewares, events, chat commands, module services etc. All of these things should be enabled automatically.

- + \ No newline at end of file diff --git a/development/modules/security/auditing.html b/development/modules/security/auditing.html index 6445e2e8b..7419e7d9e 100644 --- a/development/modules/security/auditing.html +++ b/development/modules/security/auditing.html @@ -56,7 +56,7 @@ .Comment("Player was kicked."); } }

The Audit Service

The Audit Service IAuditService is what controls all creation and handling of audit events. It exposes several methods for creating a new events such as NewEvent, NewSuccessEvent, NewErrorEvent and NewInfoEvent. All of these methods returns an AuditEventBuilder that can be used to create a new audit record.

When using this service, audit records are not automatically created. But one can trigger the creation by calling the LogAsync method on the AuditEventBuilder instance.

The Audit Event Builder

The AuditEventBuilder is the main class for creating an new audit record. Here we will go over the different methods and what they can be used for.

The Constructor

The constructor always requires an instance of the IAuditService, which is used to create the actual record. You can also provide a name of the event. Most of the time, you will not need to instantiate the AuditEventBuilder yourself, but instead get an instance to work with.

WithStatus

The WithStatus method is used to set the status of the event. You can also set the status with the helper methods Success(), Info() and Error().

WithEventName

The WithEventName method sets the unique name for the event. It should be alphanumeric and in PascalCase. A dot . can be used to group certain events together. The method also supports EnumIdentifier for strongly typed audit events.

HavingProperties

HavingProperties is used to set additional details about an event. It accepts any kind of data, which is serialized into JSON when stored, so make sure your data is JSON serializable.

WARNING

When using HavingProperties, make sure the data you set can be serialized into JSON.

CausedBy

CausedBy is used to set who actually did or triggered the event. This is very useful for moderation or admin actions, and allows you to see exactly who did what on the server.

Comment

You can set a user-friendly description for an event with the Comment method. It is recommended to keep this comment as short as possible.

Cancel and UnCancel

If you, for some reason during an action, it is decided that one no longer need to create an audit record. You can call the Cancel method to not record the audit. The UnCancel method will allow the audit system to create the record again.

- + \ No newline at end of file diff --git a/development/modules/security/permissions.html b/development/modules/security/permissions.html index cc2c1b9b4..e402f51be 100644 --- a/development/modules/security/permissions.html +++ b/development/modules/security/permissions.html @@ -30,7 +30,7 @@ { // has permission to kick a player } - + \ No newline at end of file diff --git a/development/modules/settings.html b/development/modules/settings.html index 765ecd8e6..c66ae7a80 100644 --- a/development/modules/settings.html +++ b/development/modules/settings.html @@ -40,7 +40,7 @@ Console.Log(mySettings.MyOption); } }

Modifying Option Values

The configuration system uses a set of tricks to hook into the setter and getter methods of the object properties. This allows us to abstract away all loading and saving logic from the developer.

When an option's value is requested, the application first check the value cache and if there is a cache miss, the value is retrieved from the database.

So when you set an option's value, the value is then automatically saved into the database. This means that all you need to do to save the value of an option is to simply set the property and you're done!

Example:

csharp
mySettings.MyOption = "my new value";
Details

Reference Graph

- + \ No newline at end of file diff --git a/development/modules/themes/base-options.html b/development/modules/themes/base-options.html index 47b57bd2b..6c3974092 100644 --- a/development/modules/themes/base-options.html +++ b/development/modules/themes/base-options.html @@ -16,7 +16,7 @@
Skip to content
On this page

Base Theme Options

Here you can get an overview of all the options and utility colors from the base theme. Every other theme should be created based on the base theme in order to keep a consistent style throughout the UI.

These options are defined in the class EvoScBaseTheme in EvoSC.Common.Themes.

Default Chat Colors

NameDefault ValueDescription
Chat.PrimaryFFFThe default text color in the chat.
Chat.SecondaryEEESecondary color in the chat for highlighting purposes.
Chat.Info29BColor used for info messages.
Chat.DangerC44Color used for danger/error/fail messages.
Chat.WarningE83Color used for messages conveying a warning.
Chat.Success5B6Color used for messages indicating a success.

Default Theme Options

NameDefault ValueDescription
UI.FontGameFontExtraBoldThe default font used in the UI.
UI.FontSize1The default font size.
UI.TextPrimaryFFFFFFPrimary text color in the UI.
UI.TextSecondaryEDEDEFHighlight or secondary text color.
UI.BgPrimaryFF0058Primary background color.
UI.BgSecondary47495AHighlight or secondary background color.
UI.BorderPrimaryFF0058Primary color of borders and lines.
UI.BorderSecondaryFFFFFFSecondary color of borders and lines.
UI.LogoDarkDark version of an image shown in the UI.
UI.LogoLightLight version of an image shown in the UI.

Status Utility Colors

NameDefault ValueDescription
Info29BStatus colors indicating an informational message.
SuccessC44Status color indicating success.
WarningE83Status color indicating a warning or notice.
Danger5B6Status color indicating an error/danger/notice/fail.

Other Utility Colors

NameDefault ValueDescription
RedE22000Default red color.
Green00D909Default green color.
Blue3491FADefault blue color.
YellowFCE100Default yellow color.
Teal0FC6C2Default teal color.
Purple722ED1Default purple color.
GoldFFD000Default gold color.
Silver9e9e9eDefault silver color.
Bronze915d29Default bronze color.
Grass9FDB1DDefault grass color.
OrangeF77234Default orange color.
Gray191A21Default gray color.
PinkFF0058Default pink color.
Black000000Default black color.
WhiteFF0058Default white color.

In addition to these, all the colors except black and white have auto-generated shades of them ranging from 10% to 90% luma in increments of 10. The names are postfixed with the lightness. So for example Red10, Red20, Red30 etc.

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/themes/creating-themes.html b/development/modules/themes/creating-themes.html index e60be164a..f5eb6c2e2 100644 --- a/development/modules/themes/creating-themes.html +++ b/development/modules/themes/creating-themes.html @@ -65,7 +65,7 @@ Set("UI.Button.Default.Bg").To("0000FF"); // set button background to blue } }

This shows another feature of the Theme Framework. We can inherit other themes. This is very useful if you just want to replace certain options, and not having to re-define every single option the original theme provides.

Overriding the Base Theme

The base EvoSC# theme resides in the class BaseEvoScTheme from EvoSC.Common.Themes. This is where all the base options, as well as utility colors, default font and size are defined. If you wish to create a module that changes the overall theme of the controller, the best way to do this is to override this theme using the technique explained above.

- + \ No newline at end of file diff --git a/development/modules/themes/introduction.html b/development/modules/themes/introduction.html index b657f9ae7..50f9d872b 100644 --- a/development/modules/themes/introduction.html +++ b/development/modules/themes/introduction.html @@ -16,7 +16,7 @@
Skip to content
On this page

Themes

Theming is a concept that provides consistent style and colors throughout the UI. One can switch between different themes to get a different look and feel of the UI. EvoSC# implements a framework for creating themes and overriding default theme options.

Every module can implement their own default theme for their Manialinks, or override other default themes. This allows us to create a module that is purely made to be a theme.

Types of theme implementations

There are two things a theme can implement, theme options and component replacements.

Theme Options

Theme options are arbitrary values that can be assigned to a key. These values can be used throughout anywhere in the module, and are always available in Manialinks as global variables.

Component Replacements

It is also possible to replace an entire component from a theme. This is a very powerful system that can be used to not only change the look of a component, but also the behavior.

One should, however, be careful with how one replaces a component as it may break the other parts of the UI.

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/themes/usage.html b/development/modules/themes/usage.html index e51301c2c..d2107b750 100644 --- a/development/modules/themes/usage.html +++ b/development/modules/themes/usage.html @@ -18,7 +18,7 @@
Skip to content
On this page

Using the Theme Framework

Accessing Theme Options

There are two main ways to access the options of a theme. Most often, you will only really need the theme options within a Manialink and the current Theme is available as a global variable inside the Manialink template.

But if you need access to the theme options outside of Manialinks, the current theme option is also available through Dependency Injection.

The Current Theme Object

The Current Theme Object contains all available options set by the current activated themes. It is a dynamic object and one can access the options by it's key name and replacing . with _.

For example, let's say we have a theme option called MyModule.MyManialink.MyThemeOption, to access the value of this option, you can retrieve it from the Current Theme Object like this:

cs
var optionValue = Theme.MyModule_MyManialink_MyThemeOption;
 // .. do something with it

Accessing the Current Theme Object from a Manialink is quite simple. There is no set up required as it is available as a global variable.

So for example, if you want to set the color of a label, you can do something like this:

xml
<label text="Hello!" textcolor="{{ Theme.HelloLabel.TextColor }}" />

Customizing the Theme

EvoSC# provides two ways to customizing the theme, from a user or developer perspective. For developers creating new custom themes, we recommend to check out the section on Creating Themes.

For users, let's talk about the config file.

Using the Config File

The Theme Framework is designed in such a way that any Theme Options defined in the main config file, will always override whatever value is set from the Theme objects. This means that users have full control over the theme if they wish to customize it, without having to create a completely new module.

In the main.toml config file, one can define Theme options under the [Theme] section. So let's say, we want to set a custom primary background color for the UI. We can do the following in the config file:

toml
[Theme]
 UI.BgPrimary = "ff0058"

The UI.BgPrimary is part of the base options in EvoSC#, which are explained in more-depth here.

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/utility/enum-identifier.html b/development/modules/utility/enum-identifier.html index 3eb462700..bffcf5abf 100644 --- a/development/modules/utility/enum-identifier.html +++ b/development/modules/utility/enum-identifier.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/utility/matchsettings.html b/development/modules/utility/matchsettings.html index 77c744a80..f6193e986 100644 --- a/development/modules/utility/matchsettings.html +++ b/development/modules/utility/matchsettings.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/utility/player-utilities.html b/development/modules/utility/player-utilities.html index ec95e3b05..910b0c6f3 100644 --- a/development/modules/utility/player-utilities.html +++ b/development/modules/utility/player-utilities.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/utility/server-chat-messages.html b/development/modules/utility/server-chat-messages.html index b60df8582..5e35bedbe 100644 --- a/development/modules/utility/server-chat-messages.html +++ b/development/modules/utility/server-chat-messages.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/modules/utility/text-formatting.html b/development/modules/utility/text-formatting.html index 40c6d621f..fea356c8f 100644 --- a/development/modules/utility/text-formatting.html +++ b/development/modules/utility/text-formatting.html @@ -16,7 +16,7 @@
Skip to content
On this page

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/development/reference/index.html b/development/reference/index.html index c5e0cc6da..b31fbb94f 100644 --- a/development/reference/index.html +++ b/development/reference/index.html @@ -16,7 +16,7 @@
Skip to content
On this page

EvoSC Code Reference

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index afc45e860..87a8e0aac 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"development_modules_action-pipelines_chat-router.md":"4a0ad2a1","development_modules_manialinks_components_switch.md":"bb86b0e1","development_modules_manialinks_components_circle.md":"5cbfa194","development_modules_manialinks_components_text.md":"d9fba09d","development_modules_advanced_migrations.md":"85aae3c6","development_modules_manialinks_components_window.md":"205e8b14","development_core_project-overview.md":"ddb4397a","development_modules_manialinks_components_rectangle.md":"df38cd0f","development_modules_security_permissions.md":"0d48c960","development_modules_action-pipelines_middlewares.md":"a27a3bb6","development_modules_manialinks_controllers.md":"fc1a9918","development_modules_manialinks_form-validation.md":"1d374466","development_modules_advanced_services.md":"17931fba","development_modules_utility_enum-identifier.md":"6dab02d5","development_modules_controllers_events.md":"25d71bc1","development_modules_utility_player-utilities.md":"00e5f767","development_modules_utility_server-chat-messages.md":"c4d5279d","development_modules_index.md":"a9a3726e","development_modules_controllers_introduction.md":"a9d069c9","development_modules_utility_matchsettings.md":"98cc1442","development_modules_manialinks_components_alert.md":"fb4cad67","development_modules_manialinks_components_separator.md":"027f1171","development_modules_utility_text-formatting.md":"72f8043d","development_reference_index.md":"d951c68e","index.md":"dea3c436","using-evosc_index.md":"e317a6a3","development_modules_manialinks_components_container.md":"26c0ff2e","development_modules_controllers_chat-commands.md":"72fbc04a","development_modules_manialinks_components_dropdown.md":"00205976","development_modules_manialinks_components_linkbutton.md":"f584f414","development_modules_manialinks_components_panel.md":"40b9c8a2","development_modules_manialinks_components_quartercircle.md":"5ff59cff","development_modules_manialinks_components_iconbutton.md":"37faff5a","development_core_getting-started.md":"b61c982f","development_modules_manialinks_actions.md":"f091b04b","development_modules_manialinks_components_rating.md":"a1717f98","development_modules_security_auditing.md":"5913ba7d","development_modules_module-class.md":"ac1d990f","development_modules_manialinks_templates.md":"f337208d","development_modules_manialinks_introduction.md":"1d3c73e2","development_modules_manialinks_components_checkbox.md":"2c854fda","development_modules_manialinks_components_chip.md":"2bd44015","development_modules_settings.md":"ad2ae6c7","development_modules_manialinks_components_textinput.md":"a9217a9e","development_modules_themes_base-options.md":"fd2b564d","development_core_internal-modules.md":"15b19aed","development_modules_coding-guidelines.md":"1c01124a","development_modules_advanced_localization.md":"11c521d0","development_modules_manialinks_components_button.md":"e4dd6a65","development_modules_themes_introduction.md":"054f41c8","development_modules_manialinks_components_tag.md":"1ed0f06c","development_modules_manialinks_components_radiobutton.md":"31c6fce3","development_modules_action-pipelines_introduction.md":"c92341f3","development_modules_manialinks_maniascript.md":"549415a2","development_modules_manialinks_permissions.md":"a9b2bc66","development_modules_manialinks_components_scrollbar.md":"066bbd2d","development_modules_themes_creating-themes.md":"1ba3b2d3","development_modules_themes_usage.md":"14345a46","development_core_index.md":"9a200a43","development_modules_controllers_manialink-actions.md":"231fad44","development_modules_manialinks_components_widget.md":"c89f59c2"} +{"development_modules_manialinks_components_alert.md":"fb4cad67","development_modules_manialinks_components_button.md":"e4dd6a65","development_modules_manialinks_maniascript.md":"549415a2","development_modules_utility_enum-identifier.md":"6dab02d5","development_core_index.md":"f69adc19","development_modules_security_auditing.md":"5913ba7d","development_modules_utility_matchsettings.md":"98cc1442","development_modules_manialinks_components_text.md":"d9fba09d","development_modules_manialinks_components_tag.md":"1ed0f06c","development_modules_action-pipelines_middlewares.md":"a27a3bb6","development_modules_manialinks_components_separator.md":"027f1171","development_modules_manialinks_components_switch.md":"bb86b0e1","development_modules_security_permissions.md":"0d48c960","development_modules_utility_server-chat-messages.md":"c4d5279d","development_modules_utility_player-utilities.md":"00e5f767","development_modules_settings.md":"ad2ae6c7","development_modules_controllers_events.md":"25d71bc1","development_modules_manialinks_components_rectangle.md":"df38cd0f","development_modules_themes_base-options.md":"fd2b564d","development_modules_utility_text-formatting.md":"72f8043d","development_core_getting-started.md":"a2867fbe","development_modules_controllers_manialink-actions.md":"231fad44","development_modules_index.md":"a9a3726e","development_modules_manialinks_components_radiobutton.md":"31c6fce3","development_modules_manialinks_components_dropdown.md":"00205976","development_reference_index.md":"d951c68e","development_modules_advanced_localization.md":"11c521d0","development_modules_themes_creating-themes.md":"1ba3b2d3","development_modules_manialinks_components_container.md":"26c0ff2e","development_modules_action-pipelines_introduction.md":"c92341f3","development_modules_manialinks_introduction.md":"1d3c73e2","development_modules_themes_introduction.md":"054f41c8","development_core_internal-modules.md":"15b19aed","development_modules_advanced_migrations.md":"85aae3c6","development_modules_manialinks_components_textinput.md":"a9217a9e","development_core_project-overview.md":"ddb4397a","index.md":"dea3c436","development_modules_manialinks_components_circle.md":"5cbfa194","using-evosc_index.md":"e317a6a3","development_modules_manialinks_components_widget.md":"c89f59c2","development_modules_themes_usage.md":"14345a46","development_modules_advanced_services.md":"17931fba","development_modules_manialinks_components_chip.md":"2bd44015","development_modules_manialinks_components_rating.md":"a1717f98","development_modules_manialinks_permissions.md":"a9b2bc66","development_modules_manialinks_components_scrollbar.md":"066bbd2d","development_modules_manialinks_components_quartercircle.md":"5ff59cff","development_modules_manialinks_components_checkbox.md":"2c854fda","development_modules_controllers_chat-commands.md":"72fbc04a","development_modules_manialinks_components_iconbutton.md":"37faff5a","development_modules_controllers_introduction.md":"a9d069c9","development_modules_action-pipelines_chat-router.md":"4a0ad2a1","development_modules_manialinks_actions.md":"f091b04b","development_modules_module-class.md":"ac1d990f","development_modules_manialinks_templates.md":"f337208d","development_modules_coding-guidelines.md":"1c01124a","development_modules_manialinks_controllers.md":"fc1a9918","development_modules_manialinks_components_window.md":"205e8b14","development_modules_manialinks_form-validation.md":"1d374466","development_modules_manialinks_components_panel.md":"40b9c8a2","development_modules_manialinks_components_linkbutton.md":"f584f414"} diff --git a/index.html b/index.html index a0e84f503..333b406fb 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@
Skip to content

EvoSC# Documentation

A server controller for everyone

EvoSC# is the new iteration of the Evo server controller.

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file diff --git a/using-evosc/index.html b/using-evosc/index.html index f360d6b6d..17d2dfd8e 100644 --- a/using-evosc/index.html +++ b/using-evosc/index.html @@ -16,7 +16,7 @@
Skip to content
On this page

Documentation for Server Admins

EvoSC# is currently not yet ready to be used on servers.

Check back in the future!

Made with ❤️ by EvoSC# Devs

- + \ No newline at end of file