Supertux: Allow more profiles to be added and their names to change

Created on 12 Jul 2016  路  11Comments  路  Source: SuperTux/supertux

Currently, there are 5 profiles, which in many cases is more than enough, but sometimes it could be necessary to increase it. And I think the names of them, including names of the folders. This would be useful when there are many players or simply different types of play.

code functionality medium needs-discussion needs-work feature

Most helpful comment

Of course this would probably use some internal ID, most likely still numerical. Otherwise, the game could get confused easily.

All 11 comments

I will reopen this. I approve of the request and think we could implement it.

@brmbrmcar Learn to code, you can then help us first-hand.

Which file(s) control this thing (only saw src/supertux/menu/profile_menu.cpp/hpp)

For simplicity, I think only the display name of the profiles should be changed, internally they would still be "Profile 1", "Profile 2", etc. Maybe change some lines in https://github.com/SuperTux/supertux/blob/master/src/supertux/menu/profile_menu.cpp so that it reads the profile name from a file?

I don't like that. It would get confusing, add too many files and generally make manual stuff harder.

Of course this would probably use some internal ID, most likely still numerical. Otherwise, the game could get confused easily.

I guess so. But why not have the name then the number? (make sure that numbers cannot be placed at the end)

I think on each profile folder there should be a file called info or name which contains the profile name. Then when the game loads, it iterates for every folder (profile1, profile2, etc) and reads the contents of the file. If it doesn't exist, then it would create that file and set the name to "Profile X" (Where X is the profile id)

Why do we start with 5 profiles anyway? Why not start with only one and allow the number to increase?

@Karkus476 In my opinion the game should start with more than 1 profile, because the process of first adding a profile, naming it and only then being ready to play with a second profile might be a bit too slow, when there are already some profiles which you can use, you only have to select one and are ready to go.
I like the idea of having one file, which stores information about all the profiles. A file like maybe .profiles, or one could add it to the normal config, in which every profile number can be assigned a different name.

(profiles 
   (1 "My new profile")
   (2)
   (3 "New profile")
   (4)
   (5)
)

This file would only have to be read when the strings are loaded, or if the number of profiles could be variable it would have to be read once in order to determine how many profiles exist, the folder structure would stay the same.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kneekoo picture kneekoo  路  8Comments

HybridDog picture HybridDog  路  5Comments

Ordoviz picture Ordoviz  路  3Comments

Karkus476 picture Karkus476  路  5Comments

Wuzzy2 picture Wuzzy2  路  6Comments