Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6437b14
KojuContent prefab and visual update
PerttRuo Aug 26, 2026
092c5a5
KojuContent cleanup
PerttRuo Aug 26, 2026
89a5f95
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Aug 27, 2026
f24c28d
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Aug 27, 2026
48b22f0
KojuPopupWindow visual update begun
PerttRuo Aug 27, 2026
b30e7a1
KojuPopupWindow visual update improvements
PerttRuo Aug 27, 2026
f65bf7b
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Aug 27, 2026
d7a0b98
KojuPopupWindow relocation started
PerttRuo Aug 27, 2026
249409d
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Aug 28, 2026
e70f129
KojuPopupWindow moved to KojuContent
PerttRuo Aug 28, 2026
bee1b5a
KojuContent and KojuPopupWindow layout improvements
PerttRuo Aug 28, 2026
5434698
FurnitureTray functionality update started
PerttRuo Aug 28, 2026
a090965
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Aug 31, 2026
6c8247f
FurnitureTray now closes when exited
PerttRuo Aug 31, 2026
4d0acff
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Sep 1, 2026
747d460
KojuContent fixes on layout and functionality
PerttRuo Sep 1, 2026
01a9052
More KojuPopupWindow and KojuContent fixes
PerttRuo Sep 1, 2026
bb78f9d
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Sep 2, 2026
80dc97b
KojuPopupWindow & KojuContent fixes
PerttRuo Sep 2, 2026
e100fca
RemovePopup layout and functionality update
PerttRuo Sep 3, 2026
b1b1075
Small fixes to KojuPopup
PerttRuo Sep 3, 2026
f1a9aa1
AdPoster, and Koju updates
PerttRuo Sep 4, 2026
47cd3e6
Work on AdEditor started
PerttRuo Sep 4, 2026
0f76344
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Sep 7, 2026
f69307b
AdEditor layout updates
PerttRuo Sep 7, 2026
1f7b7bc
AdPoster size fix and KojuContent slot fix
PerttRuo Sep 7, 2026
f83b056
JokuPanel muokkaus ja poisto ikkuna
PerttRuo Sep 8, 2026
dc84ee0
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Sep 8, 2026
1bca004
AdEditor update: buttons, color picker fix
PerttRuo Sep 8, 2026
d429916
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Sep 9, 2026
ba24511
AdText color edit
PerttRuo Sep 9, 2026
65055ab
AdEditor change text font in progress
PerttRuo Sep 9, 2026
940d05c
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Sep 10, 2026
ee2426a
AdEditor change text font
PerttRuo Sep 10, 2026
40d67db
Merge branch 'main' into UI/VarastoView/refactor/KojuContentVisualUpdate
PerttRuo Sep 11, 2026
efc23c5
AdEditor text color list
PerttRuo Sep 11, 2026
b2f1d10
AdEditor change furniture
PerttRuo Sep 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Assets/Altzone/Resources/Data/AdDecorationReference.asset

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions Assets/Altzone/Scripts/Model/Poco/Clan/AdData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public class AdStoreObject
{
public string _borderFrame;
public string _backgroundColour;
public TMPro.TMP_FontAsset _TextFont; // Uusi lis�ys (Perttu)
public string _TextColour; // Uusi lis�ys (Perttu)
public string _furniture; // Uusi lis�ys (Perttu)

public string BorderFrame
{
Expand All @@ -37,6 +40,45 @@ public string BackgroundColour
}
}

public TMPro.TMP_FontAsset TextFont // Uusi lis�ys (Perttu)
{
get => _TextFont;
set
{
if (value != null) _TextFont = value;
else
{
Debug.LogError($"Invalid font value: \"{value}\". Font not changed.");
}
}
}

public string TextColour // Uusi lis�ys (Perttu)
{
get => _TextColour;
set
{
if (ColorUtility.TryParseHtmlString(value, out Color colour)) _TextColour = value;
else
{
Debug.LogError($"Invalid colour value: \"{value}\". Text colour not changed.");
}
}
}

public string Furniture // Uusi lis�ys (Perttu)
{
get => _furniture;
set
{
if (AdDecorationReference.Instance.GetFurnitureSprite(value) != null) _furniture = value;
else
{
Debug.LogError($"Invalid furniture id: \"{value}\". Furniture not changed.");
}
}
}

