feat(city): add bump-to-talk conversations with persistent context
Implements proximity-based street conversations between player characters and peers (human or agentic NPC). New PersonTalk model, controller, and migrations store daily message threads that persist across sessions and provide context for future interactions. Agent replies include backoff throttling and fallback persona handling to avoid dead-end chats. Frontend changes refactor the chat panel to support both character and agent peers, opening automatically when the player moves within range, polling for replies, rendering day separators, and displaying rate-limit warnings. Styling updated to a transparent blurred panel. Translations extended with new hint text and rate-limit messages across en, es, and pt_BR.
This commit is contained in:
@@ -237,14 +237,15 @@
|
||||
padding:.35rem .6rem; font-size:.75rem; color:var(--muted);">{{ __('city.hint') }}</span>
|
||||
</div>
|
||||
|
||||
{{-- Chat panel (bottom-right, like example images) --}}
|
||||
{{-- Chat panel (bottom-right, transparent — opens on bump) --}}
|
||||
<div id="chat-panel"
|
||||
style="position:absolute; right:.6rem; bottom:3.2rem; z-index:15; width:280px; display:none;
|
||||
background:rgba(15,23,42,.96); border:1px solid var(--border); border-radius:.6rem;
|
||||
overflow:hidden; box-shadow:0 12px 30px rgba(0,0,0,.5); flex-direction:column;">
|
||||
background:rgba(15,23,42,.62); backdrop-filter:blur(9px); -webkit-backdrop-filter:blur(9px);
|
||||
border:1px solid rgba(148,163,184,.3); border-radius:.6rem;
|
||||
overflow:hidden; box-shadow:0 12px 30px rgba(0,0,0,.45); flex-direction:column;">
|
||||
<div id="chat-header"
|
||||
style="display:flex; align-items:center; justify-content:space-between; gap:.5rem;
|
||||
padding:.55rem .7rem; background:rgba(30,41,59,.9); border-bottom:1px solid var(--border);">
|
||||
padding:.55rem .7rem; background:rgba(30,41,59,.55); border-bottom:1px solid rgba(148,163,184,.25);">
|
||||
<div style="display:flex; align-items:center; gap:.5rem; min-width:0;">
|
||||
<span id="chat-dot" style="width:8px; height:8px; border-radius:50%; background:#22c55e; flex-shrink:0;"></span>
|
||||
<div style="min-width:0;">
|
||||
@@ -323,6 +324,7 @@
|
||||
chatWith: @json(__('city.chat_with')),
|
||||
chatSend: @json(__('city.chat_send')),
|
||||
chatError: @json(__('city.chat_error')),
|
||||
talkRateLimited: @json(__('city.talk_ratelimited')),
|
||||
clock: @json(__('city.clock')),
|
||||
weather: @json(__('city.weather')),
|
||||
weather_clear: @json(__('city.weather_clear')),
|
||||
|
||||
Reference in New Issue
Block a user