1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2026-06-20 16:32:28 +02:00
This commit is contained in:
Gerkiz
2020-10-21 17:10:13 +02:00
parent 3076b408db
commit fa269da6ee
6 changed files with 30 additions and 7 deletions
+20 -5
View File
@@ -13,6 +13,7 @@ to your scenario control.lua.
Minor changes by ~~~Gerkiz~~~
--]]
local Event = require 'utils.event'
local Where = require 'commands.where'
local Session = require 'utils.datastore.session_data'
local Jailed = require 'utils.datastore.jail_data'
local Tabs = require 'comfy_panel.main'
@@ -497,16 +498,16 @@ local function player_list_show(player, frame, sort_by)
if game.players[player_list[i].name].admin then
trusted = '[color=red][A][/color]'
tooltip = 'This player is an admin of this server.'
tooltip = 'This player is an admin of this server.\nLeft-click to show this person on map!'
elseif jailed[player_list[i].name] then
trusted = '[color=orange][J][/color]'
tooltip = 'This player is currently jailed.'
tooltip = 'This player is currently jailed.\nLeft-click to show this person on map!'
elseif play_table[player_list[i].name] then
trusted = '[color=green][T][/color]'
tooltip = 'This player is trusted.'
tooltip = 'This player is trusted.\nLeft-click to show this person on map!'
else
trusted = '[color=yellow][U][/color]'
tooltip = 'This player is not trusted.'
tooltip = 'This player is not trusted.\nLeft-click to show this person on map!'
end
local caption
@@ -517,10 +518,15 @@ local function player_list_show(player, frame, sort_by)
end
-- Name
local p = game.players[player_list[i].name]
if not p or not p.valid then
return
end
local name_label =
player_list_panel_table.add {
type = 'label',
name = 'player_list_panel_player_names_' .. i,
name = p.index,
caption = caption,
tooltip = tooltip
}
@@ -637,6 +643,15 @@ local function on_gui_click(event)
if not event.element.valid then
return
end
--Locate other players
local index = tonumber(event.element.name)
if index and game.players[index] and index == game.players[index].index then
local target = game.players[index]
if not target or not target.valid then
return
end
Where.create_mini_camera_gui(player, target.name, target.position, target.surface.index)
end
--Poke other players
if string.sub(event.element.name, 1, 11) == 'poke_player' then
local poked_player = string.sub(event.element.name, 13, string.len(event.element.name))
+6
View File
@@ -3,6 +3,8 @@
local Color = require 'utils.color_presets'
local Event = require 'utils.event'
local Public = {}
local function validate_player(player)
if not player then
return false
@@ -80,4 +82,8 @@ local function on_gui_click(event)
end
end
Public.create_mini_camera_gui = create_mini_camera_gui
Event.add(defines.events.on_gui_click, on_gui_click)
return Public
@@ -8,6 +8,7 @@ local blacklist = {
['cargo-wagon'] = true,
['locomotive'] = true,
['artillery-wagon'] = true,
['artillery-turret'] = true,
['fluid-wagon'] = true,
['land-mine'] = true,
['car'] = true,
+1
View File
@@ -13,6 +13,7 @@ local blacklist = {
['spidertron'] = true,
['locomotive'] = true,
['artillery-wagon'] = true,
['artillery-turret'] = true,
['fluid-wagon'] = true
}
+1 -1
View File
@@ -686,7 +686,7 @@ function Public.global_pool(players, count)
RPG.debug_log('RPG - player capped: ' .. p.name .. '. Amount to pool:' .. share)
end
else
local message = ({'rpg_functions.pool_reward'})
local message = ({'rpg_functions.pool_reward', p.name})
Alert.alert_player_warning(p, 10, message)
share = share / 10
rpg_extra.leftover_pool = rpg_extra.leftover_pool + share
+1 -1
View File
@@ -31,7 +31,7 @@ ServerCommands.query_online_players = Server.query_online_players
local SC_Interface = {
get_ups = function()
return ServerCommands.get_ups
return ServerCommands.get_ups()
end,
set_ups = function(tick)
if tick then