Comments (4)
If you like you can have a look at
https://github.com/Mad-Mods-Phoenix-Point/AssortedAdjustments/blob/main/Source/AssortedAdjustments/Settings.cs
That's my first attempt to add atributes and do sth. useful with them (export current settings as md/html with descriptions, default values and a marker if the currently applied setting is the mods default(very! raw, but works well enough))
Best regards, Mad
from modnix.
For now it should be best to note the config in the mod's readme.
The main problem is that even if I preserve the comment in initial config, it would be erased when the user delete the config or reset it to default.
One of the solutions I envisioned is to use vanilla .Net Annotation to add meta data to config properties, for example min, max, and of course comments. But it is not on the immediate roadmap of the next Modnix 3 release. Code patch is welcomed ;)
from modnix.
Hi Sheepy, thx for your reply.
I'll fiddle around a bit (but all that stuff is new to me, coming from web-dev, js and such) and only started c# with Battletech in my limited free time...
You mean something like https://docs.microsoft.com/en-gb/dotnet/api/system.attribute, right?
from modnix.
For now i have sth like this:
[AttributeUsage(AttributeTargets.All)]
public class Annotation : Attribute
{
private string description;
private string defaultValue;
private bool startSection;
private bool endSection;
private string sectionLabel;
public Annotation(string description, string defaultValue, bool startSection = false, string sectionLabel = "", bool endSection = false)
{
and use it like this (Settings.cs):
[Annotation("General switch to enable the related subfeatures", "True", true, "")]
public bool EnableMissionAdjustments = true;
Didn't touch Modnix, but in a console app it's working ok (as a poc).
Just wanted to make sure that this is no deadend, what do you think?
Thx for feedback and best regards, Mad
from modnix.
Related Issues (20)
- pp-raw-recruit is not loaded HOT 2
- Retrievable Items cannot be added
- Provide data api for getting shared data, locks, and game data HOT 2
- Config panel sometimes not work
- Game is launched without waiting for config prompt
- Game version not updated after setup
- Modnix 2.3 Roadmap HOT 3
- Modnix 3 Roadmap HOT 1
- Config save failure can crash Modnix HOT 1
- Action Mod Roadmap HOT 1
- Error when loading config HOT 2
- Error when adding empty 7z HOT 2
- Fails to inject HOT 2
- I figured out how to install mods on Linux/Steam HOT 9
- Some users need to unblock Modnix to be able to see/edit Configuration HOT 12
- Stuck at Status: Busy after the latest game update (Orryx 1.10 EGS) HOT 3
- Version 1.11 broke the mod?
- Disabled: Missing requirement zy.javascript. HOT 1
- Elevation needed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modnix.