File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed
Framework/Intersect.Framework.Core
Intersect.Server.Core/Maps Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 11using System . Runtime . Serialization ;
22using Intersect . Framework . Annotations ;
3+ using Intersect . Framework . Core . GameObjects . Maps ;
34using Newtonsoft . Json ;
5+ using Newtonsoft . Json . Converters ;
46
57namespace Intersect . Config ;
68
@@ -45,9 +47,9 @@ public bool EnableDiagonalMovement
4547
4648 /// <summary>
4749 /// The style of the game's border.
48- /// 0: Smart borders, 1: Non-seamless, 2: Black borders
4950 /// </summary>
50- public int GameBorderStyle { get ; set ; }
51+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
52+ public GameBorderStyle GameBorderStyle { get ; set ; }
5153
5254 /// <summary>
5355 /// The time, in milliseconds, until item attributes respawn on the map.
Original file line number Diff line number Diff line change 1+ namespace Intersect . Framework . Core . GameObjects . Maps ;
2+
3+ public enum GameBorderStyle
4+ {
5+ /// <summary>
6+ /// No transitions between adjacent maps but the camera is locked to map boundaries if the map has adjacent maps.
7+ /// </summary>
8+ Seamless = 0 ,
9+
10+ /// <summary>
11+ /// Camera is clamped to the boundaries of the current map, which causes a transition when moving to adjacent maps.
12+ /// </summary>
13+ /// <remarks>
14+ /// This only applies if the effective resolution (zoom shrinks this) is below the pixel dimensions of the map.
15+ /// </remarks>
16+ Seamed = 1 ,
17+
18+ /// <summary>
19+ /// No transitions between adjacent maps, and the camera is not locked to map boundaries ("black" borders).
20+ /// </summary>
21+ SeamlessUnbounded = 2 ,
22+ }
Original file line number Diff line number Diff line change 44using Intersect . Compression ;
55using Intersect . Core ;
66using Intersect . Enums ;
7+ using Intersect . Framework . Core . GameObjects . Maps ;
78using Intersect . GameObjects ;
89using Intersect . GameObjects . Maps ;
910using Intersect . Network . Packets . Server ;
@@ -94,10 +95,10 @@ public int MapGridY
9495 {
9596 switch ( Options . Instance . Map . GameBorderStyle )
9697 {
97- case 1 :
98+ case GameBorderStyle . Seamed :
9899 return [ true , true , true , true ] ;
99100
100- case 0 :
101+ case GameBorderStyle . Seamless :
101102 var grid = DbInterface . GetGrid ( MapGrid ) ;
102103 if ( grid != null )
103104 {
@@ -109,8 +110,13 @@ public int MapGridY
109110 grid . XMax - 1 == MapGridX ,
110111 ] ;
111112 }
113+ break ;
112114
115+ case GameBorderStyle . SeamlessUnbounded :
113116 break ;
117+
118+ default :
119+ throw new ArgumentOutOfRangeException ( ) ;
114120 }
115121
116122 return null ;
You can’t perform that action at this time.
0 commit comments