TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ UIModDownloadItem()

Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.UIModDownloadItem ( ModDownloadItem modDownloadItem)
inline

Definition at line 78 of file UIModDownloadItem.cs.

79 {
80 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
81 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
82 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
83 //IL_0211: Unknown result type (might be due to invalid IL or missing references)
84 //IL_0216: Unknown result type (might be due to invalid IL or missing references)
85 //IL_0220: Unknown result type (might be due to invalid IL or missing references)
86 //IL_0227: Unknown result type (might be due to invalid IL or missing references)
87 //IL_022d: Unknown result type (might be due to invalid IL or missing references)
88 //IL_0231: Unknown result type (might be due to invalid IL or missing references)
89 //IL_0237: Unknown result type (might be due to invalid IL or missing references)
90 //IL_0249: Unknown result type (might be due to invalid IL or missing references)
91 //IL_0253: Unknown result type (might be due to invalid IL or missing references)
92 //IL_0258: Unknown result type (might be due to invalid IL or missing references)
94 BorderColor = new Color(89, 116, 213) * 0.7f;
95 _dividerTexture = UICommon.DividerTexture;
96 _innerPanelTexture = UICommon.InnerPanelTexture;
97 Height.Pixels = 90f;
98 Width.Percent = 1f;
99 SetPadding(6f);
100 float leftOffset = (HasModIcon ? ModIconAdjust : 0f);
101 _modName = new UIText(ModDownload.DisplayName)
102 {
103 Left = new StyleDimension(leftOffset + 5f, 0f),
104 Top =
105 {
106 Pixels = 5f
107 }
108 };
110 _moreInfoButton = new UIImage(UICommon.ButtonModInfoTexture)
111 {
112 Width =
113 {
114 Pixels = 36f
115 },
116 Height =
117 {
118 Pixels = 36f
119 },
120 Left =
121 {
122 Pixels = leftOffset
123 },
124 Top =
125 {
126 Pixels = 40f
127 }
128 };
129 _moreInfoButton.OnLeftClick += ViewModInfo;
131 Version modBuildVersion = ModDownload.ModloaderVersion;
132 tMLNeedUpdate = !BuildInfo.IsDev && BuildInfo.tMLVersion < modBuildVersion;
133 if (tMLNeedUpdate)
134 {
135 string updateVersion = $"v{modBuildVersion}";
136 bool lastMonth = BuildInfo.tMLVersion.Minor == 12;
137 if (BuildInfo.IsStable && new Version(modBuildVersion.Major, modBuildVersion.Minor) == new Version(BuildInfo.tMLVersion.Major + (lastMonth ? 1 : 0), BuildInfo.tMLVersion.Minor + ((!lastMonth) ? 1 : 0)))
138 {
139 updateVersion = "Preview " + updateVersion;
140 }
141 tMLUpdateRequired = new UIAutoScaleTextTextPanel<string>(Language.GetTextValue("tModLoader.MBRequiresTMLUpdate", updateVersion)).WithFadedMouseOver(Color.Orange, Color.Orange * 0.7f);
142 tMLUpdateRequired.BackgroundColor = Color.Orange * 0.7f;
144 tMLUpdateRequired.Width.Pixels = 340f;
145 tMLUpdateRequired.Left.Pixels += 41f;
146 tMLUpdateRequired.OnLeftClick += delegate
147 {
148 Utils.OpenToURL("https://github.com/tModLoader/tModLoader/releases/latest");
149 };
151 }
152 _updateButton = new UIImage(UICommon.ButtonExclamationTexture);
154 _updateButton.Left.Pixels += 41f;
155 _updateButton.OnLeftClick += ShowGameNeedsRestart;
156 _updateWithDepsButton = new UIImage(UICommon.ButtonDownloadMultipleTexture);
158 _updateWithDepsButton.Left.Pixels += 41f;
159 _updateWithDepsButton.OnLeftClick += DownloadWithDeps;
160 string modReferencesBySlug = ModDownload.ModReferencesBySlug;
161 if (modReferencesBySlug != null && modReferencesBySlug.Length > 0)
162 {
163 Asset<Texture2D> icon = UICommon.ButtonExclamationTexture;
164 UIHoverImage modReferenceIcon = new UIHoverImage(icon, Language.GetTextValue("tModLoader.MBClickToViewDependencyMods", string.Join("\n", from x in ModDownload.ModReferencesBySlug.Split(',')
165 select x.Trim())))
166 {
167 Left =
168 {
169 Pixels = (float)(-icon.Width()) - 5f,
170 Percent = 1f
171 }
172 };
173 modReferenceIcon.OnLeftClick += ShowModDependencies;
175 }
176 base.OnLeftDoubleClick += ViewModInfo;
178 }
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
void ViewModInfo(UIMouseEvent evt, UIElement listeningElement)
void ShowModDependencies(UIMouseEvent evt, UIElement element)
void ShowGameNeedsRestart(UIMouseEvent evt, UIElement element)
readonly UIAutoScaleTextTextPanel< string > tMLUpdateRequired
async void DownloadWithDeps(UIMouseEvent evt, UIElement listeningElement)
StyleDimension Height
Definition UIElement.cs:29
void Append(UIElement element)
Definition UIElement.cs:194
StyleDimension Left
Definition UIElement.cs:25
StyleDimension Width
Definition UIElement.cs:27
void SetPadding(float pixels)
Definition UIElement.cs:439
StyleDimension Top
Definition UIElement.cs:23

References Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem._dividerTexture, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem._innerPanelTexture, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem._modName, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem._moreInfoButton, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem._updateButton, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem._updateWithDepsButton, Terraria.UI.UIElement.Append(), Terraria.GameContent.UI.Elements.UIPanel.BorderColor, Terraria.ModLoader.UI.UICommon.ButtonDownloadMultipleTexture, Terraria.ModLoader.UI.UICommon.ButtonExclamationTexture, Terraria.ModLoader.UI.UICommon.ButtonModInfoTexture, Terraria.ModLoader.UI.UICommon.DividerTexture, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.DownloadWithDeps(), Terraria.Localization.Language.GetTextValue(), Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.HasModIcon, Terraria.UI.UIElement.Height, Terraria.ModLoader.UI.UICommon.InnerPanelTexture, Terraria.ModLoader.BuildInfo.IsStable, Terraria.UI.UIElement.Left, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.ModDownload, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.ModIconAdjust, Terraria.Utils.OpenToURL(), Terraria.UI.UIElement.SetPadding(), Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.ShowGameNeedsRestart(), Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.ShowModDependencies(), Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.tMLNeedUpdate, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.tMLUpdateRequired, Terraria.ModLoader.BuildInfo.tMLVersion, Terraria.UI.UIElement.Top, Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.UpdateInstallDisplayState(), Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.ViewModInfo(), and Terraria.UI.UIElement.Width.

Referenced by Terraria.ModLoader.UI.ModBrowser.UIModDownloadItem.ShowModDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: