BakkesMod Programming Wiki
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Persistent Storage

Use these files in your plugin files to store persistent data with cvars but without risking the cvars being cleared

Usage

1
2
3
4
5
// preferably in onload but at least before you use it (genious advice)
persistent_storage_ = std::make_shared<PersistentStorage>(this, "Hats", true, true);

//register the cvar like "normal"
auto cvar = persistent_storage_->RegisterPersistentCvar("hats_preset", "", "The selected preset", true);

Download these files to use
PersistentStorage.h
PersistentStorage.cpp


Written by Martinn