Improve controller editor visibility and Xbox shoulder labels#1697
Conversation
📝 WalkthroughWalkthroughUpdated gamepad shoulder and trigger labels to use LB/RB/LT/RT across localized resources, added explicit binding string mappings, and made input grid rendering semi-transparent. ChangesGamepad UI updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/src/main/java/com/winlator/widget/InputControlsView.java (1)
183-187: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueGrid translucency is hardcoded instead of using the existing
overlayOpacitysetting.The new semi-transparent colors (
0x80000000,0x80303030,0x99424242) achieve the intended "see-through editor" effect, but they're fixed constants rather than derived fromoverlayOpacity, which already drivesgetPrimaryColor()/getSecondaryColor()for control elements elsewhere in this class. As a result, the edit-mode background/grid won't respect the user's configured "controls_opacity" preference the way the rest of the overlay does.Consider deriving these alphas from
overlayOpacity(or a dedicated named constant) for consistency and easier tuning.Also applies to: 199-199
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/main/java/com/winlator/widget/InputControlsView.java` around lines 183 - 187, Replace the hardcoded alpha values used by the edit-mode background and grid drawing in InputControlsView with values derived from the existing overlayOpacity setting, consistent with getPrimaryColor() and getSecondaryColor(). Update all affected color assignments, including the additional color at the later grid-drawing location, while preserving the intended RGB values and using a clear conversion or named opacity constants.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/src/main/java/com/winlator/widget/InputControlsView.java`:
- Around line 183-187: Replace the hardcoded alpha values used by the edit-mode
background and grid drawing in InputControlsView with values derived from the
existing overlayOpacity setting, consistent with getPrimaryColor() and
getSecondaryColor(). Update all affected color assignments, including the
additional color at the later grid-drawing location, while preserving the
intended RGB values and using a clear conversion or named opacity constants.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1b584f9a-99a6-48ff-ac94-fc96bba15242
📒 Files selected for processing (17)
app/src/main/java/com/winlator/inputcontrols/Binding.javaapp/src/main/java/com/winlator/widget/InputControlsView.javaapp/src/main/res/values-da/strings.xmlapp/src/main/res/values-de/strings.xmlapp/src/main/res/values-es/strings.xmlapp/src/main/res/values-fr/strings.xmlapp/src/main/res/values-it/strings.xmlapp/src/main/res/values-ja/strings.xmlapp/src/main/res/values-ko/strings.xmlapp/src/main/res/values-pl/strings.xmlapp/src/main/res/values-pt-rBR/strings.xmlapp/src/main/res/values-ro/strings.xmlapp/src/main/res/values-ru/strings.xmlapp/src/main/res/values-uk/strings.xmlapp/src/main/res/values-zh-rCN/strings.xmlapp/src/main/res/values-zh-rTW/strings.xmlapp/src/main/res/values/strings.xml
There was a problem hiding this comment.
All reported issues were addressed across 17 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Description
These are requested features here: https://discord.com/channels/1378308569287622737/1524983521926709298/1524983631284670658
Adds a translucent edit-mode background so the game remains visible behind the on-screen controller editor. Purpose is so users can see the game while placing on-screen buttons to avoid putting them over in-game UI.
Renames displayed gamepad shoulder/trigger labels from PlayStation-style L1/R1/L2/R2 to Xbox-style LB/RB/LT/RT since our gamepad uses A,B,X,Y buttons so this makes more sense.
Recording
Type of Change
Checklist
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.CONTRIBUTING.md.Summary by cubic
Adds a translucent backdrop to the controller editor so the game stays visible while placing on-screen controls. Updates shoulder/trigger labels to Xbox-style LB/RB/LT/RT across the UI.
Binding.toString()and all localizedstrings.xmlentries.Written for commit 32625ef. Summary will update on new commits.
Summary by CodeRabbit