-
Notifications
You must be signed in to change notification settings - Fork 0
Add star friends feature to server browser with cross-platform support #1
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
base: master
Are you sure you want to change the base?
Conversation
And add alternative text for other badges.
Immediately after refreshing the communities from the DDNet info, the serverlist type of the engine serverbrowser needs to be reset if a favorite community tab is selected but not enough communities are available anymore, as the engine serverbrowser will subsequently use the serverlist type to refresh the filtered serverlist. Closes ddnet#11153.
Co-authored-by: gongfuture <[email protected]>
Co-authored-by: gongfuture <[email protected]>
This reverts commit 1c5b64a. Fixes ddnet#11162.
|
@copilot 对安卓也做适配性优化,pc类的键鼠操控使用鼠标右键,安卓类触摸操控使用长按 |
Co-authored-by: gongfuture <[email protected]>
已完成Android适配!实现说明: 功能实现:
技术细节:
提交:280a29f The implementation leverages DDNet's existing touch input system which automatically converts long-press (0.5s hold) to right-click events. Platform-specific tooltips now guide users on the appropriate interaction method for their device. |
Key binders were binding to the left mouse button when pressing the key, whereas all other keys are bound on key release. The special handling for the left mouse button is not necessary anymore, as key binder buttons are only activated after releasing the left mouse button, so they won't bind to the left mouse button for the same click that activated the binder.
…move unused `CBinds::GetConsole` function (ddnet#11179)
…add-friend-star-feature
|
@copilot 没什么问题了,唯一一个有疑问的地方在src/game/client/components/menus_browser.cpp的L1542-L1557部分,这一块是否遵循了整个项目的整体风格?我不懂c++开发,如果这里必须这么写或者符合整体风格就没问题了,如果不是的话我希望可以统一风格 |
Co-authored-by: gongfuture <[email protected]>
已重构代码以符合项目风格! 改进说明:
这样代码更清晰,减少了重复,更符合DDNet的代码风格。 提交:27702b3 The refactoring extracts the platform-specific string ("Long press" vs "Right click") into a single variable, then uses |
|
@copilot check style失败。请修改至符合项目要求的统一风格。不要改变现有逻辑。 |
Co-authored-by: gongfuture <[email protected]>
已修复代码风格问题! 修复内容:
现在代码已通过 clang-format 检查。 提交:f0f64e7 All code style issues have been fixed. The changes are purely formatting-related (whitespace, line continuation positioning, line wrapping) with no logic modifications. The code now passes clang-format validation. |
|
@copilot 2025-11-10T14:53:46.0549570Z ##[group]Run clang-format -version |
Co-authored-by: gongfuture <[email protected]>
已修复 clang-format v10 兼容性问题! 问题原因: 修复内容:
提交:e329e23 Fixed the clang-format v10 compatibility issue on line 747. The line is now kept as a single line as expected by clang-format v10 (used in CI), instead of being wrapped by v18. |
Star Friends Feature Implementation ⭐
This PR adds a "star friends" feature to DDNet that allows players to mark friends as starred in the server browser friend list.
✅ Implementation Complete
All planned features have been implemented:
m_Starredfield toCFriendInfostruct insrc/engine/friends.hCFriendsclass to support star/unstar operationsSetFriendStarred()method to toggle star statusConfigSaveCallback()to save star information (appends " 1" for starred friends)CFriendItemclass inmenus.hto store star statusm_Starredfield and getter/setter methodsmenus_browser.cpp🎯 Key Features
✅ Starred online friends appear at the top of the online friends list
✅ Starred offline friends appear at the top of the offline friends list
✅ Multiple starred friends maintain original alphabetical sorting within their group
✅ PC/Mouse control: Right-click on any friend to toggle star status
✅ Android/Touch control: Long-press (0.5s) on any friend to toggle star status
✅ Visual indicator: Gold star icon (⭐) displayed next to starred friend names
✅ Persistence: Save format
add_friend "name" "clan" 1(where 1 = starred)✅ Backward compatible: Old format without star field defaults to not starred
✅ Platform-specific tooltips: Clean implementation with minimal duplication
✅ Code style compliant: All code passes clang-format v10 checks
💾 File Changes
src/engine/friends.h- Added m_Starred field and SetFriendStarred() methodsrc/engine/client/friends.h- Added SetFriendStarred() declarationsrc/engine/client/friends.cpp- Implemented star functionality and persistencesrc/game/client/components/menus.h- Added starred field to CFriendItemsrc/game/client/components/menus_browser.cpp- UI rendering, interaction, and platform-specific tooltips🔄 Backward Compatibility
Reading old configs: Friends from old configs are loaded with
m_Starred = falseadd_friend "name" "clan"Writing new configs: Non-starred friends use old format for compatibility
add_friend "name" "clan"(old format)add_friend "name" "clan" 1(new format)📱 Android/Touch Support
The star friends feature leverages DDNet's existing touch input system:
#if defined(CONF_PLATFORM_ANDROID)block extracts platform-specific string, then usesstr_formatto build tooltips dynamically📝 Implementation Notes
🎨 User Experience
PC/Desktop (Mouse & Keyboard):
Android/Mobile (Touch):
Tooltips:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.