193 lines
3.8 KiB
Markdown
193 lines
3.8 KiB
Markdown
# 📋 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*
|