ui: refine questionnaire sidebar visuals
This commit is contained in:
parent
6633b67b15
commit
edfbd83265
@ -2358,9 +2358,9 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: -1
|
||||
m_MinHeight: 26
|
||||
m_MinHeight: 34
|
||||
m_PreferredWidth: -1
|
||||
m_PreferredHeight: 28
|
||||
m_PreferredHeight: 36
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
@ -2594,7 +2594,7 @@ MonoBehaviour:
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 2
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &7097367071488276306
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2755,7 +2755,7 @@ MonoBehaviour:
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1.2
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &2346925351276876119
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2814,9 +2814,9 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 140
|
||||
m_MinHeight: 48
|
||||
m_MinHeight: 50
|
||||
m_PreferredWidth: 140
|
||||
m_PreferredHeight: 52
|
||||
m_PreferredHeight: 54
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
@ -3067,12 +3067,12 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 18
|
||||
m_fontSizeBase: 18
|
||||
m_fontSize: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
m_fontSizeMin: 12
|
||||
m_fontSizeMax: 18
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 20
|
||||
m_fontSizeMax: 24
|
||||
m_fontStyle: 1
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 512
|
||||
@ -3205,7 +3205,7 @@ MonoBehaviour:
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1.3
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &3377536488448164208
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3264,9 +3264,9 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 150
|
||||
m_MinHeight: 48
|
||||
m_MinHeight: 50
|
||||
m_PreferredWidth: 150
|
||||
m_PreferredHeight: 52
|
||||
m_PreferredHeight: 54
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
@ -3892,8 +3892,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 18
|
||||
m_fontSizeBase: 18
|
||||
m_fontSize: 20
|
||||
m_fontSizeBase: 20
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@ -4046,8 +4046,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 21
|
||||
m_fontSizeBase: 21
|
||||
m_fontSize: 22
|
||||
m_fontSizeBase: 22
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@ -4186,7 +4186,7 @@ MonoBehaviour:
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 2
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &102496170484188107
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4246,10 +4246,10 @@ MonoBehaviour:
|
||||
m_Padding:
|
||||
m_Left: 18
|
||||
m_Right: 18
|
||||
m_Top: 14
|
||||
m_Bottom: 14
|
||||
m_Top: 10
|
||||
m_Bottom: 10
|
||||
m_ChildAlignment: 0
|
||||
m_Spacing: 6
|
||||
m_Spacing: 5
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 0
|
||||
m_ChildControlWidth: 1
|
||||
@ -4271,9 +4271,9 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: -1
|
||||
m_MinHeight: 102
|
||||
m_MinHeight: 82
|
||||
m_PreferredWidth: -1
|
||||
m_PreferredHeight: 108
|
||||
m_PreferredHeight: 86
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
@ -4370,8 +4370,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 19
|
||||
m_fontSizeBase: 19
|
||||
m_fontSize: 22
|
||||
m_fontSizeBase: 22
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@ -4524,8 +4524,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 21
|
||||
m_fontSizeBase: 21
|
||||
m_fontSize: 22
|
||||
m_fontSizeBase: 22
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@ -4747,7 +4747,7 @@ MonoBehaviour:
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1.2
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &4317273200599489722
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4806,9 +4806,9 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 104
|
||||
m_MinHeight: 48
|
||||
m_MinHeight: 50
|
||||
m_PreferredWidth: 104
|
||||
m_PreferredHeight: 52
|
||||
m_PreferredHeight: 54
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
@ -5030,8 +5030,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 18
|
||||
m_fontSizeBase: 18
|
||||
m_fontSize: 20
|
||||
m_fontSizeBase: 20
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@ -5185,12 +5185,12 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 22
|
||||
m_fontSizeBase: 22
|
||||
m_fontSize: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
m_fontSizeMin: 12
|
||||
m_fontSizeMax: 22
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 20
|
||||
m_fontSizeMax: 24
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 512
|
||||
|
||||
@ -28,7 +28,7 @@ namespace TH1_UI.View.Outside
|
||||
public static readonly Color GoldColor = new Color(0.91372555f, 0.7176471f, 0.3647059f, 1f);
|
||||
public static readonly Color PanelTint = Color.white;
|
||||
public static readonly Color TransparentPanelTint = new Color(1f, 1f, 1f, 0f);
|
||||
public const float ItemButtonPixelsPerUnitMultiplier = 2f;
|
||||
public const float ItemButtonPixelsPerUnitMultiplier = 1f;
|
||||
|
||||
private const float SidebarWidth = 440f;
|
||||
private const float LibraryFrameHorizontalPadding = 86f;
|
||||
@ -43,8 +43,8 @@ namespace TH1_UI.View.Outside
|
||||
private const float DetailPanelSpacing = 22f;
|
||||
private const float DetailContentSpacing = 18f;
|
||||
private const float DetailHeaderSpacing = 6f;
|
||||
private const float PrimaryButtonPixelsPerUnitMultiplier = 1.3f;
|
||||
private const float SecondaryButtonPixelsPerUnitMultiplier = 1.2f;
|
||||
private const float PrimaryButtonPixelsPerUnitMultiplier = 1f;
|
||||
private const float SecondaryButtonPixelsPerUnitMultiplier = 1f;
|
||||
private const string SpriteFullscreenBackdrop = "TH1UI/Common/CommonBG/CommonVerticleStripeTileBG";
|
||||
private const string SpriteLibraryTopBar = "TH1UI/TechTree/TechTreeTopBar";
|
||||
private const string SpriteCommonWindow = "TH1UI/Common/CommonBG/CommonWindowBG";
|
||||
@ -332,14 +332,14 @@ namespace TH1_UI.View.Outside
|
||||
}
|
||||
else if (expired.Count > 0)
|
||||
{
|
||||
var hint = CreateText(_sidebarContent, "ExpiredHiddenHint", $"{expired.Count} 份往期问卷已收起", 17f,
|
||||
var hint = CreateText(_sidebarContent, "ExpiredHiddenHint", $"{expired.Count} 份往期问卷已收起", 20f,
|
||||
InkMutedColor, TextAlignmentOptions.Left);
|
||||
hint.enableWordWrapping = true;
|
||||
}
|
||||
|
||||
if (items.Count == 0)
|
||||
{
|
||||
var empty = CreateText(_sidebarContent, "EmptyList", "暂无可显示问卷", 18f,
|
||||
var empty = CreateText(_sidebarContent, "EmptyList", "暂无可显示问卷", 20f,
|
||||
InkMutedColor, TextAlignmentOptions.Left);
|
||||
empty.enableWordWrapping = true;
|
||||
}
|
||||
@ -349,7 +349,7 @@ namespace TH1_UI.View.Outside
|
||||
{
|
||||
if (infos == null || infos.Count == 0)
|
||||
{
|
||||
var empty = CreateText(_sidebarContent, "Empty", emptyText, 17f,
|
||||
var empty = CreateText(_sidebarContent, "Empty", emptyText, 20f,
|
||||
InkMutedColor, TextAlignmentOptions.Left);
|
||||
empty.enableWordWrapping = true;
|
||||
return;
|
||||
@ -380,8 +380,8 @@ namespace TH1_UI.View.Outside
|
||||
layout = row.AddComponent<VerticalLayoutGroup>();
|
||||
}
|
||||
|
||||
layout.padding = new RectOffset(18, 18, 14, 14);
|
||||
layout.spacing = 6f;
|
||||
layout.padding = new RectOffset(18, 18, 10, 10);
|
||||
layout.spacing = 5f;
|
||||
layout.childControlWidth = true;
|
||||
layout.childControlHeight = true;
|
||||
layout.childForceExpandWidth = true;
|
||||
@ -393,8 +393,8 @@ namespace TH1_UI.View.Outside
|
||||
layoutElement = row.AddComponent<LayoutElement>();
|
||||
}
|
||||
|
||||
layoutElement.minHeight = 102f;
|
||||
layoutElement.preferredHeight = 108f;
|
||||
layoutElement.minHeight = 82f;
|
||||
layoutElement.preferredHeight = 86f;
|
||||
|
||||
var button = row.GetComponent<Button>();
|
||||
if (button == null)
|
||||
@ -428,9 +428,10 @@ namespace TH1_UI.View.Outside
|
||||
headerLayout.childForceExpandHeight = false;
|
||||
headerLayout.childAlignment = TextAnchor.MiddleLeft;
|
||||
|
||||
var title = EnsureText(header.transform, "Title", ResolveText(info.Title), 22f,
|
||||
var title = EnsureText(header.transform, "Title", ResolveText(info.Title), 24f,
|
||||
InkColor, TextAlignmentOptions.Left);
|
||||
title.enableWordWrapping = true;
|
||||
title.enableAutoSizing = false;
|
||||
title.fontStyle = FontStyles.Bold;
|
||||
var titleLayout = title.GetComponent<LayoutElement>();
|
||||
if (titleLayout == null)
|
||||
@ -440,8 +441,9 @@ namespace TH1_UI.View.Outside
|
||||
|
||||
titleLayout.flexibleWidth = 1f;
|
||||
|
||||
var badge = EnsureText(header.transform, "Badge", GetStatusText(info), 18f,
|
||||
var badge = EnsureText(header.transform, "Badge", GetStatusText(info), 20f,
|
||||
GetStatusColor(info), TextAlignmentOptions.Right);
|
||||
badge.enableAutoSizing = false;
|
||||
var badgeLayout = badge.GetComponent<LayoutElement>();
|
||||
if (badgeLayout == null)
|
||||
{
|
||||
@ -450,9 +452,10 @@ namespace TH1_UI.View.Outside
|
||||
|
||||
badgeLayout.preferredWidth = 72f;
|
||||
|
||||
var meta = EnsureText(row.transform, "Meta", BuildListMetaText(info), 18f,
|
||||
var meta = EnsureText(row.transform, "Meta", BuildListMetaText(info), 20f,
|
||||
InkMutedColor, TextAlignmentOptions.Left);
|
||||
meta.enableWordWrapping = true;
|
||||
meta.enableAutoSizing = false;
|
||||
|
||||
_listItems.Add(new QuestionnaireListItem
|
||||
{
|
||||
@ -2084,10 +2087,11 @@ namespace TH1_UI.View.Outside
|
||||
{
|
||||
var go = InstantiateTemplate(SectionHeaderTemplate, parent, "SectionHeader");
|
||||
var header = go != null
|
||||
? EnsureText(go.transform, "Label", text, 18f, GoldColor, TextAlignmentOptions.Left)
|
||||
: CreateText(parent, "SectionHeader", text, 18f,
|
||||
? EnsureText(go.transform, "Label", text, 24f, GoldColor, TextAlignmentOptions.Left)
|
||||
: CreateText(parent, "SectionHeader", text, 24f,
|
||||
GoldColor, TextAlignmentOptions.Left);
|
||||
header.fontStyle = FontStyles.Bold;
|
||||
header.enableAutoSizing = false;
|
||||
}
|
||||
|
||||
private void CreateExpiredHeader(int expiredCount)
|
||||
@ -2095,8 +2099,10 @@ namespace TH1_UI.View.Outside
|
||||
var button = CreateButton(_sidebarContent, "ExpiredToggle", _showExpired ? "往期问卷 v" : "往期问卷 >",
|
||||
false, out _expiredToggleText, 0f);
|
||||
var layout = button.GetComponent<LayoutElement>();
|
||||
layout.minHeight = 34f;
|
||||
layout.preferredHeight = 36f;
|
||||
layout.minHeight = 42f;
|
||||
layout.preferredHeight = 44f;
|
||||
_expiredToggleText.fontSize = 22f;
|
||||
_expiredToggleText.fontSizeMin = 18f;
|
||||
if (expiredCount > 0)
|
||||
{
|
||||
_expiredToggleText.text = _showExpired ? $"往期问卷 ({expiredCount}) v" : $"往期问卷 ({expiredCount}) >";
|
||||
@ -2187,8 +2193,8 @@ namespace TH1_UI.View.Outside
|
||||
|
||||
layout.minWidth = preferredWidth > 0f ? preferredWidth : 120f;
|
||||
layout.preferredWidth = preferredWidth > 0f ? preferredWidth : 150f;
|
||||
layout.minHeight = 48f;
|
||||
layout.preferredHeight = 52f;
|
||||
layout.minHeight = 50f;
|
||||
layout.preferredHeight = 54f;
|
||||
|
||||
var image = EnsureImage(go.transform, PanelTint, true);
|
||||
ApplySprite(image, primary ? SpriteButtonPrimary : SpriteButtonSecondary, PanelTint, false,
|
||||
@ -2204,7 +2210,7 @@ namespace TH1_UI.View.Outside
|
||||
button.targetGraphic = image;
|
||||
button.onClick.RemoveAllListeners();
|
||||
|
||||
label = EnsureText(go.transform, "Label", text, 21f,
|
||||
label = EnsureText(go.transform, "Label", text, 22f,
|
||||
InkLightColor, TextAlignmentOptions.Center);
|
||||
label.rectTransform.anchorMin = Vector2.zero;
|
||||
label.rectTransform.anchorMax = Vector2.one;
|
||||
@ -2302,13 +2308,14 @@ namespace TH1_UI.View.Outside
|
||||
private GameObject EnsureSectionHeaderTemplate()
|
||||
{
|
||||
var go = FindOrCreateTemplate(_sidebarContent, "SectionHeaderTemplate", typeof(LayoutElement));
|
||||
var label = EnsureText(go.transform, "Label", "当期问卷", 18f, GoldColor, TextAlignmentOptions.Left);
|
||||
var label = EnsureText(go.transform, "Label", "当期问卷", 24f, GoldColor, TextAlignmentOptions.Left);
|
||||
label.fontStyle = FontStyles.Bold;
|
||||
label.enableWordWrapping = false;
|
||||
label.enableAutoSizing = false;
|
||||
|
||||
var layout = go.GetComponent<LayoutElement>();
|
||||
layout.minHeight = 26f;
|
||||
layout.preferredHeight = 28f;
|
||||
layout.minHeight = 34f;
|
||||
layout.preferredHeight = 36f;
|
||||
return go;
|
||||
}
|
||||
|
||||
@ -2320,16 +2327,16 @@ namespace TH1_UI.View.Outside
|
||||
ItemButtonPixelsPerUnitMultiplier);
|
||||
|
||||
var layout = go.GetComponent<VerticalLayoutGroup>();
|
||||
layout.padding = new RectOffset(18, 18, 14, 14);
|
||||
layout.spacing = 6f;
|
||||
layout.padding = new RectOffset(18, 18, 10, 10);
|
||||
layout.spacing = 5f;
|
||||
layout.childControlWidth = true;
|
||||
layout.childControlHeight = true;
|
||||
layout.childForceExpandWidth = true;
|
||||
layout.childForceExpandHeight = false;
|
||||
|
||||
var layoutElement = go.GetComponent<LayoutElement>();
|
||||
layoutElement.minHeight = 102f;
|
||||
layoutElement.preferredHeight = 108f;
|
||||
layoutElement.minHeight = 82f;
|
||||
layoutElement.preferredHeight = 86f;
|
||||
|
||||
var button = go.GetComponent<Button>();
|
||||
button.transition = Selectable.Transition.ColorTint;
|
||||
@ -2344,18 +2351,21 @@ namespace TH1_UI.View.Outside
|
||||
headerLayout.childForceExpandHeight = false;
|
||||
headerLayout.childAlignment = TextAnchor.MiddleLeft;
|
||||
|
||||
var title = EnsureText(header, "Title", "TOHOTOPIA玩法与策略反馈问卷", 22f, InkColor,
|
||||
var title = EnsureText(header, "Title", "TOHOTOPIA玩法与策略反馈问卷", 24f, InkColor,
|
||||
TextAlignmentOptions.Left);
|
||||
title.fontStyle = FontStyles.Bold;
|
||||
title.enableWordWrapping = true;
|
||||
title.enableAutoSizing = false;
|
||||
EnsureLayoutElement(title.gameObject).flexibleWidth = 1f;
|
||||
|
||||
var badge = EnsureText(header, "Badge", "当期", 18f, GoldColor, TextAlignmentOptions.Right);
|
||||
var badge = EnsureText(header, "Badge", "当期", 20f, GoldColor, TextAlignmentOptions.Right);
|
||||
badge.enableAutoSizing = false;
|
||||
EnsureLayoutElement(badge.gameObject).preferredWidth = 72f;
|
||||
|
||||
var meta = EnsureText(go.transform, "Meta", "22题 · 未填写", 18f, InkMutedColor,
|
||||
var meta = EnsureText(go.transform, "Meta", "22题 · 未填写", 20f, InkMutedColor,
|
||||
TextAlignmentOptions.Left);
|
||||
meta.enableWordWrapping = true;
|
||||
meta.enableAutoSizing = false;
|
||||
return go;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user