Changes

update deprecated source tags
Line 43: Line 43:  
|}
 
|}
 
Files like <tt>Data/ObjectInformation</tt> would be updated to use the new IDs:
 
Files like <tt>Data/ObjectInformation</tt> would be updated to use the new IDs:
<source lang="yaml">
+
<syntaxhighlight lang="yaml">
 
# old format
 
# old format
 
634: "Apricot/50/15/Basic -79/Apricot/A tender little fruit with a rock-hard pit."
 
634: "Apricot/50/15/Basic -79/Apricot/A tender little fruit with a rock-hard pit."
Line 51: Line 51:  
apricot: "634/Apricot/50/15/Basic -79/A tender little fruit with a rock-hard pit."
 
apricot: "634/Apricot/50/15/Basic -79/A tender little fruit with a rock-hard pit."
 
apricot_sapling: "629/Apricot Sapling/500/-300/Basic -74/Takes 28 days to produce a mature Apricot tree. Bears fruit in the spring. Only grows if the 8 surrounding \"tiles\" are empty."
 
apricot_sapling: "629/Apricot Sapling/500/-300/Basic -74/Takes 28 days to produce a mature Apricot tree. Bears fruit in the spring. Only grows if the 8 surrounding \"tiles\" are empty."
</source>
+
</syntaxhighlight>
 
With equivalent changes in files like <tt>Data/NPCGiftTastes</tt>:
 
With equivalent changes in files like <tt>Data/NPCGiftTastes</tt>:
<source lang="yaml">
+
<syntaxhighlight lang="yaml">
 
# old format
 
# old format
 
Universal_Like: "-2 -7 -26 -75 -80 72 395 613 634 635 636 637 638 724 459"
 
Universal_Like: "-2 -7 -26 -75 -80 72 395 613 634 635 636 637 638 724 459"
Line 59: Line 59:  
# new format
 
# new format
 
Universal_Like: "-2 -7 -26 -75 -80 apple apricot cherry coffee maple_syrup mead orange peach pomegranate shrimp"
 
Universal_Like: "-2 -7 -26 -75 -80 apple apricot cherry coffee maple_syrup mead orange peach pomegranate shrimp"
</source>
+
</syntaxhighlight>
    
Creating a vanilla item would use a key lookup like before:
 
Creating a vanilla item would use a key lookup like before:
<source lang="C#">
+
<syntaxhighlight lang="C#">
 
Object item = new Object("apricot"); // equivalent to new Object("apricot", "Maps/springobjects", 634, ...);
 
Object item = new Object("apricot"); // equivalent to new Object("apricot", "Maps/springobjects", 634, ...);
</source>
+
</syntaxhighlight>
    
