Skip to content

Commit e31c3e9

Browse files
committed
v5.0-beta.11
1 parent b833c35 commit e31c3e9

125 files changed

Lines changed: 6376 additions & 92 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Constructor5.Base/ElementSystem/Element.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public string CustomLabel
3434
set => _customLabel = !string.IsNullOrEmpty(value) ? value : null;
3535
}
3636

37+
public virtual bool Force31BitKey => false;
38+
3739
public string GeneratedLabel
3840
{
3941
get

Constructor5.Base/ExportSystem/Tuning/Utilities/ElementTuning.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Constructor5.Base.ElementSystem;
22
using Constructor5.Base.ProjectSystem;
3+
using System;
34
using System.Collections.Generic;
45
using System.Linq;
56

@@ -36,7 +37,16 @@ public static string GetFullName(Element element, string suffix = null)
3637
return result;
3738
}
3839

39-
public static ulong GetInstanceKeyFromName(Element element, string suffix) => FNVHasher.FNV32(GetFullName(element, suffix), true);
40+
public static ulong GetInstanceKeyFromName(Element element, string suffix)
41+
{
42+
var result = FNVHasher.FNV32(GetFullName(element, suffix), true);
43+
if (element.Force31BitKey)
44+
{
45+
var intResult = (int)result;
46+
result = (uint)Math.Abs(intResult);
47+
}
48+
return (ulong)result;
49+
}
4050

4151
public static ulong[] GetInstanceKeys(Reference reference)
4252
{

Constructor5.Base/LocalizationSystem/LocalizableTextStringsXML.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,5 +1298,47 @@ It is recommended you include your creator name in custom tags, to prevent confl
12981298
<String Key="UseCustomScoreType">Use Custom Score Type</String>
12991299
<String Key="InteractionAutoScoreTypeError">Mod Constructor does not have score data for the selected pie menu category, so the interaction will not be effected by Conversation Topic preferences from Growing Together. You can specify the score type manually in the "Advanced" tab.</String>
13001300

1301+
<String Key="AllowNewborn">Allow Newborn</String>
1302+
<String Key="AllowInfant">Allow Infant</String>
1303+
1304+
<String Key="BanBusySims">BanBusySims</String>
1305+
<String Key="Newborn">Newborn</String>
1306+
<String Key="Infant">Infant</String>
1307+
1308+
<String Key="PresetInfant">Preset: Infant</String>
1309+
1310+
<String Key="Milestone">Milestone</String>
1311+
<String Key="MilestoneInfo">Milestone Info</String>
1312+
<String Key="MilestoneGoalNotice">The Sim will receive the milestone after completing this goal. You can use the following text tokens in the description to display information:
1313+
{1.SimName} - target Sim name
1314+
{2.ObjectName} - target object name
1315+
{3.String} - lot name
1316+
{4.String} - world name
1317+
{5.String} - career name
1318+
{6.String} - career level
1319+
{7.String} - death type
1320+
{8.String} - trait name</String>
1321+
<String Key="Infant_FineMotor">Infant_FineMotor</String>
1322+
<String Key="Infant_GrossMotor">Infant_GrossMotor</String>
1323+
<String Key="Infant_Social">Infant_Social</String>
1324+
<String Key="Infant_Firsts">Infant_Firsts</String>
1325+
<String Key="Firsts">Firsts</String>
1326+
<String Key="Life">Life</String>
1327+
<String Key="Toddler_Cognitive">Toddler_Cognitive</String>
1328+
<String Key="Toddler_Motor">Toddler_Motor</String>
1329+
<String Key="IsRepeatable">Is Repeatable</String>
1330+
1331+
<String Key="ShowLocation">Show Location</String>
13011332

1333+
<String Key="ContextlessDescription">Contextless Description</String>
1334+
<String Key="ContextlessDescriptionHelp">If not empty, this will be displayed instead of the main description when context information is misssing (for example, if the target Sim has been deleted).</String>
1335+
<String Key="ShowTargetSim">Show Target Sim</String>
1336+
1337+
<String Key="DisplayWhenNotUnlocked">Display When Not Unlocked</String>
1338+
<String Key="NameWhenNotUnlocked">Name When Not Unlocked</String>
1339+
<String Key="DescriptionsWhenNotUnlocked">Descriptions When Not Unlocked</String>
1340+
1341+
<String Key="DisplayWhenNotUnlockedDescription">If this is enabled, the milestone has a chance to appear in the milestones panel before it has been unlocked.</String>
1342+
1343+
13021344
</LocalizableTextStrings>

Constructor5.Core/XmlLoader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Constructor5.Core;
21
using System;
32
using System.Collections.Generic;
43
using System.IO;
@@ -17,7 +16,8 @@ public static object LoadFile(Type type, string fileName)
1716

1817
using (var stream = File.OpenRead(fileName))
1918
{
20-
return LoadStream(type, stream);
19+
var result = LoadStream(type, stream);
20+
return result;
2121
}
2222
}
2323

