forked from tModLoader/tModLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatching_todo.txt
576 lines (477 loc) · 25.8 KB
/
patching_todo.txt
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
//Rartrin:
//Projectile.FishingCheck
//Make PlayerHooks.CatchFish and other related hooks use the new FishingAttempt struct.
//Move PlayerHooks.CatchFish and fishing related hooks to be each of the FishingCheck submethods.
//Terraria.GameContent.UI.States.UICharacterCreation.SetupPlayerStatsAndInventoryBasedOnDifficulty
//Add call to PlayerHooks.SetStartInventory here. Moved from Player constructor.
//Player
//Check if Player constructor still needs startupInventory arg
//Ensure ItemLoader.ConsumeItem hook was added to everywhere that a player can consume item.consumable.
//Make sure "22" replaced with "MaxBuffs" in 'for' and CountBuffs() == and !=.
//Ensure all blockLists are cleared everywhere that they need to be.
//Correct new allDamage increasing accessories
//Basically everywhere it would set itemTime and we would use PlayerHooks.TotalUseTime,
we can now let the game use ApplyItemTime, it has our hook built in.
//Fishing submethods will need to use Item instead of values.
//Ensure all ItemLoader.ConsumeItems have been added.
//Change all CheckMana() to use version with item passed in
//VanillaUpdateVanityAccessory --> ApplyEquipVanity
//Need reimplementing:
//TileLoader.HasSmartInteract
//NPCLoader.CanChat
//Add to NPCSmartInteractCandidateProvider.ProvideCandidate's npc loop checks.
//TileLoader.FixSmartInteractCoords
//Add to TileSmartInteractCandidateProvider.ProvideCandidate, right before the if with two Collision.InTileBounds calls.
//TileLoader
//Multiply item.axe by 1.2f before adding into the damage.
//WorldGen
//Add TileLoader.IsClosedDoor into WorldGen.IsLockedDoor check.
//Needs checking:
//WaterStyleLoader.WaterStyleCount
//Main
//Add IsAValidEquipmentSlotForIteration to VanillaUpdateAccessory check.
//Move to Main.ApplyMusicBox
+ if (SoundLoader.itemToMusic.ContainsKey(armor[l].type))
+ Main.musicBox2 = SoundLoader.itemToMusic[armor[l].type];
+ }
//Mirsario:
//Player:
//In ItemCheck_MeleeHitNPCs:
//Reimplement CanHitNPC hooks.
//These giant patches:
//{
@@ -28829,26 +29253,48 @@
continue;
if (!Main.npc[num310].dontTakeDamage) {
+ bool? modCanHit = ItemLoader.CanHitNPC(item, this, Main.npc[num310]);
+ if (modCanHit.HasValue && !modCanHit.Value)
+ continue;
+
+ bool? modCanBeHit = NPCLoader.CanBeHitByItem(Main.npc[num310], this, item);
+ if (modCanBeHit.HasValue && !modCanBeHit.Value)
+ continue;
+
+ bool? modCanHit2 = PlayerHooks.CanHitNPC(this, item, Main.npc[num310]);
+ if (modCanHit2.HasValue && !modCanHit2.Value)
+ continue;
+
+ bool canHitFlag = modCanHit.HasValue && modCanHit.Value || modCanBeHit.HasValue && modCanBeHit.Value || modCanHit2.HasValue && modCanHit2.Value;
- if (Main.npc[num310].friendly && (Main.npc[num310].type != 22 || !killGuide) && (Main.npc[num310].type != 54 || !killClothier))
+ if (!canHitFlag && (Main.npc[num310].friendly && (Main.npc[num310].type != 22 || !killGuide) && (Main.npc[num310].type != 54 || !killClothier)))
continue;
Rectangle value13 = new Rectangle((int)Main.npc[num310].position.X, (int)Main.npc[num310].position.Y, Main.npc[num310].width, Main.npc[num310].height);
if (!r2.Intersects(value13) || (!Main.npc[num310].noTileCollide && !CanHit(Main.npc[num310])))
continue;
- bool flag22 = false;
- if (item.melee && Main.rand.Next(1, 101) <= meleeCrit)
- flag22 = true;
-
- if (item.ranged && Main.rand.Next(1, 101) <= rangedCrit)
- flag22 = true;
-
- if (item.magic && Main.rand.Next(1, 101) <= magicCrit)
- flag22 = true;
-
- if (item.thrown && Main.rand.Next(1, 101) <= thrownCrit)
- flag22 = true;
-
+ // patch note: 1.3.6 should include changes: GetWeaponCrit()
+ bool flag22 = false; // flag22, is this hit a crit?
+ int critChance = 0;
+ if (item.melee)
+ critChance = meleeCrit;
+ else if (item.ranged)
+ critChance = rangedCrit;
+
+
+
+ else if (item.magic)
+ critChance = magicCrit;
+
+ else if (item.thrown)
+ critChance = thrownCrit;
+
+ else if (!item.summon) // custom damage class
+ critChance = item.crit;
+
+ ItemLoader.GetWeaponCrit(item, this, ref critChance);
+ PlayerHooks.GetWeaponCrit(this, item, ref critChance);
+ flag22 = critChance >= 100 || Main.rand.Next(1, 101) <= critChance;
int num311 = Item.NPCtoBanner(Main.npc[num310].BannerID());
if (num311 > 0 && NPCBannerBuff[num311])
num301 = ((!Main.expertMode) ? ((int)((float)num301 * ItemID.Sets.BannerStrength[Item.BannerToItem(num311)].NormalDamageDealt)) : ((int)((float)num301 * ItemID.Sets.BannerStrength[Item.BannerToItem(num311)].ExpertDamageDealt)));
//}
//Lighting:
//Re-add TileLoader.NearbyEffects calls (perhaps multiple) to somewhere in SceneMetrics
//Re-add this MusicBox logic, to somewhere in SceneMetrics:
if (TileLoader.IsModMusicBox(tile) && tile.frameX >= 36)
Main.musicBox = SoundLoader.tileToMusic[tile.type][tile.frameY / 36 * 36];
//Call this at the end of SceneMetrics.ScanAndExportToMain:
WorldHooks.TileCountsAvailable(_tileCounts);
//Resize the arrays that ScreenMetrics.UpdateOreFinderData uses.
//WorldGen:
//Test drops.
//Test modded grasses' behavior.
//Ensure that all of KillTile_GetTileDustAmount's calls have x,y parameters in other files:
//TileDrawing:
//Reimplement cactus drawing. Search for modCactus in Main.cs 1.3.5.3 tML diffs.
//Reimplement tree drawing. Search for modTree in Main.cs 1.3.5.3 tML diffs.
//Reimplement these calls:
TileLoader.DrawEffects(j, i, type, spriteBatch, ref color, ref nextSpecialDrawIndex);
TileLoader.PostDraw(x, y, type, spriteBatch);
//WallDrawing:
//Reimplement these calls:
if (!WallLoader.PreDraw(j, i, wall, spriteBatch)) {
WallLoader.PostDraw(j, i, wall, spriteBatch);
continue;
}
//Around line 130, after outline draws, put this:
WallLoader.PostDraw(j, i, wall, spriteBatch);
//Item:
//In Item.GetDrawHitbox, return the following size if it's not null.
itemAnimations[item[i].type]?.GetFrame(itemTexture[item[i].type])
//LegacyNetDiagnosticsUI:
//Add this to the end of PrintNetDiagnosticsLineForMessage
ModNet.DrawModDiagnoseNet();
//LegacySoundPlayer
//Re-add clamps for volume and pitch, 0.0..1.0 and -1.0..1.0 respectively?
//In PlaySound, before any playing:
case int _ when SoundLoader.PlayModSound(type, num, num2, num3, ref soundEffectInstance):
// Modders can return null to not play anything (prevent overlap), return the original sound effect (restarts sound), or return a new sound effect instance to allow overlapping sound.
break;
//In PlaySound, call this if the type is SoundLoader.customSoundType
// TODO, trackable sounds? verify working. return soundEffectInstance
SoundLoader.customSoundInstances[num].Stop();
SoundLoader.customSoundInstances[num] = SoundLoader.customSounds[num].CreateInstance();
SoundLoader.customSoundInstances[num].Volume = num2;
SoundLoader.customSoundInstances[num].Pan = num3;
//Main.PlaySoundInstance(SoundLoader.customSoundInstances[num]);
soundEffectInstance = SoundLoader.customSoundInstances[num];
//Put this in somewhere:
if (waveBank == null) //Supress extra exceptions from the audio engine failing to load
return null;
//LegacyPlayerRenderer:
//Reimplement all PlayerHeadDrawInfo & PlayerDrawInfo related stuff. Use 1.3.5.3 vanilla/tML diffs.
//There might need to be a redesign of the structs and the hooks that use it.
//Perhaps we won't even need the structs anymore.
//Remove all 'id<vanilla count' checks.
//Reimplement ItemLoader.DrawHair hook.
//Reimplement these calls from Main.DrawPlayer:
ItemLoader.DrawHands(drawPlayer, ref flag, ref flag2);
ItemLoader.DrawHair(drawPlayer, ref flag4, ref flag5);
ItemLoader.DrawArmorColor(EquipType.Head, drawPlayer.head, drawPlayer, shadow, ref color11, ref num12, ref newColor);
ItemLoader.DrawArmorColor(EquipType.Body, drawPlayer.body, drawPlayer, shadow, ref color12, ref num13, ref newColor2);
ItemLoader.ArmorArmGlowMask(drawPlayer.body, drawPlayer, shadow, ref num14, ref newColor3);
ItemLoader.DrawArmorColor(EquipType.Legs, drawPlayer.legs, drawPlayer, shadow, ref color14, ref num15, ref newColor4);
ItemLoader.DrawHands(drawPlayer, ref flag, ref flag2);
ProjectileLoader.DrawHeldProjInFrontOfHeldItemAndArms(projectile[drawPlayer.heldProj], ref flag3); //(multiple of these)
ItemLoader.DrawBody(drawPlayer) // ('if' check)
//Reimplement the following broken patches:
// {
+ bool fullBright = false;
+ PlayerHooks.DrawEffects(drawInfo, ref num18, ref num19, ref num20, ref num21, ref fullBright);
if (num18 != 1f || num19 != 1f || num20 != 1f || num21 != 1f) {
- if (drawPlayer.onFire || drawPlayer.onFire2 || drawPlayer.onFrostBurn) {
+ if (drawPlayer.onFire || drawPlayer.onFire2 || drawPlayer.onFrostBurn || fullBright) {
// }
// {
+ Vector2 holdoutOrigin = Vector2.Zero;
+ ItemLoader.HoldoutOrigin(drawPlayer, ref holdoutOrigin);
- value = new DrawData(itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((int)(value2.X - screenPosition.X + origin5.X + (float)num103), (int)(value2.Y - screenPosition.Y + (float)num104)), new Microsoft.Xna.Framework.Rectangle(0, 0, itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), num102, origin5, drawPlayer.inventory[drawPlayer.selectedItem].scale, spriteEffects2, 0);
+ value = new DrawData(itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((int)(value2.X - screenPosition.X + origin5.X + (float)num103), (int)(value2.Y - screenPosition.Y + (float)num104)), new Microsoft.Xna.Framework.Rectangle(0, 0, itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), num102, origin5 + holdoutOrigin, drawPlayer.inventory[drawPlayer.selectedItem].scale, spriteEffects2, 0);
// }
//Main:
//Add this to the end of Initialize():
#if SERVER
this.OpenSettings();
#endif
//Put this somewhere it fits. Was in Main.LoadTextures():
UICommon.LoadTextures();
//Define and pass modMusic and modPriority to UpdateAudio_DecideOnTOWMusic and UpdateAudio_DecideOnNewMusic methods...
int modMusic = -1;
MusicPriority modPriority = MusicPriority.None;
//...And put this after the calls.
ModHooks.UpdateMusic(ref modMusic, ref modPriority);
//Redo all the checks like that in both UpdateAudio_DecideOnTOWMusic and UpdateAudio_DecideOnNewMusic:
if (modPriority >= MusicPriority.Event) {
newMusic = modMusic;
}
//Put this somewhere high in DoUpdateInWorld:
if (netMode == 1 && Netplay.syncingWorld) // skip updating entities while world is loading in multiplayer #340
goto skipEntityUpdates;
//In DrawWaters, replace '13' in for check with
WaterStyleLoader.WaterStyleCount'
//Add this after DoUpdate_WhilePaused() call:
PlayerHooks.UpdateAutopause(player[myPlayer]);
//Add this to the middle of DrawBG() after definition of the used variable.
SurfaceBgStyleLoader.ChooseStyle(ref preferredBGStyleForPlayer);
//Add this near the end of Main.DrawItem, before the default drawing calls:
if(ItemLoader.animations.Contains(item.type))
ItemLoader.DrawAnimatedItem(item, whoAmI, color, alpha, rotation, scale);
goto PostDraw;
//Add this to the end of DrawSurfaceBG_BackMountainsStep2:
SurfaceBgStyleLoader.DrawMiddleTexture();
//Add this near the end of DrawSurfaceBG(), after SkyManager.Instance.DrawToDepth(spriteBatch, 1f); call:
FinishDrawCloseBackground:
SurfaceBgStyleLoader.DrawCloseBackground(num21);
//...Then make sure that all returns/continues before it are replaced with gotos to that statement.
//Find where the logo is rendered, and lower the position a bit.
//If still needed - replace Utils.WordwrapString call in Main.TextDisplayCache.PrepareCache with Utils.WordwrapStringSmart.
//Use old diffs in Main.GUIChatDrawInner
//Reimplement the entire ModifyTooltips hook call with all the tooltipNames filling, based on diffs of 1.3.5.3. See MouseText_DrawItemTooltip.
//In DrawProj, jump over drawing of all extras with a goto:
if (!ProjectileLoader.PreDrawExtras(projectile, spriteBatch)) {
goto DrawExtrasEnd;
}
//Reimplement these calls (unrelated to each other):
ModHooks.MidUpdateProjectileItem();
PlayerHooks.SendClientChanges(player[myPlayer], clientPlayer);
ProjectileLoader.PostDraw(projectile, spriteBatch, color25);
//Reimplement broken patches:
// {
if (nPC.aiStyle == 7)
DrawNPCExtras(n3, beforeDraw: false, num65, num64, color9, vector10, spriteEffects);
+NPCLoader.PostDraw(npc[iNPCIndex], spriteBatch, color9);
// }
// {
@@ -6674,41 +5292,48 @@
}
if (autoJoin) {
+ ModLoader.ModLoader.OnSuccessfulLoad += () => {
- LoadPlayers();
+ LoadPlayers();
- menuMode = 1;
+ menuMode = 1;
- menuMultiplayer = true;
+ menuMultiplayer = true;
+ };
}
fpsTimer.Start();
}
protected override void LoadContent() {
+ HiDefGraphicsIssues.OnLoadContent();
Configuration.Load();
+ ModLoader.ModLoader.MigrateSettings();
Configuration.Get("UseExperimentalFeatures", ref UseExperimentalFeatures);
if (UseExperimentalFeatures)
TexturePackSupport.Enabled = true;
Configuration.Get("Support4K", ref Support4K);
bool flag = Support4K && base.GraphicsDevice.Adapter.IsProfileSupported(GraphicsProfile.HiDef);
- if (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width <= 1920 && GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height <= 1200)
- flag = false;
-
+ // (resolution check removed) tModLoader will attempt to use HiDef even if the computer resolution doesn't need it to support newer shaders.
if (Support4K && flag)
- SetGraphicsProfile(GraphicsProfile.HiDef);
+ if (SetGraphicsProfile(GraphicsProfile.HiDef))
+ return; // changing the graphics profile triggers a device recreation and XNA will call `LoadContent` again
- TexturePackSupport.FindTexturePack();
+ TexturePackSupport.FindTexturePacks();
TextureManager.Initialize();
mapSectionTexture = new RenderTarget2D(base.GraphicsDevice, 200, 150);
- ShaderContentManager = new ContentManager(base.Content.ServiceProvider, base.Content.RootDirectory);
+ ShaderContentManager = new TMLContentManager(base.Content.ServiceProvider, base.Content.RootDirectory, AlternateContentManager);
PixelShaderRef.Value = ShaderContentManager.Load<Effect>("PixelShader");
TileShaderRef.Value = ShaderContentManager.Load<Effect>("TileShader");
ScreenShaderRef.Value = ShaderContentManager.Load<Effect>("ScreenShader");
// }
// {
@@ -16295,7 +16647,9 @@
}
try {
+ Texture2D modTopTextures;
if (type4 == 5 && frameY >= 198 && frameX >= 22) {
+ //frame
int num316 = 0;
switch (frameX) {
case 22: {
// }
// {
@@ -16309,11 +16663,22 @@
}
int num320 = 0;
+ //frame width
int num321 = 80;
+ //frame height
int num322 = 80;
+ //x offset left
int num323 = 32;
+ //y offset
int num324 = 0;
+ modTopTextures = null;
for (int num325 = num301; num325 < num301 + 100; num325++) {
+ modTopTextures = TileLoader.GetTreeTopTextures(tile[num300, num325].type,
+ num300, num325, ref num316, ref num321, ref num322, ref num323, ref num324);
+
+ if (modTopTextures != null)
+ break;
+
if (Main.tile[num300, num325].type == 2) {
num320 = GetTreeStyle(num300);
break;
// }
// {
@@ -16152,6 +16503,7 @@
int num298 = 0;
spriteBatch.Draw(texture2D2, new Vector2((float)(j * 16 - (int)screenPosition.X) - ((float)num9 - 16f) / 2f + (float)num297, i * 16 - (int)screenPosition.Y + num12 + num298) + value, empty, color6, 0f, default(Vector2), 1f, effects, 0f);
}
+ TileLoader.PostDraw(j, i, type, spriteBatch);
}
}
// }
// {
@@ -16380,10 +16745,12 @@
Lighting.AddLight(num300, num301, 0.1f, 0.2f + num326 / 2f, 0.7f + num326);
}
- if (tile6.color() > 0)
+ if (modTopTextures == null && tile6.color() > 0)
checkTreeAlt[num320, tile6.color()] = true;
+ if (modTopTextures != null)
+ spriteBatch.Draw(modTopTextures, new Vector2(num300 * 16 - (int)screenPosition.X - num323, num301 * 16 - (int)screenPosition.Y - num322 + 16 + num324) + value, new Microsoft.Xna.Framework.Rectangle(num316 * (num321 + 2), 0, num321, num322), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
- if (tile6.color() > 0 && treeAltTextureDrawn[num320, tile6.color()])
+ else if (tile6.color() > 0 && treeAltTextureDrawn[num320, tile6.color()])
spriteBatch.Draw(treeTopAltTexture[num320, tile6.color()], new Vector2(num300 * 16 - (int)screenPosition.X - num323, num301 * 16 - (int)screenPosition.Y - num322 + 16 + num324) + value, new Microsoft.Xna.Framework.Rectangle(num316 * (num321 + 2), 0, num321, num322), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
else
spriteBatch.Draw(treeTopTexture[num320], new Vector2(num300 * 16 - (int)screenPosition.X - num323, num301 * 16 - (int)screenPosition.Y - num322 + 16 + num324) + value, new Microsoft.Xna.Framework.Rectangle(num316 * (num321 + 2), 0, num321, num322), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
// }
// {
@@ -16401,7 +16768,13 @@
}
int num327 = 0;
+ Texture2D modBranchTextures = null;
for (int num328 = num301; num328 < num301 + 100; num328++) {
+ modBranchTextures = TileLoader.GetTreeBranchTextures(tile[num300 + 1, num328].type, num300, num328, 1, ref num316);
+
+ if (modBranchTextures != null)
+ break;
+
if (Main.tile[num300 + 1, num328].type == 2) {
num327 = GetTreeStyle(num300 + 1);
break;
// }
// {
@@ -16455,10 +16828,12 @@
Lighting.AddLight(num300, num301, 0.1f, 0.2f + num329 / 2f, 0.7f + num329);
}
- if (tile6.color() > 0)
+ if (modBranchTextures == null && tile6.color() > 0)
checkTreeAlt[num327, tile6.color()] = true;
+ if (modBranchTextures != null)
+ spriteBatch.Draw(modBranchTextures, new Vector2(num300 * 16 - (int)screenPosition.X - 24, num301 * 16 - (int)screenPosition.Y - 12) + value, new Microsoft.Xna.Framework.Rectangle(0, num316 * 42, 40, 40), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
- if (tile6.color() > 0 && treeAltTextureDrawn[num327, tile6.color()])
+ else if (tile6.color() > 0 && treeAltTextureDrawn[num327, tile6.color()])
spriteBatch.Draw(treeBranchAltTexture[num327, tile6.color()], new Vector2(num300 * 16 - (int)screenPosition.X - 24, num301 * 16 - (int)screenPosition.Y - 12) + value, new Microsoft.Xna.Framework.Rectangle(0, num316 * 42, 40, 40), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
else
spriteBatch.Draw(treeBranchTexture[num327], new Vector2(num300 * 16 - (int)screenPosition.X - 24, num301 * 16 - (int)screenPosition.Y - 12) + value, new Microsoft.Xna.Framework.Rectangle(0, num316 * 42, 40, 40), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
// }
// {
@@ -16476,7 +16851,13 @@
}
int num317 = 0;
+ Texture2D modBranchTextures = null;
for (int num318 = num301; num318 < num301 + 100; num318++) {
+ modBranchTextures = TileLoader.GetTreeBranchTextures(tile[num300 - 1, num318].type, num300, num318, -1, ref num316);
+
+ if (modBranchTextures != null)
+ break;
+
if (Main.tile[num300 - 1, num318].type == 2) {
num317 = GetTreeStyle(num300 - 1);
break;
// }
// {
@@ -16530,10 +16911,12 @@
Lighting.AddLight(num300, num301, 0.1f, 0.2f + num319 / 2f, 0.7f + num319);
}
- if (tile6.color() > 0)
+ if (modBranchTextures == null && tile6.color() > 0)
checkTreeAlt[num317, tile6.color()] = true;
+ if (modBranchTextures != null)
+ spriteBatch.Draw(modBranchTextures, new Vector2(num300 * 16 - (int)screenPosition.X, num301 * 16 - (int)screenPosition.Y - 12) + value, new Microsoft.Xna.Framework.Rectangle(42, num316 * 42, 40, 40), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
- if (tile6.color() > 0 && treeAltTextureDrawn[num317, tile6.color()])
+ else if (tile6.color() > 0 && treeAltTextureDrawn[num317, tile6.color()])
spriteBatch.Draw(treeBranchAltTexture[num317, tile6.color()], new Vector2(num300 * 16 - (int)screenPosition.X, num301 * 16 - (int)screenPosition.Y - 12) + value, new Microsoft.Xna.Framework.Rectangle(42, num316 * 42, 40, 40), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
else
spriteBatch.Draw(treeBranchTexture[num317], new Vector2(num300 * 16 - (int)screenPosition.X, num301 * 16 - (int)screenPosition.Y - 12) + value, new Microsoft.Xna.Framework.Rectangle(42, num316 * 42, 40, 40), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
// }
// {
@@ -16544,7 +16927,7 @@
}
if (type4 != 323 || frameX < 88 || frameX > 132)
- continue;
+ goto SpecialDraw;
int num330 = 0;
switch (frameX) {
// }
// {
@@ -16562,7 +16945,12 @@
int num334 = 80;
int num335 = 32;
int num336 = 0;
+ modTopTextures = null;
for (int num337 = num301; num337 < num301 + 100; num337++) {
+ modTopTextures = TileLoader.GetPalmTreeTopTextures(tile[num300, num337].type);
+ if (modTopTextures != null)
+ break;
+
if (Main.tile[num300, num337].type == 53) {
num332 = 0;
break;
// }
// {
@@ -16586,16 +16974,22 @@
int frameY3 = Main.tile[num300, num301].frameY;
int y3 = num332 * 82;
- if (tile6.color() > 0)
+ if (modTopTextures == null && tile6.color() > 0)
checkTreeAlt[num331, tile6.color()] = true;
+ if (modTopTextures != null)
+ spriteBatch.Draw(modTopTextures, new Vector2(num300 * 16 - (int)screenPosition.X - num335 + frameY3, num301 * 16 - (int)screenPosition.Y - num334 + 16 + num336) + value, new Microsoft.Xna.Framework.Rectangle(num330 * (num333 + 2), y3, num333, num334), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
- if (tile6.color() > 0 && treeAltTextureDrawn[num331, tile6.color()])
+ else if (tile6.color() > 0 && treeAltTextureDrawn[num331, tile6.color()])
spriteBatch.Draw(treeTopAltTexture[num331, tile6.color()], new Vector2(num300 * 16 - (int)screenPosition.X - num335 + frameY3, num301 * 16 - (int)screenPosition.Y - num334 + 16 + num336) + value, new Microsoft.Xna.Framework.Rectangle(num330 * (num333 + 2), y3, num333, num334), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
else
spriteBatch.Draw(treeTopTexture[num331], new Vector2(num300 * 16 - (int)screenPosition.X - num335 + frameY3, num301 * 16 - (int)screenPosition.Y - num334 + 16 + num336) + value, new Microsoft.Xna.Framework.Rectangle(num330 * (num333 + 2), y3, num333, num334), Lighting.GetColor(num300, num301), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
}
catch {
}
+
+ SpecialDraw:
+
+ TileLoader.SpecialDraw(type4, num300, num301, spriteBatch);
}
if (TileObject.objectPreview.Active && player[myPlayer].showItemIcon && placementPreview && !CaptureManager.Instance.Active) {
// }
// {
@@ -12580,18 +12880,30 @@
else if (array2[l]) {
black = (array3[l] ? new Microsoft.Xna.Framework.Color((byte)(190f * num18), (byte)(120f * num18), (byte)(120f * num18), a) : new Microsoft.Xna.Framework.Color((byte)(120f * num18), (byte)(190f * num18), (byte)(120f * num18), a));
}
- else if (l == currentLine - 1) {
+ else if (drawableLines[l].mod.Equals("Terraria") && drawableLines[l].Name.Equals("Price")) {
black = color;
}
- ChatManager.DrawColorCodedStringWithShadow(spriteBatch, fontMouseText, array[l], new Vector2(X, Y + num25), black, 0f, Vector2.Zero, Vector2.One);
+ drawableLines[l].color = black;
+ drawColor = black;
+ if (overrideColor[l].HasValue) {
+ drawColor = overrideColor[l].Value * num18;
+ drawableLines[l].overrideColor = drawColor;
+ }
+
+ if (ItemLoader.PreDrawTooltipLine(HoverItem, drawableLines[l], ref yOffset) && globalCanDraw)
+ ChatManager.DrawColorCodedStringWithShadow(spriteBatch, drawableLines[l].font, drawableLines[l].text, new Vector2((float)drawableLines[l].X, (float)drawableLines[l].Y), drawColor, drawableLines[l].rotation, drawableLines[l].origin, drawableLines[l].baseScale, drawableLines[l].maxWidth, drawableLines[l].spread);
+
+ ItemLoader.PostDrawTooltipLine(HoverItem, drawableLines[l]);
}
- num25 += (int)(fontMouseText.MeasureString(array[l]).Y + (float)num24);
+ Y += (int)(fontMouseText.MeasureString(array[l]).Y + yOffset);
}
+
+ ItemLoader.PostDrawTooltip(HoverItem, drawableLines.AsReadOnly());
}
- private void MouseText_DrawBuffString(ref int X, ref int Y) {
+ private void MouseText_DrawBuffString(ref int X, ref int Y, int buffNameHeight) {
Microsoft.Xna.Framework.Point p = new Microsoft.Xna.Framework.Point(X, Y);
int num = 220;
int num2 = -1;