Files
novafarma/docs/CENTRAL_POPUP_GUIDE.md
2025-12-13 01:29:24 +01:00

193 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 📋 CENTRAL POPUP SYSTEM - Complete Guide
**Date**: December 13, 2025, 01:09
---
## ✅ WHAT IT DOES
### **Central Popups**
- Appears in **CENTER** of screen
- Always **in front** of player
- Pauses game (optional)
- Easy to read and interact
- Beautiful animations
### **Types of Popups**
1. **Quest** - Quest dialogs (📜)
2. **Story** - Story moments (📖)
3. **Info** - Information ()
4. **Success** - Success messages (✅)
5. **Warning** - Warnings (⚠️)
6. **Error** - Errors (❌)
---
## 🎮 HOW TO USE
### **Show Quest:**
```javascript
scene.centralPopup.showQuest(
'First Harvest',
'Plant and harvest your first crops!',
['Plant 5 seeds', 'Water them', 'Harvest when ready']
);
```
### **Show Story:**
```javascript
scene.centralPopup.showStory(
'Welcome to NovaFarma',
'You arrive at an abandoned farm. Time to rebuild!',
'farm_image' // optional image
);
```
### **Show Notification:**
```javascript
scene.centralPopup.showNotification('Quest completed!', 'success');
scene.centralPopup.showNotification('Low health!', 'warning');
```
### **Custom Popup:**
```javascript
scene.centralPopup.showPopup({
title: 'Custom Title',
message: 'Your message here',
type: 'info',
icon: '🎉',
buttons: [
{ text: 'Yes', callback: () => console.log('Yes!') },
{ text: 'No', action: 'close' }
],
autoClose: false
});
```
---
## 🎨 FEATURES
### **Automatic Positioning**
- Always centered on screen
- Responsive to screen size
- Scrolls with camera
### **Beautiful Design**
- Rounded corners
- Colored borders (based on type)
- Smooth animations
- Dark overlay behind
### **Interactive**
- Multiple buttons
- Hover effects
- Click handlers
- Auto-close option
### **Game Integration**
- Pauses game (optional)
- Sound effects
- Queue system (multiple popups)
- Priority levels
---
## 📊 POPUP TYPES & COLORS
| Type | Color | Border | Icon | Use For |
|------|-------|--------|------|---------|
| Quest | Brown | Gold | 📜 | Quests, missions |
| Story | Dark Blue | Purple | 📖 | Story moments |
| Info | Dark Gray | Gray | | Information |
| Success | Dark Green | Green | ✅ | Achievements |
| Warning | Dark Red | Red | ⚠️ | Warnings |
| Error | Dark Red | Red | ❌ | Errors |
---
## 🔧 SETTINGS
### **Enable/Disable:**
```javascript
scene.centralPopup.settings.enabled = false; // Disable
```
### **Auto-Close:**
```javascript
scene.centralPopup.settings.autoClose = true;
scene.centralPopup.settings.autoCloseDelay = 5000; // 5 seconds
```
### **Pause Game:**
```javascript
scene.centralPopup.settings.pauseGameOnPopup = true;
```
### **Sound:**
```javascript
scene.centralPopup.settings.soundOnPopup = true;
```
---
## 💡 EXAMPLES
### **Quest Accept/Decline:**
```javascript
scene.centralPopup.showPopup({
title: 'New Quest Available',
message: 'Help the farmer harvest crops!',
type: 'quest',
icon: '📜',
buttons: [
{
text: 'Accept',
callback: () => {
// Start quest
scene.questSystem.startQuest('harvest_quest');
}
},
{ text: 'Decline', action: 'close' }
],
autoClose: false
});
```
### **Story Cutscene:**
```javascript
scene.centralPopup.showStory(
'Day 1',
'The sun rises over your new farm. Time to get to work!',
'sunrise_image'
);
```
### **Achievement:**
```javascript
scene.centralPopup.showNotification(
'Achievement Unlocked: First Harvest!',
'success'
);
```
---
## 🎉 RESULT
**Perfect for:**
- ✅ Quest dialogs
- ✅ Story moments
- ✅ Important notifications
- ✅ Achievements
- ✅ Warnings
- ✅ Any message that needs attention!
**Always visible, always centered, always beautiful!** 📋✨
---
**Osveži igro s F5 da vidiš!** 🔄
*Created: December 13, 2025, 01:09*