NEW API JSON

Status
Not open for further replies.

Komrad

Member
Member
May 14, 2017
89
4
6
30
@DreTaX
I want to help make a json API to work with json in oxide - an example

CheckCfg<bool>("Settings: Teleports", ref teleports);
CheckCfg<float>("Settings: Time Teleport", ref TimeTeleport);
SaveConfig();
}


protected override void LoadDefaultConfig(){}
private void CheckCfg<T>(string Key, ref T var){
if(Config[Key] is T)
var = (T)Config[Key];
else
Config[Key] = var;
}
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
577
612
63
Why do you all want to make Fougerite a new oxide?
 

Komrad

Member
Member
May 14, 2017
89
4
6
30
Because settings of this format look better

Code:
{
  "default": "ffsfsfsfs",
  "default1": "ghegdgf",
  "str": "20",
  "default3": "jfjjgfjjfgj",
  "default4": "gdfgdggdgd"
}
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
I think it would be just easier to convert Oxide Plugins when requested.
The code is pretty much the same, Converting Fougerite to Oxide is harder.
I really like a simple .ini
I prefer INI as well, Much easier (Personal Opinion)

@Komrad I think you can edit some of the Fougerite source and send to Dretax for approval via PM
 
  • Agree
Reactions: DreTaX

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Write your own API then? I can't write everything for you. Extend the API by writing API.
Fougerite is not focusing on C# mainly, there is no point in that. You got JSON, use It. Otherwise you can return to an ini file if needed.
 
Status
Not open for further replies.