This also avoids needing to check item types in most code (e.g. no need to exclude bigcraftables in gift tastes, since there's no possible ID overlap with the IDs listed in <tt>Data/NPCGiftTastes</tt>).
 
This also avoids needing to check item types in most code (e.g. no need to exclude bigcraftables in gift tastes, since there's no possible ID overlap with the IDs listed in <tt>Data/NPCGiftTastes</tt>).
Line 253: Line 253:  
|- valign="top"
 
|- valign="top"
 
| <tt>Crop.newDay</tt>
 
| <tt>Crop.newDay</tt>
| <source lang="c#">
+
| <syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (... || !this.seasonsToGrowIn.Contains(Game1.currentSeason) || ...)
 
if (... || !this.seasonsToGrowIn.Contains(Game1.currentSeason) || ...)
Line 259: Line 259:  
// to:  
 
// to:  
 
if (... || (!environment.IsGreenhouse && !this.seasonsToGrowIn.Contains(Game1.currentSeason)) || ...)
 
if (... || (!environment.IsGreenhouse && !this.seasonsToGrowIn.Contains(Game1.currentSeason)) || ...)
</source>
+
</syntaxhighlight>
 
|- valign="top"
 
|- valign="top"
 
| <tt>HoeDirt.canPlantThisSeedHere</tt>
 
| <tt>HoeDirt.canPlantThisSeedHere</tt>
| <source lang="c#">
+
| <syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (!Game1.currentLocation.IsOutdoors || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
 
if (!Game1.currentLocation.IsOutdoors || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
Line 268: Line 268:  
// to:
 
// to:
 
if (!Game1.currentLocation.IsOutdoors || Game1.currentLocation.IsGreenhouse || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
 
if (!Game1.currentLocation.IsOutdoors || Game1.currentLocation.IsGreenhouse || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
</source>
+
</syntaxhighlight>
 
|- valign="top"
 
|- valign="top"
 
| <tt>HoeDirt.plant</tt>
 
| <tt>HoeDirt.plant</tt>
| <source lang="c#">
+
| <syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (!who.currentLocation.isFarm && who.currentLocation.IsOutdoors)
 
if (!who.currentLocation.isFarm && who.currentLocation.IsOutdoors)
Line 277: Line 277:  
// to:  
 
// to:  
 
if (!who.currentLocation.isFarm && !who.currentLocation.IsGreenhouse && who.currentLocation.IsOutdoors)
 
if (!who.currentLocation.isFarm && !who.currentLocation.IsGreenhouse && who.currentLocation.IsOutdoors)
</source>
+
</syntaxhighlight>
<source lang="c#">
+
<syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (!who.currentLocation.isOutdoors || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
 
if (!who.currentLocation.isOutdoors || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
Line 284: Line 284:  
// to:
 
// to:
 
if (!who.currentLocation.isOutdoors || who.currentLocation.IsGreenhouse || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
 
if (!who.currentLocation.isOutdoors || who.currentLocation.IsGreenhouse || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
</source>
+
</syntaxhighlight>
 
|}
 
|}
 
</li>
 
</li>
Line 360: Line 360:  
|- valign="top"
 
|- valign="top"
 
| <tt>FruitTree.dayUpdate</tt>
 
| <tt>FruitTree.dayUpdate</tt>
| <source lang="c#">
+
| <syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (... && (!Game1.currentSeason.Equals("winter") || Game1.currentLocation.name.Value.ToLower().Contains("greenhouse")))
 
if (... && (!Game1.currentSeason.Equals("winter") || Game1.currentLocation.name.Value.ToLower().Contains("greenhouse")))
Line 366: Line 366:  
// to:  
 
// to:  
 
if (... && (!Game1.IsWinter || Game1.currentLocation.IsGreenhouse))
 
if (... && (!Game1.IsWinter || Game1.currentLocation.IsGreenhouse))
</source>
+
</syntaxhighlight>
<source lang="c#">
+
<syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (... || environment.name.Value.ToLower().Contains("greenhouse"))
 
if (... || environment.name.Value.ToLower().Contains("greenhouse"))
Line 374: Line 374:  
if (... || environment.IsGreenhouse)
 
if (... || environment.IsGreenhouse)
 
</source>
 
</source>
<source lang="c#">
+
<syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (environment.name.Value.ToLower().Contains("greenhouse"))
 
if (environment.name.Value.ToLower().Contains("greenhouse"))
Line 380: Line 380:  
// to:
 
// to:
 
if (environment.IsGreenhouse)
 
if (environment.IsGreenhouse)
</source>
+
</syntaxhighlight>
 
|- valign="top"
 
|- valign="top"
 
| <tt>FruitTree.performUseAction</tt>
 
| <tt>FruitTree.performUseAction</tt>
| <source lang="c#">
+
| <syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (... || Game1.currentLocation.name.Value.ToLower().Contains("greenhouse")))
 
if (... || Game1.currentLocation.name.Value.ToLower().Contains("greenhouse")))
Line 389: Line 389:  
// to:  
 
// to:  
 
if (... || Game1.currentLocation.IsGreenhouse))
 
if (... || Game1.currentLocation.IsGreenhouse))
</source>
+
</syntaxhighlight>
 
|- valign="top"
 
|- valign="top"
 
| <tt>Tree.dayUpdate</tt>
 
| <tt>Tree.dayUpdate</tt>
| <source lang="c#">
+
| <syntaxhighlight lang="c#">
 
// from:
 
// from:
 
if (!Game1.currentSeason.Equals("winter") || this.treeType == 6 || environment.Name.ToLower().Contains("greenhouse"))
 
if (!Game1.currentSeason.Equals("winter") || this.treeType == 6 || environment.Name.ToLower().Contains("greenhouse"))
Line 398: Line 398:  
// to:  
 
// to:  
 
if (!Game1.IsWinter || this.treeType == 6 || environment.IsGreenhouse)
 
if (!Game1.IsWinter || this.treeType == 6 || environment.IsGreenhouse)
</source>
+
</syntaxhighlight>
 
|}
 
|}
 
</li>
 
</li>
translators
8,438

edits