-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
playerdata #256
playerdata #256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if changing the selected player would update the labels automatically. You can do this by moving the button on_click into a update_labels
function which is used by both the on click and on selection change.
Also a big FYI, the player data stats are designed to be iterable. See the readme window for an example:
for _, name in pairs(PlayerData.Statistics.metadata.display_order) do
local child = PlayerData.Statistics[name]
local metadata = child.metadata
local value = child:get(player_name)
if value ~= nil or metadata.show_always then
if metadata.stringify then
value = metadata.stringify(value)
else
value = format_number(value or 0)
end
Gui.centered_label(statistics, 150, metadata.name or {'exp-statistics.'..name}, metadata.tooltip or {'exp-statistics.'..name..'-tooltip'})
Gui.centered_label(statistics, 130, {'readme.data-format', value, metadata.unit or ''}, metadata.value_tooltip or {'exp-statistics.'..name..'-tooltip'})
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept works, I have cleaned up alot of it tho. Could you please review it yourself to confirm all functions are the same as you intended.
No description provided.