Skip to content

Commit

Permalink
Add: getConfig & setConfig option for HTML logging (Mudlet#7232)
Browse files Browse the repository at this point in the history
#### Brief overview of PR changes/additions
Adds "logInHTML" option to `getConfig(...)` and `setConfig(...)`

#### Motivation for adding to Mudlet
As requested by the Discord user **gravitas6674** in the message
https://canary.discord.com/channels/283581582550237184/283582439002210305/1242741636459663360
in our Mudlet-Development channel on 2024/05/22 at 07:31.

#### Other info (issues closed, discussion etc)
Closes Mudlet#7231.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
  • Loading branch information
SlySven authored May 22, 2024
1 parent 96e2568 commit ced5f71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/TLuaInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7253,6 +7253,10 @@ int TLuaInterpreter::setConfig(lua_State * L)
host.mBoldIsBright = getVerifiedBool(L, __func__, 2, "value");
return success();
}
if (key == qsl("logInHTML")) {
host.mIsNextLogFileInHtmlFormat = getVerifiedBool(L, __func__, 2, "value");
return success();
}
return warnArgumentValue(L, __func__, qsl("'%1' isn't a valid configuration option").arg(key));
}

Expand Down Expand Up @@ -7361,7 +7365,8 @@ int TLuaInterpreter::getConfig(lua_State *L)
lua_pushstring(L, "asis");
}
} },
{ qsl("boldIsBright"), [&](){ lua_pushboolean(L, host.mBoldIsBright); } } //, <- not needed until another one is added
{ qsl("boldIsBright"), [&](){ lua_pushboolean(L, host.mBoldIsBright); } },
{ qsl("logInHTML"), [&](){ lua_pushboolean(L, host.mIsNextLogFileInHtmlFormat); } } //, <- not needed until another one is added
};

auto it = configMap.find(key);
Expand Down
1 change: 1 addition & 0 deletions src/mudlet-lua/lua/Other.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@ function getConfig(...)
"fixUnnecessaryLinebreaks",
"forceNewEnvironNegotiationOff",
"inputLineStrictUnixEndings",
"logInHTML",
"mapExitSize",
"mapperPanelVisible",
"mapRoomSize",
Expand Down

0 comments on commit ced5f71

Please sign in to comment.