AutoExecConfig() - List cvars by plugin code order instead of by *alphabetically?*
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- cpp
Direzione di ricerca
The issue identifies AutoExecConfig() and an example plugin's OnPluginStart(), but does not name SourceMod implementation files or tests. Start by tracing how AutoExecConfig() collects and writes cvars, then check how their ordering is determined. Done means the generated config can preserve plugin code order (or offer the requested option) without requiring numbered cvar names.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Help us help you
- I have checked that my issue doesn't exist yet.
Is your feature request related to a problem? Please describe.
Managing and changing cvars especially when there's lot of them can be overwhelming, both to users and devs, when SouceMod (SM) decides to order the cvar by it's own way 🔢 , by listing the cvars alphabetically?
Describe the solution you'd like
I hopefully want SM by default ( or by an option, e.g AutoExecConfig(true, "xxx", bool alphabetorder = false) ) listing the cvars in the config file generated to mimic the order in the plugin code, so that the beautifully listed cvars 🏩 in the plugin config file is consistent with the plugin code.
Describe alternatives you've considered
I tried something like this as a workaround, but it looks ugly and less maintainable:
public void OnPluginStart()
{
CreateConVar(PLUGIN_FILE ... "_0_version", PLUGIN_VERSION, "Whitelist Map Configuration version", FLAG_CVAR_VERSION);
g_hEnabled = CreateConVar(PLUGIN_FILE ... "_1_enabled", "1", "Toggles plugin state (0: Off, 1: On)", FLAG_CVAR, true, 0.0, true, 1.0);
g_hConfigFile = CreateConVar(PLUGIN_FILE ... "_2_config_file", "", "Config file to load, relative to the /cfg folder (Empty: Disables config loading)", FLAG_CVAR);
g_hWhitelistMap = CreateConVar(PLUGIN_FILE ... "_3_whitelist_map", "", "Whitelisted map name(s), case-insensitive, comma-separated (Empty: Apply to ALL maps)", FLAG_CVAR);
g_hLogConsole = CreateConVar(PLUGIN_FILE ... "_4_log_console", "1", "Toggles logging of config loading status in the console (0: Off, 1: On)", FLAG_CVAR, true, 0.0, true, 1.0);
AutoExecConfig(true, PLUGIN_FILE);
}
You can see I have to put numbering to force SM lists them by order I like, without them, SM could put the main cvar PLUGIN_FILE ... "_1_enabled" to the bottom, etc
Config file:
// This file was auto-generated by SourceMod (v1.12.0.7169)
// ConVars for plugin "map_config.smx"
// Toggles plugin state (0: Off, 1: On)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
map_config_1_enabled "1"
// Config file to load, relative to the /cfg folder (Empty: Disables config loading)
// -
// Default: ""
map_config_2_config_file ""
// Whitelisted map name(s), case-insensitive, comma-separated (Empty: Apply to ALL maps)
// -
// Default: ""
map_config_3_whitelist_map ""
// Toggles logging of config loading status in the console (0: Off, 1: On)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
map_config_4_log_console "1"
I'm surprised no one complain about this yet...
- Lingua principale
- C++
- Stelle
- 1.2k
- Fork
- 476
- Merge medio
- 2g 9h
- PR unite (30g)
- 13
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alliedmodders/sourcemod
-
[Bug]: RoundToNearest truncates in plugins compiled with spcomp 1.13Forse già presa @fmu1337 l’ha presa oggi. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
alliedmodders/sourcemod#2627 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
alliedmodders/sourcemod#2615 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
alliedmodders/sourcemod#2613 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
alliedmodders/sourcemod#2571 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Disable Nextmap for CSGO?ApertaFeature Request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 64/100
alliedmodders/sourcemod#2555 · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di alliedmodders/sourcemod
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
patrick-hudson/put.gd-desktop#2044 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
uxlfoundation/oneDNN#6604 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni