From c15101df02685a5d26f4b130f7b559eb7ed7f74f Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 15 Nov 2025 20:24:41 +0000 Subject: Deal with CON_HIDDEN not existing in OE Pretty hacky for now, but not the worst thing in the world. Can always be tidied up later. --- src/con_.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/con_.c') diff --git a/src/con_.c b/src/con_.c index c316318..7552816 100644 --- a/src/con_.c +++ b/src/con_.c @@ -432,7 +432,14 @@ struct con_var_common *con_getvarcommon(const struct con_var *v) { return mem_offset(v, off_cvar_common); } +static inline void fudgeflags(struct con_cmdbase *b) { + if_hot (!GAMETYPE_MATCHES(OE)) if (b->flags & CON_INIT_HIDDEN) { + b->flags = (b->flags & ~CON_INIT_HIDDEN) | _CON_NE_HIDDEN; + } +} + void con_regvar(struct con_var *v) { + fudgeflags(&v->base); struct con_var_common *c = con_getvarcommon(v); c->strval = extmalloc(c->strlen); // note: _DEF_CVAR() sets strlen member memcpy(c->strval, c->defaultval, c->strlen); @@ -440,9 +447,20 @@ void con_regvar(struct con_var *v) { } void con_regcmd(struct con_cmd *c) { + fudgeflags(&c->base); + if_hot (!GAMETYPE_MATCHES(OE)) if (c->base.flags & CON_INIT_HIDDEN) { + c->base.flags = (c->base.flags & ~CON_INIT_HIDDEN) | _CON_NE_HIDDEN; + } RegisterConCommand(coniface, c); } +void con_hide(struct con_cmdbase *b) { + if_hot (!GAMETYPE_MATCHES(OE)) b->flags |= _CON_NE_HIDDEN; +} +void con_unhide(struct con_cmdbase *b) { + if_hot (!GAMETYPE_MATCHES(OE)) b->flags &= ~_CON_NE_HIDDEN; +} + // XXX: these should use vcall/gamedata stuff as they're only used for the // setter API after everything is brought up. however that will require some // kind of windows/linux conditionals in the gamedata system! this solution is -- cgit v1.2.3-54-g00ecf