Some fixes
This commit is contained in:
parent
6306283272
commit
456d83f1c0
@ -1,4 +1,4 @@
|
|||||||
if (game:issingleplyer()) then
|
if (game:issingleplayer()) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -122,6 +122,10 @@ mphud.updateHudVisibility = function(a1, a2)
|
|||||||
local menus = root:AnyActiveMenusInStack()
|
local menus = root:AnyActiveMenusInStack()
|
||||||
local infobar = root.infobar
|
local infobar = root.infobar
|
||||||
|
|
||||||
|
if (not infobar) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if (menus) then
|
if (menus) then
|
||||||
infobar:animateToState("hud_off")
|
infobar:animateToState("hud_off")
|
||||||
else
|
else
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
local pcdisplay = luiglobals.require("LUI.PCDisplay")
|
local pcdisplay = luiglobals.require("LUI.PCDisplay")
|
||||||
|
|
||||||
|
game:addlocalizedstring("LUA_MENU_FPS", "FPS Counter")
|
||||||
|
game:addlocalizedstring("LUA_MENU_FPS_DESC", "Show FPS Counter")
|
||||||
|
|
||||||
|
game:addlocalizedstring("LUA_MENU_LATENCY", "Server Latency")
|
||||||
|
game:addlocalizedstring("LUA_MENU_LATENCY_DESC", "Show server latency")
|
||||||
|
|
||||||
function createdivider(menu, text)
|
function createdivider(menu, text)
|
||||||
local element = LUI.UIElement.new( {
|
local element = LUI.UIElement.new( {
|
||||||
leftAnchor = true,
|
leftAnchor = true,
|
||||||
@ -128,8 +134,8 @@ pcdisplay.CreateOptions = function( menu )
|
|||||||
LUI.Options.CreateOptionButton(
|
LUI.Options.CreateOptionButton(
|
||||||
menu,
|
menu,
|
||||||
"cg_infobar_ping",
|
"cg_infobar_ping",
|
||||||
"Server Latency",
|
"@LUA_MENU_LATENCY",
|
||||||
"Show server latency",
|
"@LUA_MENU_LATENCY_DESC",
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
text = "@LUA_MENU_ENABLED",
|
text = "@LUA_MENU_ENABLED",
|
||||||
@ -150,8 +156,8 @@ pcdisplay.CreateOptions = function( menu )
|
|||||||
LUI.Options.CreateOptionButton(
|
LUI.Options.CreateOptionButton(
|
||||||
menu,
|
menu,
|
||||||
"cg_infobar_fps",
|
"cg_infobar_fps",
|
||||||
"FPS counter",
|
"@LUA_MENU_FPS",
|
||||||
"Show FPS counter",
|
"@LUA_MENU_FPS_DESC",
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
text = "@LUA_MENU_ENABLED",
|
text = "@LUA_MENU_ENABLED",
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "../../../component/command.hpp"
|
#include "../../../component/command.hpp"
|
||||||
#include "../../../component/updater.hpp"
|
#include "../../../component/updater.hpp"
|
||||||
#include "../../../component/fps.hpp"
|
#include "../../../component/fps.hpp"
|
||||||
|
#include "../../../component/localized_strings.hpp"
|
||||||
|
|
||||||
#include "component/game_console.hpp"
|
#include "component/game_console.hpp"
|
||||||
#include "component/scheduler.hpp"
|
#include "component/scheduler.hpp"
|
||||||
@ -61,6 +62,12 @@ namespace ui_scripting::lua
|
|||||||
return ::game::environment::is_mp();
|
return ::game::environment::is_mp();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
game_type["addlocalizedstring"] = [](const game&, const std::string& string,
|
||||||
|
const std::string& value)
|
||||||
|
{
|
||||||
|
localized_strings::override(string, value);
|
||||||
|
};
|
||||||
|
|
||||||
auto userdata_type = state.new_usertype<userdata>("userdata_");
|
auto userdata_type = state.new_usertype<userdata>("userdata_");
|
||||||
|
|
||||||
userdata_type["new"] = sol::property(
|
userdata_type["new"] = sol::property(
|
||||||
@ -74,7 +81,6 @@ namespace ui_scripting::lua
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
userdata_type["get"] = [](const userdata& userdata, const sol::this_state s,
|
userdata_type["get"] = [](const userdata& userdata, const sol::this_state s,
|
||||||
const sol::lua_value& key)
|
const sol::lua_value& key)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user