forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManifestStore81.cs
More file actions
103 lines (92 loc) · 4.32 KB
/
ManifestStore81.cs
File metadata and controls
103 lines (92 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
using System;
using System.Xml.Linq;
using UnityEditor;
internal class ManifestStore81 : ManifestStore
{
private readonly XNamespace _m2Namespace = "http://schemas.microsoft.com/appx/2013/manifest";
protected override XElement CreateHumanInterfaceDeviceCapabilityElement() =>
this.CreateHumanInterfaceDeviceCapabilityElement(this._m2Namespace);
protected override XElement CreateInitialRotationPreferenceElement() =>
base.CreateInitialRotationPreferenceElement(this._m2Namespace, base.supportedOrientations);
protected override XElement CreatePackageElement()
{
XElement element = base.CreatePackageElement();
element.Add(new XAttribute((XName) (XNamespace.Xmlns + "m2"), this._m2Namespace));
return element;
}
protected override XElement CreateVisualElementsElement()
{
object[] content = new object[] { new XAttribute("DisplayName", PlayerSettings.productName), new XAttribute("Square150x150Logo", base.Images.storeTileLogo), new XAttribute("Square30x30Logo", base.Images.storeSmallLogo), new XAttribute("Description", PlayerSettings.WSA.applicationDescription), new XAttribute("ForegroundText", base.ForegroundText), new XAttribute("BackgroundColor", base.BackgroundColor) };
XElement element = new XElement((XName) (this._m2Namespace + "VisualElements"), content);
XElement defaultTileElement = this.GetDefaultTileElement();
if (defaultTileElement != null)
{
element.Add(defaultTileElement);
}
XElement splashScreenElement = base.GetSplashScreenElement(this._m2Namespace);
element.Add(splashScreenElement);
return element;
}
private XElement GetDefaultTileElement()
{
XElement element = new XElement((XName) (this._m2Namespace + "DefaultTile"));
string str = null;
switch (PlayerSettings.WSA.defaultTileSize)
{
case PlayerSettings.WSADefaultTileSize.NotSet:
break;
case PlayerSettings.WSADefaultTileSize.Medium:
str = "square150x150Logo";
break;
case PlayerSettings.WSADefaultTileSize.Wide:
str = "wide310x150Logo";
break;
default:
throw new Exception($"Invalid WSADefaultTileSize value ({PlayerSettings.WSA.defaultTileSize}).");
}
if (!string.IsNullOrEmpty(str))
{
element.Add(new XAttribute("DefaultSize", str));
}
string tileShortName = PlayerSettings.WSA.tileShortName;
if (!string.IsNullOrEmpty(tileShortName))
{
element.Add(new XAttribute("ShortName", tileShortName));
}
if (!string.IsNullOrEmpty(base.Images.storeTileWideLogo))
{
element.Add(new XAttribute("Wide310x150Logo", base.Images.storeTileWideLogo));
}
if (!string.IsNullOrEmpty(base.Images.storeSmallTile))
{
element.Add(new XAttribute("Square70x70Logo", base.Images.storeSmallTile));
}
if (!string.IsNullOrEmpty(base.Images.storeLargeTile))
{
element.Add(new XAttribute("Square310x310Logo", base.Images.storeLargeTile));
}
XElement showNameOnTilesElement = this.GetShowNameOnTilesElement();
if (showNameOnTilesElement != null)
{
element.Add(showNameOnTilesElement);
}
return ((!element.HasAttributes && !element.HasElements) ? null : element);
}
private XElement GetShowNameOnTilesElement()
{
XElement element = new XElement((XName) (this._m2Namespace + "ShowNameOnTiles"));
if (PlayerSettings.WSA.mediumTileShowName)
{
element.Add(new XElement((XName) (this._m2Namespace + "ShowOn"), new XAttribute("Tile", "square150x150Logo")));
}
if (PlayerSettings.WSA.largeTileShowName && !string.IsNullOrEmpty(base.Images.storeLargeTile))
{
element.Add(new XElement((XName) (this._m2Namespace + "ShowOn"), new XAttribute("Tile", "square310x310Logo")));
}
if (PlayerSettings.WSA.wideTileShowName && !string.IsNullOrEmpty(base.Images.storeTileWideLogo))
{
element.Add(new XElement((XName) (this._m2Namespace + "ShowOn"), new XAttribute("Tile", "wide310x150Logo")));
}
return (!element.HasElements ? null : element);
}
}