Coder Social home page Coder Social logo

mistressplague / jsonconfig Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 2.0 355 KB

The Fastest Json Config Library For Saving/Loading A Config Easily With Json, Able To Entirely Serialize Objects Back And Forth, Especially Ideal For MelonLoader Mods For Games Such As VRChat.

Home Page: https://vrcanticrash.com

License: Other

C# 100.00%
litjson json config save saving ofwmodz plague vrcanticrash melonloader vrchat

jsonconfig's Introduction

Notice:

For Use In MelonLoader Mods Or Such Where Newtonsoft.Json Is Needed To Be Used, Click Here

JsonConfig

The Fastest Json Config Library For Saving/Loading A Config Easily With Json, Able To Entirely Serialize Objects Back And Forth, Especially Ideal For MelonLoader Mods For Games Such As VRChat.

If You Use This In Your Project, Please Star This Repo So I Can Have A Look, Might Even Help You Dev It! <3

NOTE: Use Of This In Your Project Requires It Contain My Original LICENSE File, Named LICENSE_PLAGUE & Have: "JsonConfig, Licensed Under The Use-Only License" In Your README.md - You Must Also Use The Same License Or No License - Copyright Disclaimers Are To Be Preserved. - Modification Is Not Permitted. Only Use And Distribution With The Original LICENSE Intact. - Optionally You Can Not Include My Source In Your Repo And Only Include The LICENSE.

NOTE: Use Of This Requires You Add Spreads.Utf8Json To Your Project. Click Tools > NuGet Package Manager > Package Manager Console Then Type: Install-Package Spreads.Utf8Json -Version 1.0.0-build1903051941R

JsonConfig Standalone .cs File: JsonConfig.cs

Example Usage

public class ConfigTest
{
    public int Test1 = 69;
    public string Test2 = "Test Text";
    public bool Test3 = true;
    public float Test4 = 69.987f;
    public string[] Test5 = { "Test 5 1", "Test 5 2" };
}

internal static ConfigTest JsonConfig = new ConfigTest();

private void LoadConfigButton_Click(object sender, EventArgs e)
{
    var Output = JsonConfig.LoadConfig(ref JsonConfig, Environment.CurrentDirectory + "\\TestConfig.json");

    MessageBox.Show(Output.Item1 + " - " + Output.Item2);
}

private void EditAndSaveConfigButton_Click(object sender, EventArgs e)
{
    JsonConfig.Test2 = "I WAS EDITED! HOORAY!";

    var Output = JsonConfig.SaveConfig(JsonConfig, Environment.CurrentDirectory + "\\TestConfig.json");

    MessageBox.Show(Output.Item1 + " - " + Output.Item2);
}

Info:

Method Function
JsonConfig.LoadConfig(T type, string DirToConfig) Loads The Config File At The Dir Specified Then Applies All The Found Matching Values To Your Input Type (Such As A Class).
JsonConfig.SaveConfig(T type, string DirToConfig, bool Readable = true) Saves The Config File At The Dir Specified With All Of The Values Found In The Input Type (Such As Ints, Bools, Etc) - NOTE: bool Readable Specifies If You Want The Config To Be Readable By The Average User.

To-Do:

  • Make Easier To Use
  • Add Ability To Effectively Obfuscate The Config Via A Parameter (Default Is Readable)
  • Finish Documentation

jsonconfig's People

Contributors

mistressplague avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

screwable vrcmg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.