public AdStoreObject(string border, string backgroundColour)
{
if (AdDecorationReference.Instance.GetBorderFrameSprite(border) != null) _borderFrame = border;
Expand All @@ -48,6 +90,17 @@ public AdStoreObject(string border, string backgroundColour)

if (ColorUtility.TryParseHtmlString(backgroundColour, out Color colour)) _backgroundColour = backgroundColour;
else _backgroundColour = "#E35000";

// Uusi lis�ys (Perttu)
//if (ColorUtility.TryParseHtmlString(adTextColour, out Color textColour)) _adTextColour = adTextColour;
//else _adTextColour = "#000000";

//if (AdDecorationReference.Instance.GetFurnitureSprite(furniture) != null) _furniture = furniture;
//else
//{
// Debug.LogWarning($"Invalid furniture id: \"{border}\". Using the default furniture.");
// _furniture = AdDecorationReference.Instance.FurnitureList[0].Name;
//}
}
}
}
101 changes: 101 additions & 0 deletions Assets/Altzone/Scripts/Reference Sheets/AdDecorationReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class AdDecorationReference : ScriptableObject

[SerializeField] private List<AdBorderFrameObject> _frameList;

[SerializeField] private List<AdFurnitureObject> _furnitureList; // Uusi lis�ys (Perttu)

[Header("Colours")]
[SerializeField] private Color _orangeColor;
[SerializeField] private Color _yellowColor;
Expand All @@ -20,9 +22,12 @@ public class AdDecorationReference : ScriptableObject
[SerializeField] private Color _purpleColor;
[SerializeField] private Color _darkPinkColor;
[SerializeField] private Color _redColor;
[SerializeField] private Color _blackColor; // Uusi lis�ys (Perttu)
private List<Color> _colourList;
private List<Color> _textColourList; // Uusi lis�ys (Perttu)

private List<AdBorderFrameObject> _validatedFrameList = null;
private List<AdFurnitureObject> _validatedFurnitureList = null; // Uusi lis�ys (Perttu)
private static AdDecorationReference _instance = null;
private static bool _hasInstance = false;

Expand All @@ -35,6 +40,16 @@ public List<AdBorderFrameObject> FrameList {
}
} // Public accessor for _info

public List<AdFurnitureObject> FurnitureList // Uusi lis�ys (Perttu)
{
get
{
if (_validatedFurnitureList == null) ValidateFurniture();
ValidateFurniture();
return _validatedFurnitureList;
}
}

public List<Color> ColourList
{
get
Expand All @@ -55,6 +70,26 @@ public List<Color> ColourList
}
}

public List<Color> TextColourList // Uusi lis�ys (Perttu)
{
get
{
if (_textColourList == null || _textColourList.Count == 0)
{
_textColourList = new();
_textColourList.Add(_blackColor);
_textColourList.Add(_yellowColor);
_textColourList.Add(_lightGreenColor);
_textColourList.Add(_lightBlueColor);
_textColourList.Add(_blueColor);
_textColourList.Add(_purpleColor);
_textColourList.Add(_darkPinkColor);
_textColourList.Add(_redColor);
}
return _textColourList;
}
}


public static AdDecorationReference Instance
{
Expand Down Expand Up @@ -119,6 +154,58 @@ private AdBorderFrameObject GetBorderFrame(string name)
}
return null;
}

// Uusi lis�ys (Perttu)
private void ValidateFurniture()
{
HashSet<string> uniqueNames = new();
HashSet<Sprite> uniqueMap = new();

if (_validatedFurnitureList != null && _validatedFurnitureList.Count > 0) return;
List<AdFurnitureObject> furnitures = new();
foreach (AdFurnitureObject furniture in _furnitureList)
{
if (!furniture.IsValid()) continue;

if (!uniqueNames.Add(furniture.Name))
{
Debug.LogError($"duplicate furniture Name {furniture.Name}");
}
if (!uniqueMap.Add(furniture.Image))
{
Debug.LogError($"duplicate furniture Image {furniture.Image}");
continue;
}
furnitures.Add(furniture);
}
_validatedFurnitureList = furnitures;
}
// Uusi lis�ys (Perttu)
public Sprite GetFurnitureSprite(string name)
{
AdFurnitureObject data = GetFurniture(name);
if (data == null) return null;
return data.Image;
}
// Uusi lis�ys (Perttu)
private AdFurnitureObject GetFurniture(string name)
{
//Debug.LogWarning($"Full name: {name}");
if (string.IsNullOrWhiteSpace(name))
{
return null;
}

foreach (AdFurnitureObject info in _furnitureList)
{
if (info.Name == name)
{
if (info.IsValid()) return info;
else return null;
}
}
return null;
}
}

[Serializable]
Expand All @@ -134,4 +221,18 @@ public bool IsValid()
return true;
}
}

[Serializable]
public class AdFurnitureObject // Uusi lis�ys (Perttu)
{
public string Name;
public Sprite Image;

public bool IsValid()
{
if (string.IsNullOrWhiteSpace(Name)) return false;
if (Image == null) return false;
return true;
}
}
}
Loading