Skip to content

Refactor: moved list of games appid to appids.py#9455

Closed
QtRoS wants to merge 1 commit intoValveSoftware:proton_10.0from
QtRoS:proton_10.0
Closed

Refactor: moved list of games appid to appids.py#9455
QtRoS wants to merge 1 commit intoValveSoftware:proton_10.0from
QtRoS:proton_10.0

Conversation

@QtRoS
Copy link
Copy Markdown

@QtRoS QtRoS commented Feb 1, 2026

Automatically parsed and replaced (with regexp, not AI) most of appid literals in proton. Why? Because 3 year old comment says:

#hopefully short-lived, app-specific workarounds for Proton bugs

Seems that it's time to make such lists legit, because makes codebase look a bit more solid :)

BTW, I left old ids in comments like this:

if appid in [
                AppID.AS_DUSK_FALLS, # 1341820
                AppID.CREATIVERSE, # 280790
                AppID.THE_ELDER_SCROLLS_ONLINE, # 306130

only to simplify review process. Once it's done they can be removed IMO.

P.S. Maybe this function worth adding to appids.py:

def name_to_constant(name):
    name = name.upper()
    name = re.sub(r"[\"'\[\]\(\):®]", '', name)
    name = re.sub(r'[ &\-\.,/+]+', '_', name)
    name = re.sub(r'__+', '_', name)
    return name.strip('_')

Later everyone can use it to add new games.

@QtRoS
Copy link
Copy Markdown
Author

QtRoS commented Mar 11, 2026

Any reviews on this?..

@ivyl
Copy link
Copy Markdown
Collaborator

ivyl commented Mar 12, 2026

Unnecessary code churn that makes looking up games and their overrides harder.

You can no longer look up just Tell Me Why 2 but have to remember to use underscores for TELL_ME_WHY_CHAPTER_2. Same with looking up via the game id, which we do even more often, - they are now opaquely contained in a separate file for the name-to-appid mapping.

@ivyl ivyl closed this Mar 12, 2026
@QtRoS
Copy link
Copy Markdown
Author

QtRoS commented Mar 12, 2026

@ivyl thanks for the review! My point was that game names in comments are not reliable and error-prone. But I guess it's not a problem if you think so. Anyway, feel free to reopen PR if you change your mind. Cheers!

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