From 1e120eed529196673367d30c5504dafd9b23f866 Mon Sep 17 00:00:00 2001 From: MewMew Date: Mon, 14 Sep 2020 13:07:41 +0200 Subject: [PATCH] added miner tag, fixed wrong text position --- maps/biter_battles_v2/functions.lua | 14 +++++++------- maps/biter_battles_v2/init.lua | 9 +++++---- modules/simple_tags.lua | 5 +++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/maps/biter_battles_v2/functions.lua b/maps/biter_battles_v2/functions.lua index 20107f94..c3e8b244 100644 --- a/maps/biter_battles_v2/functions.lua +++ b/maps/biter_battles_v2/functions.lua @@ -225,18 +225,18 @@ function Public.share_chat(event) local color = player.chat_color if player.force.name == "north" then - game.forces.spectator.print(player.name .. " (north): ".. event.message .. tag, color) + game.forces.spectator.print(player.name .. tag .. " (north): ".. event.message, color) end if player.force.name == "south" then - game.forces.spectator.print(player.name .. " (south): ".. event.message .. tag, color) + game.forces.spectator.print(player.name .. tag .. " (south): ".. event.message, color) end if global.tournament_mode then return end if player.force.name == "player" then - game.forces.north.print(player.name .. " (spawn): ".. event.message .. tag, color) - game.forces.south.print(player.name .. " (spawn): ".. event.message .. tag, color) - game.forces.spectator.print(player.name .. " (spawn): ".. event.message .. tag, color) + game.forces.north.print(player.name .. tag .. " (spawn): ".. event.message, color) + game.forces.south.print(player.name .. tag .. " (spawn): ".. event.message, color) + game.forces.spectator.print(player.name .. tag .. " (spawn): ".. event.message, color) end if player.force.name == "spectator" then @@ -244,8 +244,8 @@ function Public.share_chat(event) local a, b = string_find(event.message, "gps=", 1, false) if a then return end - game.forces.north.print(player.name .. " (spectator): ".. event.message .. tag, color) - game.forces.south.print(player.name .. " (spectator): ".. event.message .. tag, color) + game.forces.north.print(player.name .. tag .. " (spectator): ".. event.message, color) + game.forces.south.print(player.name .. tag .. " (spectator): ".. event.message, color) end end diff --git a/maps/biter_battles_v2/init.lua b/maps/biter_battles_v2/init.lua index 3ee7d54d..63d4a3ea 100644 --- a/maps/biter_battles_v2/init.lua +++ b/maps/biter_battles_v2/init.lua @@ -31,6 +31,7 @@ function Public.initial_setup() defines.input_action.activate_copy, defines.input_action.activate_cut, defines.input_action.activate_paste, + defines.input_action.change_active_quick_bar, defines.input_action.clean_cursor_stack, defines.input_action.edit_permission_group, defines.input_action.gui_click, @@ -44,14 +45,14 @@ function Public.initial_setup() defines.input_action.gui_value_changed, defines.input_action.open_character_gui, defines.input_action.open_kills_gui, + defines.input_action.quick_bar_set_selected_page, + defines.input_action.quick_bar_set_slot, defines.input_action.rotate_entity, + defines.input_action.set_filter, + defines.input_action.set_player_color, defines.input_action.start_walking, defines.input_action.toggle_show_entity_info, defines.input_action.write_to_console, - defines.input_action.change_active_quick_bar, - defines.input_action.quick_bar_set_selected_page, - defines.input_action.quick_bar_set_slot, - defines.input_action.set_filter } for _, d in pairs(defs) do p.set_allows_action(d, true) end diff --git a/modules/simple_tags.lua b/modules/simple_tags.lua index f8ec0ef7..e57801ac 100644 --- a/modules/simple_tags.lua +++ b/modules/simple_tags.lua @@ -2,7 +2,8 @@ local Event = require 'utils.event' -local icons = { +local icons = { + {"[img=item/electric-mining-drill]", "item/electric-mining-drill", "Miner"}, {"[img=item/stone-furnace]", "item/stone-furnace", "Smeltery"}, {"[img=item/big-electric-pole]", "item/big-electric-pole", "Power"}, {"[img=item/assembling-machine-1]", "item/assembling-machine-1", "Production"}, @@ -52,7 +53,7 @@ local function draw_screen_gui(player) local frame = player.gui.screen.add({ type = "frame", name = "simple_tag_frame", - caption = "Pick your duty:", + direction = "vertical", }) frame.location = {x = get_x_offset(player), y = 39} frame.style.padding = -1