mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Fixed server mis-spell
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
--[[-- Gui Module - Server UPS
|
--[[-- Gui Module - Server UPS
|
||||||
- Adds a server ups counter in the top right and a command to toggle is
|
- Adds a server ups counter in the top right and a command to toggle is
|
||||||
@gui sverer-ups
|
@gui server-ups
|
||||||
@alias sverer_ups
|
@alias server_ups
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||||
@@ -9,8 +9,8 @@ local Event = require 'utils.event' --- @dep utils.event
|
|||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
||||||
|
|
||||||
--- Label to show the server ups
|
--- Label to show the server ups
|
||||||
-- @element sverer_ups
|
-- @element server_ups
|
||||||
local sverer_ups =
|
local server_ups =
|
||||||
Gui.element{
|
Gui.element{
|
||||||
type = 'label',
|
type = 'label',
|
||||||
caption = 'Server UPS = 60.0'
|
caption = 'Server UPS = 60.0'
|
||||||
@@ -24,7 +24,7 @@ Gui.element{
|
|||||||
Commands.new_command('server-ups','Toggle the server ups display')
|
Commands.new_command('server-ups','Toggle the server ups display')
|
||||||
:add_alias('sups','ups')
|
:add_alias('sups','ups')
|
||||||
:register(function(player)
|
:register(function(player)
|
||||||
local label = player.gui.screen[sverer_ups.name]
|
local label = player.gui.screen[server_ups.name]
|
||||||
if not global.ext or not global.ext.server_ups then
|
if not global.ext or not global.ext.server_ups then
|
||||||
return Commands.error{'expcom-server-ups.no-ext'}
|
return Commands.error{'expcom-server-ups.no-ext'}
|
||||||
end
|
end
|
||||||
@@ -35,7 +35,7 @@ end)
|
|||||||
-- 1920x1080: x=1455, y=30 (ui scale 100%)
|
-- 1920x1080: x=1455, y=30 (ui scale 100%)
|
||||||
local function set_location(event)
|
local function set_location(event)
|
||||||
local player = game.players[event.player_index]
|
local player = game.players[event.player_index]
|
||||||
local label = player.gui.screen[sverer_ups.name]
|
local label = player.gui.screen[server_ups.name]
|
||||||
local res = player.display_resolution
|
local res = player.display_resolution
|
||||||
local uis = player.display_scale
|
local uis = player.display_scale
|
||||||
label.location = { x=res.width-465*uis, y=30*uis }
|
label.location = { x=res.width-465*uis, y=30*uis }
|
||||||
@@ -44,7 +44,7 @@ end
|
|||||||
-- Draw the label when the player joins
|
-- Draw the label when the player joins
|
||||||
Event.add(defines.events.on_player_created,function(event)
|
Event.add(defines.events.on_player_created,function(event)
|
||||||
local player = game.players[event.player_index]
|
local player = game.players[event.player_index]
|
||||||
local label = sverer_ups(player.gui.screen)
|
local label = server_ups(player.gui.screen)
|
||||||
label.visible = false
|
label.visible = false
|
||||||
set_location(event)
|
set_location(event)
|
||||||
end)
|
end)
|
||||||
@@ -54,7 +54,7 @@ Event.on_nth_tick(60,function()
|
|||||||
if global.ext and global.ext.server_ups then
|
if global.ext and global.ext.server_ups then
|
||||||
local caption = 'Server UPS = '..global.ext.server_ups
|
local caption = 'Server UPS = '..global.ext.server_ups
|
||||||
for _,player in pairs(game.connected_players) do
|
for _,player in pairs(game.connected_players) do
|
||||||
player.gui.screen[sverer_ups.name].caption = caption
|
player.gui.screen[server_ups.name].caption = caption
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user