mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-04-13 11:30:40 +02:00
various tweaks
This commit is contained in:
parent
35f7a25ce8
commit
d3880c78a6
@ -79,7 +79,7 @@ spell_gui_setup=Spells MiniGui Setup
|
|||||||
spell_gui_tooltip=Set your 3 spells for useful Spell Switcher. Opened or closed by this fish button.\n
|
spell_gui_tooltip=Set your 3 spells for useful Spell Switcher. Opened or closed by this fish button.\n
|
||||||
save_changes=Save changes
|
save_changes=Save changes
|
||||||
discard_changes=Discard changes
|
discard_changes=Discard changes
|
||||||
not_trusted=Not trusted.\nChecked: true\nUnchecked: false
|
not_trusted=Not trusted.
|
||||||
low_level=Level requirement: __1__
|
low_level=Level requirement: __1__
|
||||||
used_up=All used up!
|
used_up=All used up!
|
||||||
no_mana=Not enough mana!
|
no_mana=Not enough mana!
|
||||||
@ -105,6 +105,8 @@ explosive_bullets_label=Enable explosive bullets?
|
|||||||
explosive_bullets_tooltip=Hurts the biters a bit extra
|
explosive_bullets_tooltip=Hurts the biters a bit extra
|
||||||
magic_label=Enable spawning with raw-fish?
|
magic_label=Enable spawning with raw-fish?
|
||||||
toggle_cast_spell_label=Toggles the ability to cast spells.
|
toggle_cast_spell_label=Toggles the ability to cast spells.
|
||||||
|
cast_spell_enabled_label=Casting spells with fish has been enabled!
|
||||||
|
cast_spell_disabled_label=Casting spells with fish has been disabled!
|
||||||
magic_tooltip=When simply constructing items is not enough.\nNOTE! Use Raw-fish 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_spell=Select what entity to spawn
|
||||||
magic_item_requirement=__1__ [item=__2__] requires __3__ mana to cast. Level: __4__\n
|
magic_item_requirement=__1__ [item=__2__] requires __3__ mana to cast. Level: __4__\n
|
||||||
|
@ -169,6 +169,7 @@ function Public.reset_map()
|
|||||||
end
|
end
|
||||||
|
|
||||||
JailData.set_valid_surface(tostring(surface.name))
|
JailData.set_valid_surface(tostring(surface.name))
|
||||||
|
JailData.reset_vote_table()
|
||||||
|
|
||||||
Explosives.set_surface_whitelist({[surface.name] = true})
|
Explosives.set_surface_whitelist({[surface.name] = true})
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ local ComfyGui = require 'comfy_panel.main'
|
|||||||
local Session = require 'utils.datastore.session_data'
|
local Session = require 'utils.datastore.session_data'
|
||||||
local P = require 'player_modifiers'
|
local P = require 'player_modifiers'
|
||||||
local Gui = require 'utils.gui'
|
local Gui = require 'utils.gui'
|
||||||
|
local Color = require 'utils.color_presets'
|
||||||
|
|
||||||
--RPG Modules
|
--RPG Modules
|
||||||
local Public = require 'modules.rpg.table'
|
local Public = require 'modules.rpg.table'
|
||||||
@ -739,18 +740,19 @@ Gui.on_click(
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
log(serpent.block(Session.get_trusted_player(player.name)))
|
|
||||||
|
|
||||||
if not Session.get_trusted_player(player) then
|
if not Session.get_trusted_player(player) then
|
||||||
|
player.print({'rpg_settings.not_trusted'}, Color.fail)
|
||||||
return player.play_sound({path = 'utility/cannot_build', volume_modifier = 0.75})
|
return player.play_sound({path = 'utility/cannot_build', volume_modifier = 0.75})
|
||||||
end
|
end
|
||||||
|
|
||||||
if frame and frame.valid then
|
if frame and frame.valid then
|
||||||
local rpg_t = Public.get_value_from_player(player.index)
|
local rpg_t = Public.get_value_from_player(player.index)
|
||||||
if not rpg_t.enable_entity_spawn then
|
if not rpg_t.enable_entity_spawn then
|
||||||
|
player.print({'rpg_settings.cast_spell_enabled_label'}, Color.success)
|
||||||
player.play_sound({path = 'utility/armor_insert', volume_modifier = 0.75})
|
player.play_sound({path = 'utility/armor_insert', volume_modifier = 0.75})
|
||||||
rpg_t.enable_entity_spawn = true
|
rpg_t.enable_entity_spawn = true
|
||||||
else
|
else
|
||||||
|
player.print({'rpg_settings.cast_spell_disabled_label'}, Color.warning)
|
||||||
player.play_sound({path = 'utility/cannot_build', volume_modifier = 0.75})
|
player.play_sound({path = 'utility/cannot_build', volume_modifier = 0.75})
|
||||||
rpg_t.enable_entity_spawn = false
|
rpg_t.enable_entity_spawn = false
|
||||||
end
|
end
|
||||||
|
@ -9,23 +9,6 @@ local try_get_data = Server.try_get_data
|
|||||||
|
|
||||||
local Public = {}
|
local Public = {}
|
||||||
|
|
||||||
local color_table = {
|
|
||||||
default = {},
|
|
||||||
red = {},
|
|
||||||
green = {},
|
|
||||||
blue = {},
|
|
||||||
orange = {},
|
|
||||||
yellow = {},
|
|
||||||
pink = {},
|
|
||||||
purple = {},
|
|
||||||
white = {},
|
|
||||||
black = {},
|
|
||||||
gray = {},
|
|
||||||
brown = {},
|
|
||||||
cyan = {},
|
|
||||||
acid = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
local fetch =
|
local fetch =
|
||||||
Token.register(
|
Token.register(
|
||||||
function(data)
|
function(data)
|
||||||
@ -62,20 +45,15 @@ Event.add(
|
|||||||
if not player then
|
if not player then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
fetcher(player.name)
|
fetcher(player.name)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
Event.add(
|
commands.add_command(
|
||||||
defines.events.on_console_command,
|
'save-color',
|
||||||
function(event)
|
'Save your personal color preset so it´s always the same whenever you join.',
|
||||||
local player_index = event.player_index
|
function()
|
||||||
if not player_index or event.command ~= 'color' then
|
local player = game.player
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local player = game.get_player(player_index)
|
|
||||||
if not player or not player.valid then
|
if not player or not player.valid then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -85,19 +63,30 @@ Event.add(
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local param = event.parameters
|
|
||||||
local color = player.color
|
local color = player.color
|
||||||
local chat = player.chat_color
|
local chat = player.chat_color
|
||||||
param = string.lower(param)
|
|
||||||
if param then
|
|
||||||
for word in param:gmatch('%S+') do
|
|
||||||
if color_table[word] then
|
|
||||||
set_data(color_data_set, player.name, {color = {color}, chat = {chat}})
|
set_data(color_data_set, player.name, {color = {color}, chat = {chat}})
|
||||||
player.print('Your color has been saved.', Color.success)
|
player.print('Your personal color has been saved to the datastore.', Color.success)
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
commands.add_command(
|
||||||
|
'remove-color',
|
||||||
|
'Removes your saved color from the datastore.',
|
||||||
|
function()
|
||||||
|
local player = game.player
|
||||||
|
if not player or not player.valid then
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local secs = Server.get_current_time()
|
||||||
|
if not secs then
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_data(color_data_set, player.name, nil)
|
||||||
|
player.print('Your personal color has been removed from the datastore.', Color.success)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -686,6 +686,15 @@ function Public.required_playtime_for_vote(value)
|
|||||||
return settings.playtime_for_vote
|
return settings.playtime_for_vote
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Public.reset_vote_table()
|
||||||
|
for k, _ in pairs(votejail) do
|
||||||
|
votejail[k] = nil
|
||||||
|
end
|
||||||
|
for k, _ in pairs(votefree) do
|
||||||
|
votefree[k] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Event.on_init(get_gulag_permission_group)
|
Event.on_init(get_gulag_permission_group)
|
||||||
|
|
||||||
return Public
|
return Public
|
||||||
|
@ -938,8 +938,8 @@ local function command_handler(callback, ...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- The command 'cc' is only used by the server so it can communicate through the webpanel api to the instances that it starts.
|
--- The command 'cc' is only used by the server so it can communicate through the web-panel api to the instances that it starts.
|
||||||
-- Doing this, enables achivements and the webpanel can communicate without any interruptions.
|
-- Doing this, enables achievements and the web-panel can communicate without any interruptions.
|
||||||
commands.add_command(
|
commands.add_command(
|
||||||
'cc',
|
'cc',
|
||||||
'Evaluate command',
|
'Evaluate command',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user