Constructor5.Elements/CareerEvents/CareerEvent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Constructor5.Elements.CareerEvents
1212
{
13-
//[ElementTypeData("CareerEvent", true, ElementTypes = new[] { typeof(CareerEvent) }, PresetFolders = new[] { "CareerEvent" })]
13+
[ElementTypeData("CareerEvent", false, ElementTypes = new[] { typeof(CareerEvent) }, PresetFolders = new[] { "CareerEvent" })]
1414
public class CareerEvent : Element, IExportableElement, ISupportsCustomTuning
1515
{
1616
public Reference AdditionalRequiredVenue { get; set; } = new Reference();

Constructor5.Elements/CareerEvents/CareerEventMiniEditor.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<c:Field Label="GoldText" LabelWidth="100">
7878
<c:STBLStringControl Text="{Binding GoldText}" />
7979
</c:Field>
80-
<!--<CheckBox Content="ShowEndOfDayReport" IsChecked="{Binding ShowEndOfDayReport}" />
80+
<CheckBox Content="ShowEndOfDayReport" IsChecked="{Binding ShowEndOfDayReport}" />
8181
<c:Field
8282
Label="EndOfDayReportTitle"
8383
LabelWidth="100"
@@ -89,7 +89,7 @@
8989
LabelWidth="100"
9090
Visibility="{Binding ShowEndOfDayReport, Converter={StaticResource BoolToVis}}">
9191
<c:STBLStringControl Text="{Binding EndOfDayReportText}" />
92-
</c:Field>-->
92+
</c:Field>
9393
</StackPanel>
9494
</c:TabItem>
9595
<c:TabItem Header="Conditions">

Constructor5.Elements/Constructor5.Elements.csproj

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,23 @@
7575
<Reference Include="WindowsBase" />
7676
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
7777
<HintPath>..\packages\Extended.Wpf.Toolkit.4.2.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
78+
<Private>True</Private>
7879
</Reference>
7980
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
8081
<HintPath>..\packages\Extended.Wpf.Toolkit.4.2.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
82+
<Private>True</Private>
8183
</Reference>
8284
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
8385
<HintPath>..\packages\Extended.Wpf.Toolkit.4.2.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
86+
<Private>True</Private>
8487
</Reference>
8588
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
8689
<HintPath>..\packages\Extended.Wpf.Toolkit.4.2.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
90+
<Private>True</Private>
8791
</Reference>
8892
<Reference Include="Xceed.Wpf.Toolkit, Version=4.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
8993
<HintPath>..\packages\Extended.Wpf.Toolkit.4.2.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
94+
<Private>True</Private>
9095
</Reference>
9196
</ItemGroup>
9297
<ItemGroup>
@@ -498,6 +503,30 @@
498503
<Compile Include="LotTraits\LotTraitInfoEditor.xaml.cs">
499504
<DependentUpon>LotTraitInfoEditor.xaml</DependentUpon>
500505
</Compile>
506+
<Compile Include="Milestones\Milestone.cs" />
507+
<Compile Include="Milestones\MilestoneActionsOnComplete.cs" />
508+
<Compile Include="Milestones\MilestoneActionsOnCompleteEditor.xaml.cs">
509+
<DependentUpon>MilestoneActionsOnCompleteEditor.xaml</DependentUpon>
510+
</Compile>
511+
<Compile Include="Milestones\MilestoneCategories.cs" />
512+
<Compile Include="Milestones\MilestoneComponent.cs" />
513+
<Compile Include="Milestones\MilestoneContextModifier.cs" />
514+
<Compile Include="Milestones\MilestoneDisplayWhenNotUnlockedEditor.xaml.cs">
515+
<DependentUpon>MilestoneDisplayWhenNotUnlockedEditor.xaml</DependentUpon>
516+
</Compile>
517+
<Compile Include="Milestones\MilestoneEditor.xaml.cs">
518+
<DependentUpon>MilestoneEditor.xaml</DependentUpon>
519+
</Compile>
520+
<Compile Include="Milestones\MilestoneExportContext.cs" />
521+
<Compile Include="Milestones\MilestoneGoal.cs" />
522+
<Compile Include="Milestones\MilestoneGoalEditor.xaml.cs">
523+
<DependentUpon>MilestoneGoalEditor.xaml</DependentUpon>
524+
</Compile>
525+
<Compile Include="Milestones\MilestoneInfo.cs" />
526+
<Compile Include="Milestones\MilestoneInfoEditor.xaml.cs">
527+
<DependentUpon>MilestoneInfoEditor.xaml</DependentUpon>
528+
</Compile>
529+
<Compile Include="Milestones\MilestoneDisplayWhenNotUnlocked.cs" />
501530
<Compile Include="Need\Need.cs" />
502531
<Compile Include="ObjectiveSets\AssignedAspirationTrackContextModifier.cs" />
503532
<Compile Include="ObjectiveSets\CareerAssignmentGigContextModifier.cs" />
@@ -1216,6 +1245,26 @@
12161245
<SubType>Designer</SubType>
12171246
<Generator>MSBuild:Compile</Generator>
12181247
</Page>
1248+
<Page Include="Milestones\MilestoneActionsOnCompleteEditor.xaml">
1249+
<SubType>Designer</SubType>
1250+
<Generator>MSBuild:Compile</Generator>
1251+
</Page>
1252+
<Page Include="Milestones\MilestoneDisplayWhenNotUnlockedEditor.xaml">
1253+
<SubType>Designer</SubType>
1254+
<Generator>MSBuild:Compile</Generator>
1255+
</Page>
1256+
<Page Include="Milestones\MilestoneEditor.xaml">
1257+
<SubType>Designer</SubType>
1258+
<Generator>MSBuild:Compile</Generator>
1259+
</Page>
1260+
<Page Include="Milestones\MilestoneGoalEditor.xaml">
1261+
<SubType>Designer</SubType>
1262+
<Generator>MSBuild:Compile</Generator>
1263+
</Page>
1264+
<Page Include="Milestones\MilestoneInfoEditor.xaml">
1265+
<SubType>Designer</SubType>
1266+
<Generator>MSBuild:Compile</Generator>
1267+
</Page>
12191268
<Page Include="ObjectiveSets\ObjectiveSetEditor.xaml">
12201269
<SubType>Designer</SubType>
12211270
<Generator>MSBuild:Compile</Generator>

Constructor5.Elements/HolidayTraditions/Components/HolidayTraditionPreferencesComponent.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ namespace Constructor5.Elements.HolidayTraditions.Components
1010
[XmlSerializerExtraType]
1111
public class HolidayTraditionPreferencesComponent : HolidayTraditionComponent
1212
{
13+
public static Action<HolidayTraditionPreference> AddInfantPreference { get; set; }
1314
public static Action<HolidayTraditionPreference> AddToddlerPreference { get; set; }
1415
public override int ComponentDisplayOrder => 2;
1516
public override string ComponentLabel => "Preferences";
1617

1718
public ObservableCollection<HolidayTraditionPreference> Preferences { get; } = new ObservableCollection<HolidayTraditionPreference>();
1819

20+
public void SetInfantPreferencePreset(HolidayTraditionPreference preference)
21+
{
22+
preference.Reason.CustomText = "0x4CC304D3 <<< (From Being an Infant)";
23+
preference.Conditions.Clear();
24+
AddInfantPreference.Invoke(preference);
25+
}
26+
1927
public void SetToddlerPreferencePreset(HolidayTraditionPreference preference)
2028
{
2129
preference.Reason.CustomText = "0x175B27F3 <<< (From Being a Toddler)";

Constructor5.Elements/HolidayTraditions/Components/HolidayTraditionPreferencesEditor.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676

7777
<StackPanel Visibility="{Binding SelectedItem, ElementName=ListView, Converter={StaticResource NotNullToVis}}">
7878
<StackPanel Margin="{StaticResource Constructor.BigPaddingMinusTop}" Orientation="Horizontal">
79+
<c:Button x:Name="PresetInfantButton"
80+
Margin="2"
81+
Click="PresetInfantButton_Click"
82+
Content="PresetInfant" />
7983
<c:Button x:Name="PresetToddlerButton"
8084
Margin="2"
8185
Click="PresetToddlerButton_Click"

Constructor5.Elements/HolidayTraditions/Components/HolidayTraditionPreferencesEditor.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,11 @@ private void PresetChildButton_Click(object sender, System.Windows.RoutedEventAr
2626
preference.Conditions.Clear();
2727
AddChildPreference.Invoke(preference);
2828
}
29+
30+
private void PresetInfantButton_Click(object sender, System.Windows.RoutedEventArgs e)
31+
{
32+
var component = (HolidayTraditionPreferencesComponent)DataContext;
33+
component.SetInfantPreferencePreset((HolidayTraditionPreference)ListView.SelectedItem);
34+
}
2935
}
3036
}

0 commit comments

Comments
 (0)