mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-03-02 12:41:51 -03:00
feat: Matcha! social integration — friends, chat, DMs, avatars, presence
Add full Matcha social panel (butter.lat API) as a right-side slide-out: Backend (matchaService.js): - HTTP client for auth, friends, messages, unread, avatar, heartbeat APIs - WebSocket with auto-reconnect (exponential backoff, no hard cap) - Token management via config, presence heartbeat every 30s - WS error message type handling, game running presence Renderer (matcha.js): - State machine UI: intro → login/register → app (friends/chat/DMs/profile) - Two-phase registration with master key display and verification - Friends list with presence dots, collapsible requests, 12s polling - Global chat + DM with optimistic rendering, cursor pagination - Scroll position preserved on load-more, separate loading flags - Clickable URLs in messages (linkify with proper escaping) - User profile popup with avatar upload/delete - Unread badges (messages + friend requests) on nav icon - Escape key closes panel/overlay, try/catch on auth flows IPC bridge (preload.js + main.js): - 21 IPC invoke methods + 8 WS event listeners - Avatar upload via file picker dialog in main process - Game launch sets in_game heartbeat state CSS (style.css): - ~1500 lines: panel, auth screens, friends, chat, profile, toast - Responsive panel width, improved contrast, no overflow clipping - Loading states, disabled states, pulse animations Credits: Powered by Butter Launcher & Matcha! (butterlauncher.tech) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { initModsManager } from './mods.js';
|
||||
import './players.js';
|
||||
import './settings.js';
|
||||
import './logs.js';
|
||||
import { initMatcha } from './matcha.js';
|
||||
|
||||
let i18nInitialized = false;
|
||||
(async () => {
|
||||
@@ -15,10 +16,12 @@ let i18nInitialized = false;
|
||||
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
||||
updateLanguageSelector();
|
||||
initModsManager();
|
||||
initMatcha();
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
updateLanguageSelector();
|
||||
initModsManager();
|
||||
initMatcha();
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user