Skip to content
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

Merged
merged 5 commits into from
Dec 23, 2023
Merged

playerdata #256

merged 5 commits into from
Dec 23, 2023

Conversation

PHIDIAS0303
Copy link
Contributor

No description provided.

@PHIDIAS0303
Copy link
Contributor Author

#226

Copy link
Member

@Cooldude2606 Cooldude2606 left a 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

modules/gui/playerdata.lua Outdated Show resolved Hide resolved
modules/gui/playerdata.lua Outdated Show resolved Hide resolved
config/expcore/roles.lua Show resolved Hide resolved
modules/gui/playerdata.lua Outdated Show resolved Hide resolved
modules/gui/playerdata.lua Outdated Show resolved Hide resolved
Copy link
Member

@Cooldude2606 Cooldude2606 left a 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.

@Cooldude2606 Cooldude2606 merged commit 4fc9fbe into explosivegaming:dev Dec 23, 2023
3 checks passed
@PHIDIAS0303 PHIDIAS0303 deleted the dev2 branch December 25, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants