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

◆ UIModSourceItem()

Terraria.ModLoader.UI.UIModSourceItem.UIModSourceItem ( string mod,
LocalMod builtMod )
inline

Definition at line 42 of file UIModSourceItem.cs.

43 {
44 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
45 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
46 //IL_0034: Unknown result type (might be due to invalid IL or missing references)
47 //IL_014e: Unknown result type (might be due to invalid IL or missing references)
48 //IL_0154: Unknown result type (might be due to invalid IL or missing references)
49 //IL_0158: Unknown result type (might be due to invalid IL or missing references)
50 //IL_015e: Unknown result type (might be due to invalid IL or missing references)
51 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
52 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
53 //IL_016c: Unknown result type (might be due to invalid IL or missing references)
54 //IL_0172: Unknown result type (might be due to invalid IL or missing references)
55 //IL_01f7: Unknown result type (might be due to invalid IL or missing references)
56 //IL_01fd: Unknown result type (might be due to invalid IL or missing references)
57 //IL_0201: Unknown result type (might be due to invalid IL or missing references)
58 //IL_0207: Unknown result type (might be due to invalid IL or missing references)
59 //IL_020b: Unknown result type (might be due to invalid IL or missing references)
60 //IL_0211: Unknown result type (might be due to invalid IL or missing references)
61 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
62 //IL_021b: Unknown result type (might be due to invalid IL or missing references)
63 //IL_0318: Unknown result type (might be due to invalid IL or missing references)
64 //IL_031e: Unknown result type (might be due to invalid IL or missing references)
65 //IL_0322: Unknown result type (might be due to invalid IL or missing references)
66 //IL_0328: Unknown result type (might be due to invalid IL or missing references)
67 //IL_032c: Unknown result type (might be due to invalid IL or missing references)
68 //IL_0332: Unknown result type (might be due to invalid IL or missing references)
69 //IL_0336: Unknown result type (might be due to invalid IL or missing references)
70 //IL_033c: Unknown result type (might be due to invalid IL or missing references)
71 //IL_02b2: Unknown result type (might be due to invalid IL or missing references)
72 //IL_02b7: Unknown result type (might be due to invalid IL or missing references)
73 _mod = mod;
74 BorderColor = new Color(89, 116, 213) * 0.7f;
75 _dividerTexture = UICommon.DividerTexture;
76 Height.Pixels = 90f;
77 Width.Percent = 1f;
78 SetPadding(6f);
79 string addendum = (Path.GetFileName(mod).Contains(" ") ? (" [c/FF0000:" + Language.GetTextValue("tModLoader.MSModSourcesCantHaveSpaces") + "]") : "");
80 modName = Path.GetFileName(mod);
82 {
83 Left =
84 {
85 Pixels = 10f
86 },
87 Top =
88 {
89 Pixels = 5f
90 }
91 };
94 {
95 Width =
96 {
97 Pixels = 100f
98 },
99 Height =
100 {
101 Pixels = 36f
102 },
103 Left =
104 {
105 Pixels = 10f
106 },
107 Top =
108 {
109 Pixels = 40f
110 }
111 }.WithFadedMouseOver();
112 buildButton.PaddingTop -= 2f;
113 buildButton.PaddingBottom -= 2f;
114 buildButton.OnLeftClick += BuildMod;
118 buildReloadButton.Width.Pixels = 200f;
119 buildReloadButton.Left.Pixels = 150f;
120 buildReloadButton.WithFadedMouseOver();
121 buildReloadButton.OnLeftClick += BuildAndReload;
124 if (builtMod != null && LocalizationLoader.changedMods.Contains(modName))
125 {
126 needRebuildButton = new UIAutoScaleTextTextPanel<string>(Language.GetTextValue("tModLoader.MSRebuildRequired"));
128 needRebuildButton.Width.Pixels = 180f;
129 needRebuildButton.Left.Pixels = 360f;
130 needRebuildButton.BackgroundColor = Color.Red;
132 }
133 else if (builtMod != null)
134 {
137 publishButton.Width.Pixels = 100f;
138 publishButton.Left.Pixels = 390f;
139 publishButton.WithFadedMouseOver();
140 if (builtMod.properties.side == ModSide.Server)
141 {
142 publishButton.OnLeftClick += PublishServerSideMod;
144 }
145 else if (builtMod.Enabled)
146 {
147 publishButton.OnLeftClick += PublishMod;
149 }
150 }
151 base.OnLeftDoubleClick += BuildAndReload;
152 string modFolderName = Path.GetFileName(_mod);
153 string csprojFile = Path.Combine(_mod, modFolderName + ".csproj");
154 if (!File.Exists(csprojFile))
155 {
156 return;
157 }
158 UIHoverImage openCSProjButton = new UIHoverImage(UICommon.CopyCodeButtonTexture, Language.GetTextValue("tModLoader.MSOpenCSProj"))
159 {
160 Left =
161 {
162 Pixels = contextButtonsLeft,
163 Percent = 1f
164 },
165 Top =
166 {
167 Pixels = 4f
168 }
169 };
170 openCSProjButton.OnLeftClick += delegate
171 {
172 if (Platform.IsWindows)
173 {
174 Process.Start(new ProcessStartInfo("explorer", csprojFile)
175 {
176 UseShellExecute = true
177 });
178 }
179 else
180 {
182 {
183 UseShellExecute = true
184 });
185 }
186 };
188 contextButtonsLeft -= 26;
189 }
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 BuildMod(UIMouseEvent evt, UIElement listeningElement)
void BuildAndReload(UIMouseEvent evt, UIElement listeningElement)
void PublishMod(UIMouseEvent evt, UIElement listeningElement)
void PublishServerSideMod(UIMouseEvent evt, UIElement listeningElement)
readonly Asset< Texture2D > _dividerTexture
readonly UIAutoScaleTextTextPanel< string > needRebuildButton
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.UIModSourceItem._builtMod, Terraria.ModLoader.UI.UIModSourceItem._dividerTexture, Terraria.ModLoader.UI.UIModSourceItem._mod, Terraria.ModLoader.UI.UIModSourceItem._modName, Terraria.UI.UIElement.Append(), Terraria.GameContent.UI.Elements.UIPanel.BorderColor, Terraria.ModLoader.UI.UIModSourceItem.BuildAndReload(), Terraria.ModLoader.UI.UIModSourceItem.BuildMod(), Terraria.ModLoader.LocalizationLoader.changedMods, Terraria.ModLoader.UI.UIModSourceItem.contextButtonsLeft, Terraria.ModLoader.UI.UICommon.CopyCodeButtonTexture, Terraria.ModLoader.UI.UICommon.DividerTexture, Terraria.Localization.Language.GetTextValue(), Terraria.UI.UIElement.Height, Terraria.UI.UIElement.Left, Terraria.ModLoader.UI.UIModSourceItem.modName, Terraria.ModLoader.UI.UIModSourceItem.needRebuildButton, Terraria.ModLoader.UI.UIModSourceItem.PublishMod(), Terraria.ModLoader.UI.UIModSourceItem.PublishServerSideMod(), Terraria.UI.UIElement.SetPadding(), Terraria.UI.UIElement.Top, and Terraria.UI.UIElement.Width.

+ Here is the call graph for this function: