mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-17 20:58:13 +02:00
antigrief_admin_panel > minicamera update
This commit is contained in:
parent
51483ee0c1
commit
39c182da88
@ -173,6 +173,14 @@ local function remove_all_deconstruction_orders(player, source_player)
|
||||
admin_only_message(source_player.name .. " has canceled all deconstruction orders.")
|
||||
end
|
||||
]]--
|
||||
local function create_mini_camera_gui(player, caption, position)
|
||||
if player.gui.center["mini_camera"] then player.gui.center["mini_camera"].destroy() end
|
||||
local frame = player.gui.center.add({type = "frame", name = "mini_camera", caption = caption})
|
||||
local camera = frame.add({type = "camera", name = "mini_cam_element", position = position, zoom = 0.6, surface_index = player.surface.index})
|
||||
camera.style.minimal_width = 640
|
||||
camera.style.minimal_height = 480
|
||||
end
|
||||
|
||||
local function create_admin_panel(player)
|
||||
if player.gui.left["admin_panel"] then player.gui.left["admin_panel"].destroy() end
|
||||
|
||||
@ -286,6 +294,41 @@ local admin_functions = {
|
||||
["go_to_player"] = go_to_player
|
||||
}
|
||||
|
||||
local function get_position_from_string(str)
|
||||
if not str then return end
|
||||
if str == "" then return end
|
||||
str = string.lower(str)
|
||||
local x_pos = string.find(str, "x:")
|
||||
local y_pos = string.find(str, "y:")
|
||||
if not x_pos then return false end
|
||||
if not y_pos then return false end
|
||||
x_pos = x_pos + 2
|
||||
y_pos = y_pos + 2
|
||||
|
||||
local a = 1
|
||||
for i = 1, string.len(str), 1 do
|
||||
local s = string.sub(str, x_pos + i, x_pos + i)
|
||||
if not s then break end
|
||||
if string.byte(s) == 32 then break end
|
||||
a = a + 1
|
||||
end
|
||||
local x = string.sub(str, x_pos, x_pos + a)
|
||||
|
||||
local a = 1
|
||||
for i = 1, string.len(str), 1 do
|
||||
local s = string.sub(str, y_pos + i, y_pos + i)
|
||||
if not s then break end
|
||||
if string.byte(s) == 32 then break end
|
||||
a = a + 1
|
||||
end
|
||||
|
||||
local y = string.sub(str, y_pos, y_pos + a)
|
||||
x = tonumber(x)
|
||||
y = tonumber(y)
|
||||
local position = {x = x, y = y}
|
||||
return position
|
||||
end
|
||||
|
||||
local function on_gui_click(event)
|
||||
local player = game.players[event.player_index]
|
||||
|
||||
@ -313,6 +356,16 @@ local function on_gui_click(event)
|
||||
admin_functions[name](target_player, player)
|
||||
end
|
||||
end
|
||||
|
||||
if name == "mini_camera" or name == "mini_cam_element" then
|
||||
player.gui.center["mini_camera"].destroy()
|
||||
return
|
||||
end
|
||||
|
||||
if not event.element.caption then return end
|
||||
local position = get_position_from_string(event.element.caption)
|
||||
if not position then return end
|
||||
create_mini_camera_gui(player, event.element.caption, position)
|
||||
end
|
||||
|
||||
local function on_gui_selection_state_changed(event)
|
||||
|
@ -179,7 +179,7 @@ function create_new_arena()
|
||||
surface.daytime = 1
|
||||
surface.freeze_daytime = 1
|
||||
|
||||
global.current_arena_size = arena_size * 1
|
||||
global.current_arena_size = arena_size
|
||||
|
||||
put_players_into_arena()
|
||||
|
||||
|
@ -18,23 +18,6 @@ local symbol_desc = "▼"
|
||||
|
||||
local pokemessages = {"a stick", "a leaf", "a moldy carrot", "a crispy slice of bacon", "a french fry", "a realistic toygun", "a broomstick", "a thirteen inch iron stick", "a mechanical keyboard", "a fly fishing cane", "a selfie stick", "an oversized fidget spinner", "a thumb extender", "a dirty straw", "a green bean", "a banana", "an umbrella", "grandpa's walking stick", "live firework", "a toilet brush", "a fake hand", "an undercooked hotdog", "a slice of yesterday's microwaved pizza", "bubblegum", "a biter leg", "grandma's toothbrush", "charred octopus", "a dollhouse bathtub", "a length of copper wire", "a decommissioned nuke", "a smelly trout", "an unopened can of deodorant", "a stone brick", "a half full barrel of lube", "a half empty barrel of lube", "an unexploded cannon shell", "a blasting programmable speaker", "a not so straight rail", "a mismatched pipe to ground", "a surplus box of landmines", "decommissioned yellow rounds", "an oily pumpjack shaft", "a melted plastic bar in the shape of the virgin mary", "a bottle of watermelon vitamin water", "a slice of watermelon", "a stegosaurus tibia", "a basking musician's clarinet", "a twig", "an undisclosed pokey item", "a childhood trophy everyone else got","a dead starfish","a titanium toothpick", "a nail file","a stamp collection","a bucket of lego","a rolled up carpet","a rolled up WELCOME doormat","Bobby's favorite bone","an empty bottle of cheap vodka","a tattooing needle","a peeled cucumber","a stack of cotton candy","a signed baseball bat","that 5 dollar bill grandma sent for christmas","a stack of overdue phone bills","the 'relax' section of the white pages","a bag of gym clothes which never made it to the washing machine","a handful of peanut butter","a pheasant's feather","a rusty pickaxe","a diamond sword","the bill of rights of a banana republic","one of those giant airport Toblerone's", "a long handed inserter", "a wiimote","an easter chocolate rabbit","a ball of yarn the cat threw up","a slightly expired but perfectly edible cheese sandwich", "conclusive proof of lizard people existence","a pen drive full of high res wallpapers","a pet hamster","an oversized goldfish","a one foot extension cord","a CD from Walmart's 1 dollar bucket","a magic wand","a list of disappointed people who believed in you","murder exhibit no. 3","a paperback copy of 'Great Expectations'", "a baby biter", "a little biter fang", "the latest diet fad","a belt that no longer fits you","an abandoned pet rock","a lava lamp", "some spirit herbs","a box of fish sticks found at the back of the freezer","a bowl of tofu rice", "a bowl of ramen noodles", "a live lobster!", "a miniature golf cart","dunce cap","a fully furnished x-mas tree", "an orphaned power pole", "an horphaned power pole","an box of overpriced girl scout cookies","the cheapest item from the yard sale","a Sharpie","a glowstick","a thick unibrow hair","a very detailed map of Kazakhstan","the official Factorio installation DVD","a Liberal Arts degree","a pitcher of Kool-Aid","a 1/4 pound vegan burrito","a bottle of expensive wine","a hamster sized gravestone","a counterfeit Cuban cigar","an old Nokia phone","a huge inferiority complex","a dead real state agent","a deck of tarot cards","unreleased Wikileaks documents","a mean-looking garden dwarf","the actual mythological OBESE cat","a telescope used to spy on the MILF next door","a fancy candelabra","the comic version of the Kama Sutra","an inflatable 'Netflix & chill' doll","whatever it is redlabel gets high on","Obama's birth certificate","a deck of Cards Against Humanity","a copy of META MEME HUMOR for Dummies","an abandoned, not-so-young-anymore puppy","one of those useless items advertised on TV","a genetic blueprint of a Japanese teen idol" }
|
||||
|
||||
local function on_player_joined_game(event)
|
||||
local player = game.players[event.player_index]
|
||||
if not global.poke_spam_protection then global.poke_spam_protection = {} end
|
||||
global.poke_spam_protection[event.player_index] = game.tick
|
||||
if not global.player_list_pokes_counter then global.player_list_pokes_counter = {} end
|
||||
|
||||
if player.gui.top.player_list_button == nil then
|
||||
local button = player.gui.top.add({ type = "sprite-button", name = "player_list_button", sprite = "item/heavy-armor" })
|
||||
button.style.minimal_height = 38
|
||||
button.style.minimal_width = 38
|
||||
button.style.top_padding = 2
|
||||
button.style.left_padding = 4
|
||||
button.style.right_padding = 4
|
||||
button.style.bottom_padding = 2
|
||||
end
|
||||
end
|
||||
|
||||
local function get_formatted_playtime(x)
|
||||
local time_one = 216000
|
||||
local time_two = 3600
|
||||
@ -429,6 +412,28 @@ local function on_gui_click(event)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function on_player_joined_game(event)
|
||||
local player = game.players[event.player_index]
|
||||
if not global.poke_spam_protection then global.poke_spam_protection = {} end
|
||||
global.poke_spam_protection[event.player_index] = game.tick
|
||||
if not global.player_list_pokes_counter then global.player_list_pokes_counter = {} end
|
||||
|
||||
if player.gui.top.player_list_button == nil then
|
||||
local button = player.gui.top.add({ type = "sprite-button", name = "player_list_button", sprite = "item/heavy-armor" })
|
||||
button.style.minimal_height = 38
|
||||
button.style.minimal_width = 38
|
||||
button.style.top_padding = 2
|
||||
button.style.left_padding = 4
|
||||
button.style.right_padding = 4
|
||||
button.style.bottom_padding = 2
|
||||
end
|
||||
|
||||
if player.gui.left["player-list-panel"] then
|
||||
player.gui.left["player-list-panel"].destroy()
|
||||
player_list_show(player,"total_time_played_desc")
|
||||
end
|
||||
end
|
||||
--[[
|
||||
local function on_tick()
|
||||
if game.tick % 1200 == 0 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user