First pass over MPV for the cement-statue-sticker minigame (#63)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com> Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com> Reviewed-on: #63
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Minigames.StatueDressup.Data;
|
||||
|
||||
namespace AppleHills.Core.Settings
|
||||
{
|
||||
@@ -160,4 +161,45 @@ namespace AppleHills.Core.Settings
|
||||
// General Animation
|
||||
float DefaultAnimationDuration { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for statue dressup minigame settings
|
||||
/// </summary>
|
||||
public interface IStatueDressupSettings
|
||||
{
|
||||
// Decoration Display
|
||||
Vector2 DefaultAuthoredSize { get; }
|
||||
|
||||
// Decoration Content
|
||||
List<DecorationData> AllDecorations { get; }
|
||||
|
||||
// Menu Configuration
|
||||
int ItemsPerPage { get; }
|
||||
int GridColumns { get; }
|
||||
Vector2 GridSpacing { get; }
|
||||
|
||||
// Drag and Drop
|
||||
float DragScaleTransitionDuration { get; }
|
||||
float ReturnToMenuDuration { get; }
|
||||
float MinOverlapPercentage { get; }
|
||||
|
||||
// Animation
|
||||
float HoverScaleMultiplier { get; }
|
||||
float HoverAnimationDuration { get; }
|
||||
float PlacementAnimationDuration { get; }
|
||||
|
||||
// Photo Settings
|
||||
string PhotoSaveKey { get; }
|
||||
int PhotoQuality { get; }
|
||||
bool CaptureFullScreen { get; }
|
||||
|
||||
// Rewards
|
||||
int CardsRewardCount { get; }
|
||||
bool AutoCompleteOnPhoto { get; }
|
||||
|
||||
// State Persistence
|
||||
bool EnableStatePersistence { get; }
|
||||
string StateSaveKey { get; }
|
||||
int MaxSavedDecorations { get; }
|
||||
}
|
||||
}
|
||||
|
||||
149
Assets/Scripts/Core/Settings/StatueDressupSettings.cs
Normal file
149
Assets/Scripts/Core/Settings/StatueDressupSettings.cs
Normal file
@@ -0,0 +1,149 @@
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Core.Settings;
|
||||
using Minigames.StatueDressup.Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Core.Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// Settings for the Mr. Cement Statue Decoration minigame
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "StatueDressupSettings", menuName = "AppleHills/Settings/Statue Dressup", order = 7)]
|
||||
public class StatueDressupSettings : BaseSettings, IStatueDressupSettings
|
||||
{
|
||||
[Header("Decoration Display")]
|
||||
[Tooltip("Default full size for decorations when placed on statue")]
|
||||
[SerializeField] private Vector2 defaultAuthoredSize = new Vector2(128f, 128f);
|
||||
|
||||
[Header("Decoration Content")]
|
||||
[Tooltip("List of all available decoration data assets")]
|
||||
[SerializeField] private List<DecorationData> allDecorations = new List<DecorationData>();
|
||||
|
||||
[Header("Menu Configuration")]
|
||||
[Tooltip("Number of decoration items to display per page (2 columns x 5 rows = 10)")]
|
||||
[SerializeField] private int itemsPerPage = 10;
|
||||
|
||||
[Tooltip("Number of columns in the decoration grid")]
|
||||
[SerializeField] private int gridColumns = 2;
|
||||
|
||||
[Tooltip("Spacing between grid items")]
|
||||
[SerializeField] private Vector2 gridSpacing = new Vector2(10f, 10f);
|
||||
|
||||
[Header("Drag and Drop")]
|
||||
[Tooltip("Duration for icon to full size transition when dragging starts")]
|
||||
[SerializeField] private float dragScaleTransitionDuration = 0.2f;
|
||||
|
||||
[Tooltip("Duration for return to menu animation")]
|
||||
[SerializeField] private float returnToMenuDuration = 0.3f;
|
||||
|
||||
[Tooltip("Minimum overlap percentage required to place on statue (0-1)")]
|
||||
[SerializeField] private float minOverlapPercentage = 0.1f;
|
||||
|
||||
[Header("Animation")]
|
||||
[Tooltip("Scale multiplier for hover effect (1.0 = no change, 1.1 = 10% larger)")]
|
||||
[SerializeField] private float hoverScaleMultiplier = 1.05f;
|
||||
|
||||
[Tooltip("Duration of hover animation")]
|
||||
[SerializeField] private float hoverAnimationDuration = 0.2f;
|
||||
|
||||
[Tooltip("Duration for placement animation")]
|
||||
[SerializeField] private float placementAnimationDuration = 0.15f;
|
||||
|
||||
[Header("Photo Settings")]
|
||||
[Tooltip("PlayerPrefs key for saving the statue photo")]
|
||||
[SerializeField] private string photoSaveKey = "MrCementStatuePhoto";
|
||||
|
||||
[Tooltip("Quality of the captured photo (1-100)")]
|
||||
[SerializeField] private int photoQuality = 85;
|
||||
|
||||
[Tooltip("Whether to capture full screen or just statue area")]
|
||||
[SerializeField] private bool captureFullScreen;
|
||||
|
||||
[Header("Rewards")]
|
||||
[Tooltip("Number of Blokkemon cards awarded on completion")]
|
||||
[SerializeField] private int cardsRewardCount = 3;
|
||||
|
||||
[Tooltip("Whether completion is automatic or requires confirmation")]
|
||||
[SerializeField] private bool autoCompleteOnPhoto = true;
|
||||
|
||||
[Header("State Persistence")]
|
||||
[Tooltip("Whether to save decoration positions between sessions")]
|
||||
[SerializeField] private bool enableStatePersistence = true;
|
||||
|
||||
[Tooltip("PlayerPrefs key for saving decoration state")]
|
||||
[SerializeField] private string stateSaveKey = "StatueDecorationState";
|
||||
|
||||
[Tooltip("Maximum number of decorations to save")]
|
||||
[SerializeField] private int maxSavedDecorations = 50;
|
||||
|
||||
// IStatueDressupSettings implementation - Decoration Display
|
||||
public Vector2 DefaultAuthoredSize => defaultAuthoredSize;
|
||||
|
||||
// IStatueDressupSettings implementation - Decoration Content
|
||||
public List<DecorationData> AllDecorations => allDecorations;
|
||||
|
||||
// IStatueDressupSettings implementation - Menu Configuration
|
||||
public int ItemsPerPage => itemsPerPage;
|
||||
public int GridColumns => gridColumns;
|
||||
public Vector2 GridSpacing => gridSpacing;
|
||||
|
||||
// IStatueDressupSettings implementation - Drag and Drop
|
||||
public float DragScaleTransitionDuration => dragScaleTransitionDuration;
|
||||
public float ReturnToMenuDuration => returnToMenuDuration;
|
||||
public float MinOverlapPercentage => minOverlapPercentage;
|
||||
|
||||
// IStatueDressupSettings implementation - Animation
|
||||
public float HoverScaleMultiplier => hoverScaleMultiplier;
|
||||
public float HoverAnimationDuration => hoverAnimationDuration;
|
||||
public float PlacementAnimationDuration => placementAnimationDuration;
|
||||
|
||||
// IStatueDressupSettings implementation - Photo Settings
|
||||
public string PhotoSaveKey => photoSaveKey;
|
||||
public int PhotoQuality => photoQuality;
|
||||
public bool CaptureFullScreen => captureFullScreen;
|
||||
|
||||
// IStatueDressupSettings implementation - Rewards
|
||||
public int CardsRewardCount => cardsRewardCount;
|
||||
public bool AutoCompleteOnPhoto => autoCompleteOnPhoto;
|
||||
|
||||
// IStatueDressupSettings implementation - State Persistence
|
||||
public bool EnableStatePersistence => enableStatePersistence;
|
||||
public string StateSaveKey => stateSaveKey;
|
||||
public int MaxSavedDecorations => maxSavedDecorations;
|
||||
|
||||
public override void OnValidate()
|
||||
{
|
||||
base.OnValidate();
|
||||
|
||||
// Validate decoration display
|
||||
defaultAuthoredSize.x = Mathf.Max(32f, defaultAuthoredSize.x);
|
||||
defaultAuthoredSize.y = Mathf.Max(32f, defaultAuthoredSize.y);
|
||||
|
||||
// Validate menu configuration
|
||||
itemsPerPage = Mathf.Max(1, itemsPerPage);
|
||||
gridColumns = Mathf.Max(1, gridColumns);
|
||||
gridSpacing.x = Mathf.Max(0f, gridSpacing.x);
|
||||
gridSpacing.y = Mathf.Max(0f, gridSpacing.y);
|
||||
|
||||
// Validate drag and drop
|
||||
dragScaleTransitionDuration = Mathf.Max(0.01f, dragScaleTransitionDuration);
|
||||
returnToMenuDuration = Mathf.Max(0.01f, returnToMenuDuration);
|
||||
minOverlapPercentage = Mathf.Clamp01(minOverlapPercentage);
|
||||
|
||||
// Validate animation
|
||||
hoverScaleMultiplier = Mathf.Max(1f, hoverScaleMultiplier);
|
||||
hoverAnimationDuration = Mathf.Max(0.01f, hoverAnimationDuration);
|
||||
placementAnimationDuration = Mathf.Max(0.01f, placementAnimationDuration);
|
||||
|
||||
// Validate photo settings
|
||||
photoQuality = Mathf.Clamp(photoQuality, 1, 100);
|
||||
|
||||
// Validate rewards
|
||||
cardsRewardCount = Mathf.Max(0, cardsRewardCount);
|
||||
|
||||
// Validate state persistence
|
||||
maxSavedDecorations = Mathf.Max(1, maxSavedDecorations);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4fcf232a64e34f489b874519cc96339e
|
||||
timeCreated: 1763984221
|
||||
Reference in New Issue
Block a user