mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Added locale
This commit is contained in:
@@ -26,6 +26,21 @@ return {
|
|||||||
Deaths = e.on_player_died,
|
Deaths = e.on_player_died,
|
||||||
JoinCount = e.on_player_joined_game,
|
JoinCount = e.on_player_joined_game,
|
||||||
TilesRemoved = e.on_player_mined_tile,
|
TilesRemoved = e.on_player_mined_tile,
|
||||||
CapsulesUsed = e.on_player_used_capsule
|
CapsulesUsed = e.on_player_used_capsule,
|
||||||
|
EntityRepaired= e.on_player_repaired_entity
|
||||||
|
},
|
||||||
|
display_order = { --- @setting display_order The order that the statistics should be shown in when in a gui or command
|
||||||
|
'MapsPlayed', 'JoinCount',
|
||||||
|
'Playtime', 'AfkTime',
|
||||||
|
'ChatMessages', 'CommandsUsed',
|
||||||
|
'RocketsLaunched', 'ResearchCompleted',
|
||||||
|
'MachinesBuilt', 'MachinesRemoved',
|
||||||
|
'TilesBuilt', 'TilesRemoved',
|
||||||
|
'TreesDestroyed', 'OreMined',
|
||||||
|
'ItemsCrafted', 'ItemsPickedUp',
|
||||||
|
'Kills', 'Deaths',
|
||||||
|
'DamageDealt', 'DistanceTraveled',
|
||||||
|
'CapsulesUsed', 'EntityRepaired',
|
||||||
|
'DeconstructionPlanerUsed', 'MapTagsMade',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,3 +4,75 @@ message-set=Your join message has been updated.
|
|||||||
|
|
||||||
[quickbar]
|
[quickbar]
|
||||||
saved=Your quickbar filters have been saved.
|
saved=Your quickbar filters have been saved.
|
||||||
|
|
||||||
|
[exp-required]
|
||||||
|
|
||||||
|
[exp-settings]
|
||||||
|
Colour=Colour
|
||||||
|
Colour-tooltip=Your player colour
|
||||||
|
Colour-value-tooltip=Change by using /color
|
||||||
|
JoinMessage=Join Message
|
||||||
|
JoinMessage-tooltip=The message that is displayed when you join
|
||||||
|
JoinMessage-value-tooltip=Change by using /join-message
|
||||||
|
QuickbarFilters=Quickbar Filters
|
||||||
|
QuickbarFilters-tooltip=The filters that are on your quickbar
|
||||||
|
QuickbarFilters-value-tooltip=Change by using /save-quickbar
|
||||||
|
UsesAlt=Alt View
|
||||||
|
UsesAlt-tooltip=If you use alt view when you play
|
||||||
|
UsesAlt-value-tooltip=Change by pressing __CONTROL__show-info__
|
||||||
|
Tag=Player Tag
|
||||||
|
Tag-tooltip=The tag that is shown after your name
|
||||||
|
Tag-value-tooltip=Change by using /tag
|
||||||
|
Bonus=Player Bonus
|
||||||
|
Bonus-tooltip=The bonus that is given to your character
|
||||||
|
Bonus-value-tooltip=Change by using /bonus
|
||||||
|
|
||||||
|
[exp-statistics]
|
||||||
|
MapsPlayed=Maps Played
|
||||||
|
MapsPlayed-tooltip=The amount of maps you have played on
|
||||||
|
JoinCount=Join Count
|
||||||
|
JoinCount-tooltip=The amount of times you have joined our servers
|
||||||
|
Playtime=Playtime
|
||||||
|
Playtime-tooltip=The amount of time you have played on our servers
|
||||||
|
AfkTime=AFK Time
|
||||||
|
AfkTime-tooltip=The amount of time you have been afk on our servers
|
||||||
|
ChatMessages=Messages
|
||||||
|
ChatMessages-tooltip=The amount of message you have sent in chat
|
||||||
|
CommandsUsed=Commands
|
||||||
|
CommandsUsed-tooltip=The amount of commands you have used
|
||||||
|
RocketsLaunched=Rockets Launched
|
||||||
|
RocketsLaunched-tooltip=The amount of rockets launched while you were online
|
||||||
|
ResearchCompleted=Research Completed
|
||||||
|
ResearchCompleted-tooltip=The amount of research completed while you were online
|
||||||
|
MachinesBuilt=Machines Built
|
||||||
|
MachinesBuilt-tooltip=The amount of machines you have built
|
||||||
|
MachinesRemoved=Machines Removed
|
||||||
|
MachinesRemoved-tooltip=The amount of machines you have removed
|
||||||
|
TilesBuilt=Tiles Placed
|
||||||
|
TilesBuilt-tooltip=The amount of tiles you have placed
|
||||||
|
TilesRemoved=Tiles Removed
|
||||||
|
TilesRemoved-tooltip=The amount of tiles you have removed
|
||||||
|
TreesDestroyed=Trees Destroyed
|
||||||
|
TreesDestroyed-tooltip=The amount of trees you have destroyed
|
||||||
|
OreMined=Ore Mined
|
||||||
|
OreMined-tooltip=The amount of ore you have mined
|
||||||
|
ItemsCrafted=Items Crafted
|
||||||
|
ItemsCrafted-tooltip=The amount of items you have crafted
|
||||||
|
ItemsPickedUp=Items Picked Up
|
||||||
|
ItemsPickedUp-tooltip=The amount of items you have picked up
|
||||||
|
Kills=Kills
|
||||||
|
Kills-tooltip=The amount of things you have killed
|
||||||
|
Deaths=Deaths
|
||||||
|
Deaths-tooltip=The amount of times you have died
|
||||||
|
DamageDealt=Damage Delt
|
||||||
|
DamageDealt-tooltip=The amount of damage you have dealt to other forces
|
||||||
|
DistanceTraveled=Distance Traveled
|
||||||
|
DistanceTraveled-tooltip=The amount of tiles you have traveled across
|
||||||
|
CapsulesUsed=Capsules Used
|
||||||
|
CapsulesUsed-tooltip=The amount of capsules you have used
|
||||||
|
EntityRepaired=Machines Repaired
|
||||||
|
EntityRepaired-tooltip=The amount of machines which you have repaired
|
||||||
|
DeconstructionPlanerUsed=Decon Planner Used
|
||||||
|
DeconstructionPlanerUsed-tooltip=The amount of times you have used the deconstruction planer
|
||||||
|
MapTagsMade=Map Tags Used
|
||||||
|
MapTagsMade-tooltip=The amount of map tags you have created
|
||||||
@@ -45,4 +45,4 @@ data-failed=Your player data has failed to load. Any changes to your data will n
|
|||||||
data-restore=Your player data has been restored and changes will now save when you leave.
|
data-restore=Your player data has been restored and changes will now save when you leave.
|
||||||
preference=Saving Preference
|
preference=Saving Preference
|
||||||
preference-tooltip=Which areas will be saved when you leave the game
|
preference-tooltip=Which areas will be saved when you leave the game
|
||||||
preference-value-tooltip=Use /set-preference to change your preference
|
preference-value-tooltip=Change by using /set-preference
|
||||||
@@ -8,6 +8,9 @@ local afk_required = 5*3600 -- 5 minutes
|
|||||||
local PlayerData = require 'expcore.player_data' --- @dep expcore.player_data
|
local PlayerData = require 'expcore.player_data' --- @dep expcore.player_data
|
||||||
local AllPlayerData = PlayerData.All
|
local AllPlayerData = PlayerData.All
|
||||||
local Statistics = PlayerData.Statistics
|
local Statistics = PlayerData.Statistics
|
||||||
|
Statistics:set_metadata{
|
||||||
|
display_order = config.display_order
|
||||||
|
}
|
||||||
|
|
||||||
--- Update your statistics with any which happened before the data was valid
|
--- Update your statistics with any which happened before the data was valid
|
||||||
Statistics:on_load(function(player_name, player_statistics)
|
Statistics:on_load(function(player_name, player_statistics)
|
||||||
@@ -85,7 +88,7 @@ if config.DamageDealt then
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Add Kills if it is enabled
|
--- Add Kills if it is enabled
|
||||||
if config.DamageDealt then
|
if config.Kills then
|
||||||
local stat = Statistics:combine('Kills')
|
local stat = Statistics:combine('Kills')
|
||||||
Event.add(defines.events.on_entity_died, function(event)
|
Event.add(defines.events.on_entity_died, function(event)
|
||||||
local character = event.cause -- Check character is valid
|
local character = event.cause -- Check character is valid
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ local PlayerData = require 'expcore.player_data' --- @dep expcore.player_data
|
|||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require 'utils.event' --- @dep utils.event
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local Game = require 'utils.game' --- @dep utils.game
|
||||||
local format_time = _C.format_time --- @dep expcore.common
|
local format_time = _C.format_time --- @dep expcore.common
|
||||||
|
local format_number = require('util').format_number --- @dep util
|
||||||
|
|
||||||
local tabs = {}
|
local tabs = {}
|
||||||
local function Tab(caption, tooltip, element_define)
|
local function Tab(caption, tooltip, element_define)
|
||||||
@@ -282,16 +283,16 @@ Gui.element(function(_, parent)
|
|||||||
|
|
||||||
-- Add the required area
|
-- Add the required area
|
||||||
local required = title_table(scroll_pane, 250, {'readme.data-required'}, 2)
|
local required = title_table(scroll_pane, 250, {'readme.data-required'}, 2)
|
||||||
Gui.centered_label(required, 140, preference_meta.name, preference_meta.tooltip)
|
Gui.centered_label(required, 150, preference_meta.name, preference_meta.tooltip)
|
||||||
Gui.centered_label(required, 430, enum[preference], preference_meta.value_tooltip)
|
Gui.centered_label(required, 420, enum[preference], preference_meta.value_tooltip)
|
||||||
|
|
||||||
for name, child in pairs(PlayerData.Required.children) do
|
for name, child in pairs(PlayerData.Required.children) do
|
||||||
local metadata = child.metadata
|
local metadata = child.metadata
|
||||||
local value = child:get(player_name)
|
local value = child:get(player_name)
|
||||||
if value ~= nil or metadata.show_always then
|
if value ~= nil or metadata.show_always then
|
||||||
if metadata.stringify then value = metadata.stringify(value) end
|
if metadata.stringify then value = metadata.stringify(value) end
|
||||||
Gui.centered_label(required, 140, metadata.name or name, metadata.tooltip)
|
Gui.centered_label(settings, 150, metadata.name or {'exp-required.'..name}, metadata.tooltip or {'exp-required.'..name..'-tooltip'})
|
||||||
Gui.centered_label(required, 430, tostring(value), metadata.value_tooltip)
|
Gui.centered_label(settings, 420, tostring(value), metadata.value_tooltip or {'exp-required.'..name..'-value-tooltip'})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -303,8 +304,8 @@ Gui.element(function(_, parent)
|
|||||||
local value = child:get(player_name)
|
local value = child:get(player_name)
|
||||||
if value ~= nil or metadata.show_always then
|
if value ~= nil or metadata.show_always then
|
||||||
if metadata.stringify then value = metadata.stringify(value) end
|
if metadata.stringify then value = metadata.stringify(value) end
|
||||||
Gui.centered_label(settings, 140, metadata.name or name, metadata.tooltip)
|
Gui.centered_label(settings, 150, metadata.name or {'exp-settings.'..name}, metadata.tooltip or {'exp-settings.'..name..'-tooltip'})
|
||||||
Gui.centered_label(settings, 430, tostring(value), metadata.value_tooltip)
|
Gui.centered_label(settings, 420, tostring(value), metadata.value_tooltip or {'exp-settings.'..name..'-value-tooltip'})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -313,13 +314,14 @@ Gui.element(function(_, parent)
|
|||||||
if preference <= enum.Statistics then
|
if preference <= enum.Statistics then
|
||||||
local count = 4
|
local count = 4
|
||||||
local statistics = title_table(scroll_pane, 250, {'readme.data-statistics'}, 4)
|
local statistics = title_table(scroll_pane, 250, {'readme.data-statistics'}, 4)
|
||||||
for name, child in pairs(PlayerData.Statistics.children) do
|
for _, name in pairs(PlayerData.Statistics.metadata.display_order) do
|
||||||
|
local child = PlayerData.Statistics[name]
|
||||||
local metadata = child.metadata
|
local metadata = child.metadata
|
||||||
local value = child:get(player_name)
|
local value = child:get(player_name)
|
||||||
if value ~= nil or metadata.show_always then
|
if value ~= nil or metadata.show_always then
|
||||||
count = count - 2
|
count = count - 2
|
||||||
Gui.centered_label(statistics, 140, metadata.name or name, metadata.tooltip)
|
Gui.centered_label(statistics, 150, metadata.name or {'exp-statistics.'..name}, metadata.tooltip or {'exp-statistics.'..name..'-tooltip'})
|
||||||
Gui.centered_label(statistics, 140, tostring(value), metadata.value_tooltip)
|
Gui.centered_label(statistics, 130, format_number(value or 0), metadata.value_tooltip or {'exp-statistics.'..name..'-tooltip'})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if count > 0 then
|
if count > 0 then
|
||||||
@@ -338,8 +340,8 @@ Gui.element(function(_, parent)
|
|||||||
local value = child:get(player_name)
|
local value = child:get(player_name)
|
||||||
if value ~= nil or metadata.show_always then
|
if value ~= nil or metadata.show_always then
|
||||||
if metadata.stringify then value = metadata.stringify(value) end
|
if metadata.stringify then value = metadata.stringify(value) end
|
||||||
Gui.centered_label(misc, 140, metadata.name or name, metadata.tooltip)
|
Gui.centered_label(misc, 150, metadata.name or name, metadata.tooltip)
|
||||||
Gui.centered_label(misc, 430, tostring(value), metadata.value_tooltip)
|
Gui.centered_label(misc, 420, tostring(value), metadata.value_tooltip)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user