mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2024-12-30 23:17:53 +02:00
minor changes
This commit is contained in:
parent
f1e6b40102
commit
37710fac2c
@ -104,6 +104,7 @@ flameboots_tooltip=When the bullets simply don´t bite.
|
||||
explosive_bullets_label=Enable explosive bullets?
|
||||
explosive_bullets_tooltip=Hurts the biters a bit extra
|
||||
magic_label=Enable spawning with raw-fish?
|
||||
toggle_cast_spell_label=Toggles the ability to cast spells.
|
||||
magic_tooltip=When simply constructing items is not enough.\nNOTE! Use Raw-fish to cast spells.
|
||||
magic_spell=Select what entity to spawn
|
||||
magic_item_requirement=__1__ [item=__2__] requires __3__ mana to cast. Level: __4__\n
|
||||
|
@ -1145,33 +1145,21 @@ local function show_mvps(player)
|
||||
|
||||
local server_name = Server.check_server_name('Mtn Fortress')
|
||||
if server_name then
|
||||
Server.to_discord_named_embed(
|
||||
send_ping_to_channel,
|
||||
'**Statistics!**\\n\\n' ..
|
||||
'Time played: ' ..
|
||||
time_played ..
|
||||
'\\n' ..
|
||||
'Game Difficulty: ' ..
|
||||
diff.name ..
|
||||
'\\n' ..
|
||||
'Highest wave: ' ..
|
||||
format_number(wave, true) ..
|
||||
'\\n' ..
|
||||
'Total connected players: ' ..
|
||||
total_players ..
|
||||
'\\n' ..
|
||||
'Threat: ' ..
|
||||
format_number(threat, true) ..
|
||||
'\\n' ..
|
||||
'Pickaxe Upgrade: ' ..
|
||||
pick_tier ..
|
||||
' (' ..
|
||||
tier ..
|
||||
')\\n' ..
|
||||
'Collapse Speed: ' ..
|
||||
collapse_speed ..
|
||||
'\\n' .. 'Collapse Amount: ' .. collapse_amount .. '\\n'
|
||||
)
|
||||
local name = Server.get_server_name()
|
||||
local date = Server.get_start_time()
|
||||
game.server_save('Final_' .. name .. '_' .. tostring(date))
|
||||
--ignore
|
||||
local text = '**Statistics!**\\n\\n' ..
|
||||
'Time played: ' .. time_played ..
|
||||
'\\n' .. 'Game Difficulty: ' .. diff.name ..
|
||||
'\\n' .. 'Highest wave: ' .. format_number(wave, true) ..
|
||||
'\\n' .. 'Total connected players: ' .. total_players ..
|
||||
'\\n' .. 'Threat: ' .. format_number(threat, true) ..
|
||||
'\\n' .. 'Pickaxe Upgrade: ' .. pick_tier .. ' (' .. tier ..
|
||||
')\\n' .. 'Collapse Speed: ' .. collapse_speed ..
|
||||
'\\n' .. 'Collapse Amount: ' .. collapse_amount .. '\\n'
|
||||
--ignore
|
||||
Server.to_discord_named_embed(send_ping_to_channel, text)
|
||||
WPT.set('sent_to_discord', true)
|
||||
end
|
||||
end
|
||||
|
@ -1,4 +1,5 @@
|
||||
local ComfyGui = require 'comfy_panel.main'
|
||||
local Session = require 'utils.datastore.session_data'
|
||||
local P = require 'player_modifiers'
|
||||
local Gui = require 'utils.gui'
|
||||
|
||||
@ -16,6 +17,7 @@ local settings_button_name = Public.settings_button_name
|
||||
local settings_frame_name = Public.settings_frame_name
|
||||
local discard_button_name = Public.discard_button_name
|
||||
local save_button_name = Public.save_button_name
|
||||
local enable_spawning_frame_name = Public.enable_spawning_frame_name
|
||||
local spell_gui_button_name = Public.spell_gui_button_name
|
||||
local spell_gui_frame_name = Public.spell_gui_frame_name
|
||||
local spell1_button_name = Public.spell1_button_name
|
||||
@ -727,6 +729,33 @@ Gui.on_click(
|
||||
end
|
||||
)
|
||||
|
||||
Gui.on_click(
|
||||
enable_spawning_frame_name,
|
||||
function(event)
|
||||
local player = event.player
|
||||
local screen = player.gui.screen
|
||||
local frame = screen[spell_gui_frame_name]
|
||||
if not player or not player.valid or not player.character then
|
||||
return
|
||||
end
|
||||
|
||||
if not Session.get_trusted_player(player.name) then
|
||||
return player.play_sound({path = 'utility/cannot_build', volume_modifier = 0.75})
|
||||
end
|
||||
|
||||
if frame and frame.valid then
|
||||
local rpg_t = Public.get_value_from_player(player.index)
|
||||
if not rpg_t.enable_entity_spawn then
|
||||
player.play_sound({path = 'utility/armor_insert', volume_modifier = 0.75})
|
||||
rpg_t.enable_entity_spawn = true
|
||||
else
|
||||
player.play_sound({path = 'utility/cannot_build', volume_modifier = 0.75})
|
||||
rpg_t.enable_entity_spawn = false
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
Gui.on_click(
|
||||
spell_gui_button_name,
|
||||
function(event)
|
||||
|
@ -8,6 +8,7 @@ local save_button_name = Public.save_button_name
|
||||
local discard_button_name = Public.discard_button_name
|
||||
local spell_gui_button_name = Public.spell_gui_button_name
|
||||
local spell_gui_frame_name = Public.spell_gui_frame_name
|
||||
local enable_spawning_frame_name = Public.enable_spawning_frame_name
|
||||
local spell1_button_name = Public.spell1_button_name
|
||||
local spell2_button_name = Public.spell2_button_name
|
||||
local spell3_button_name = Public.spell3_button_name
|
||||
@ -91,7 +92,15 @@ function Public.spell_gui_settings(player)
|
||||
}
|
||||
)
|
||||
main_frame.auto_center = true
|
||||
local table = main_frame.add({type = 'table', column_count = 3, name = 'spell_table'})
|
||||
local table = main_frame.add({type = 'table', column_count = 4, name = 'spell_table'})
|
||||
table.add(
|
||||
{
|
||||
type = 'sprite-button',
|
||||
sprite = 'item/raw-fish',
|
||||
name = enable_spawning_frame_name,
|
||||
tooltip = ({'rpg_settings.toggle_cast_spell_label'})
|
||||
}
|
||||
)
|
||||
table.add(
|
||||
{
|
||||
type = 'sprite-button',
|
||||
@ -116,6 +125,7 @@ function Public.spell_gui_settings(player)
|
||||
tooltip = names[rpg_t.dropdown_select_index3] or '---'
|
||||
}
|
||||
)
|
||||
table.add({type = 'flow'})
|
||||
local b1 = table.add({type = 'sprite-button', name = 'mana-cost', tooltip = {'rpg_settings.mana_cost'}, caption = 0})
|
||||
local b2 = table.add({type = 'sprite-button', name = 'mana', tooltip = {'rpg_settings.mana'}, caption = 0})
|
||||
local b3 = table.add({type = 'sprite-button', name = 'maxmana', tooltip = {'rpg_settings.mana_max'}, caption = 0})
|
||||
|
@ -113,6 +113,17 @@ function Public.conjure_items()
|
||||
enabled = true,
|
||||
sprite = 'recipe/express-underground-belt'
|
||||
}
|
||||
spells[#spells + 1] = {
|
||||
name = {'entity-name.tree'},
|
||||
obj_to_create = 'tree-05',
|
||||
level = 70,
|
||||
type = 'entity',
|
||||
mana_cost = 100,
|
||||
tick = 350,
|
||||
aoe = true,
|
||||
enabled = true,
|
||||
sprite = 'entity/tree-05'
|
||||
}
|
||||
spells[#spells + 1] = {
|
||||
name = {'entity-name.sand-rock-big'},
|
||||
obj_to_create = 'sand-rock-big',
|
||||
|
@ -269,6 +269,15 @@ function Public.get_trusted_table()
|
||||
return trusted
|
||||
end
|
||||
|
||||
--- Returns the table of trusted
|
||||
-- @param LuaPlayer
|
||||
-- @return <table>
|
||||
function Public.get_trusted_player(player)
|
||||
if player and player.valid then
|
||||
return trusted[player.name] or false
|
||||
end
|
||||
end
|
||||
|
||||
--- Returns the table of settings
|
||||
-- @return <table>
|
||||
function Public.get_settings_table()
|
||||
|
Loading…
Reference in New Issue
Block a user