66using TSMapEditor . Models ;
77using TSMapEditor . Mutations ;
88using TSMapEditor . Mutations . Classes ;
9+ using TSMapEditor . Settings ;
910using TSMapEditor . UI . Controls ;
1011
1112namespace TSMapEditor . UI . Windows
@@ -26,6 +27,7 @@ public PlaceWaypointWindow(WindowManager windowManager, Map map, MutationManager
2627 private EditorNumberTextBox tbWaypointNumber ;
2728 private XNALabel lblDescription ;
2829 private XNADropDown ddWaypointColor ;
30+ private XNACheckBox chkDoNotSuggestMPStartingWaypoints ;
2931
3032 private Point2D cellCoords ;
3133
@@ -41,12 +43,16 @@ public override void Initialize()
4143 lblDescription = FindChild < XNALabel > ( nameof ( lblDescription ) ) ;
4244 lblDescription . Text = string . Format ( Translate ( this , "DescriptionText" , "Input waypoint number (0-{0}):" ) , Constants . MaxWaypoint - 1 ) ;
4345
46+ chkDoNotSuggestMPStartingWaypoints = FindChild < XNACheckBox > ( nameof ( chkDoNotSuggestMPStartingWaypoints ) ) ;
47+
4448 FindChild < EditorButton > ( "btnPlace" ) . LeftClick += BtnPlace_LeftClick ;
4549
4650 // Init color dropdown options
4751 ddWaypointColor = FindChild < XNADropDown > ( nameof ( ddWaypointColor ) ) ;
4852 ddWaypointColor . AddItem ( Translate ( this , "None" , "None" ) ) ;
4953 UIHelpers . AddColorOptionsToDropDown ( Waypoint . SupportedColors , ddWaypointColor ) ;
54+
55+ chkDoNotSuggestMPStartingWaypoints . Checked = UserSettings . Instance . DoNotSuggestMPStartingWaypoints ;
5056 }
5157
5258 private void BtnPlace_LeftClick ( object sender , EventArgs e )
@@ -80,6 +86,12 @@ public bool PlaceWaypoint(int waypointNumber, Point2D cellCoords)
8086 return false ;
8187 }
8288
89+ if ( chkDoNotSuggestMPStartingWaypoints . Checked != UserSettings . Instance . DoNotSuggestMPStartingWaypoints )
90+ {
91+ UserSettings . Instance . DoNotSuggestMPStartingWaypoints . UserDefinedValue = chkDoNotSuggestMPStartingWaypoints . Checked ;
92+ _ = UserSettings . Instance . SaveSettingsAsync ( ) ;
93+ }
94+
8395 string waypointColor = ddWaypointColor . SelectedItem != null ? ( string ) ddWaypointColor . SelectedItem . Tag : null ;
8496
8597 mutationManager . PerformMutation ( new PlaceWaypointMutation ( mutationTarget , cellCoords , waypointNumber , waypointColor ) ) ;
@@ -114,7 +126,7 @@ public int GetAvailableWaypointNumber()
114126 return - 1 ;
115127 }
116128
117- for ( int i = 0 ; i < Constants . MaxWaypoint ; i ++ )
129+ for ( int i = chkDoNotSuggestMPStartingWaypoints . Checked ? Constants . MultiplayerMaxPlayers : 0 ; i < Constants . MaxWaypoint ; i ++ )
118130 {
119131 if ( ! map . Waypoints . Exists ( w => w . Identifier == i ) && ( Constants . IsRA2YR || i != Constants . TS_WAYPT_SPECIAL ) )
120132 {
0 commit comments