OpenRA / openrauseraccounts

Connect phpBB forum accounts to OpenRA installations
https://forum.openra.net/ucp.php?i=232
GNU General Public License v2.0
3 stars 3 forks source link

Make badge implementation more future-proof #14

Closed pchote closed 6 years ago

pchote commented 6 years ago

In the future I would like to add HiDPI glyph support to the UI, so we should design this in from the start.

The openra_badges table should rename badge_iconbadge_icon16

The profile yaml for badges should be formatted as:

Player:
    ...
    Badges:
        Badge@0:
            Label: First Badge Label
            Icon16: http://path/to/icon.png
        Badge@1:
            Label: Second Badge Label
            Icon16: http://path/to/icon.png
pchote commented 6 years ago

But note that i'm still not sure on what our base badge size should be. 16 is a little tight, so 24 may be better. This will only be clear once we have enough of the system working to be able to properly test the ingame UI.

ghost commented 6 years ago

Short update on badges:

Currently the ACP module for adding/editing/viewing badges does not check the image size. Badges will need to be added manually to ./images/badges, the only check it does is to check if the file ends on .png (replicated from acp_ranks.php which the module mode is based on.)

The module mode for associating badges to users is not ready yet so this will need to be done manually in the openra_user_badges table, i.e. the user_id and badge_id from openra_badges (primary key) will need to be inserted there. The badge data, badge_title, badge_icon_16 (that is just the filename) will be inserted in openra_badges by adding badges via the form in the working "Manage badges" module mode. The input for "Set to default badge" will insert true/false but this data is not used anywhere yet.

The controller will loop over all badges that are associated with the fingerprint (which is associated to the user_id and so on) and output the data just like in your example above.

pchote commented 6 years ago

This is done.