ソースを参照

Map settlement names implemented

Axel Nordh 7 ヶ月 前
コミット
9aa352adb5
27 ファイル変更4713 行追加308 行削除
  1. 3 3
      Assets/Fonts/Noto_Color_Emoji/NotoColorEmoji-Regular SDF.asset
  2. 35 9
      Assets/Resources/MainSettings.asset
  3. 162 24
      Assets/Resources/UI/MapLegend.uss
  4. 55 46
      Assets/Resources/UI/MapLegend.uxml
  5. 5 0
      Assets/Resources/UI/MapLocationNameDisplay.uxml
  6. 9 0
      Assets/Resources/UI/MapLocationNamesLayer.uss
  7. 64 17
      Assets/Scenes/MapScene2.unity
  8. 15 1
      Assets/Scripts/Map/SettlementInteractionManager.cs
  9. 52 0
      Assets/Scripts/MapMaker2/Data/GeographicFeature.cs
  10. 296 0
      Assets/Scripts/MapMaker2/Features/GeographicFeatureGenerator.cs
  11. 172 0
      Assets/Scripts/MapMaker2/GeographicFeatureManager.cs
  12. 508 0
      Assets/Scripts/UI/MapScene/MapLegendUI.cs
  13. 217 0
      Assets/Scripts/UI/MapScene/MapLocationDebugger.cs
  14. 683 0
      Assets/Scripts/UI/MapScene/MapLocationNameDisplay.cs
  15. 228 0
      Assets/Scripts/UI/MapScene/MapLocationSystemInitializer.cs
  16. 342 0
      Assets/Scripts/UI/MapScene/MapLocationSystemSetup.cs
  17. 260 0
      Assets/Scripts/UI/MapScene/MapLocationTestHelper.cs
  18. 993 0
      Assets/Scripts/UI/MapScene/WorldSpaceLocationNames.cs
  19. 145 68
      Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset
  20. 0 51
      Assets/UI/Map/MapLegend.uxml
  21. 12 3
      Assets/UI/MapLegend.uss
  22. 0 51
      Assets/UI/MapLegend.uxml
  23. 5 0
      Assets/UI/MapLocationNameDisplay.uxml
  24. 69 0
      Assets/UI/MapLocationNames.uss
  25. 124 0
      MAPLOCATIONS_SETUP_GUIDE.md
  26. 224 0
      MAP_LOCATION_NAMES_LEGEND_GUIDE.md
  27. 35 35
      UserSettings/Layouts/default-6000.dwlt

+ 3 - 3
Assets/Fonts/Noto_Color_Emoji/NotoColorEmoji-Regular SDF.asset

@@ -73,9 +73,9 @@ Material:
     - _OutlineWidth: 0
     - _PerspectiveFilter: 0.875
     - _Reflectivity: 10
-    - _ScaleRatioA: 1
-    - _ScaleRatioB: 1
-    - _ScaleRatioC: 1
+    - _ScaleRatioA: 0.9767442
+    - _ScaleRatioB: 0.7936047
+    - _ScaleRatioC: 0.7936047
     - _ScaleX: 1
     - _ScaleY: 1
     - _ShaderFlags: 0

+ 35 - 9
Assets/Resources/MainSettings.asset

@@ -9,12 +9,38 @@ MonoBehaviour:
   m_GameObject: {fileID: 0}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
-  m_Name: TravelPanelSettings
-  themeUss: {fileID: -4733365628477956816, guid: 0000000000000000f000000000000000, type: 0}
-  targetTexture: {fileID: 0}
-  scaleMode: 1
-  scale: 1
-  fallbackDpi: 96
-  referenceDpi: 96
-  sortingOrder: 0
+  m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0}
+  m_Name: MainSettings
+  m_EditorClassIdentifier: 
+  themeUss: {fileID: -4733365628477956816, guid: 4b509a1dc4b36674aba0c952c3648165, type: 3}
+  m_DisableNoThemeWarning: 0
+  m_TargetTexture: {fileID: 0}
+  m_RenderMode: 0
+  m_WorldSpaceLayer: 0
+  m_ScaleMode: 1
+  m_ReferenceSpritePixelsPerUnit: 100
+  m_PixelsPerUnit: 100
+  m_Scale: 1
+  m_ReferenceDpi: 96
+  m_FallbackDpi: 96
+  m_ReferenceResolution: {x: 1200, y: 800}
+  m_ScreenMatchMode: 0
+  m_Match: 0
+  m_SortingOrder: 5
+  m_TargetDisplay: 0
+  m_BindingLogLevel: 0
+  m_ClearDepthStencil: 1
+  m_ClearColor: 0
+  m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0}
+  m_VertexBudget: 0
+  m_DynamicAtlasSettings:
+    m_MinAtlasSize: 64
+    m_MaxAtlasSize: 4096
+    m_MaxSubTextureSize: 64
+    m_ActiveFilters: -1
+  m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0}
+  m_RuntimeShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
+  m_RuntimeWorldShader: {fileID: 9102, guid: 0000000000000000f000000000000000, type: 0}
+  m_ICUDataAsset: {fileID: 0}
+  forceGammaRendering: 0
+  textSettings: {fileID: 0}

+ 162 - 24
Assets/Resources/UI/MapLegend.uss

@@ -1,52 +1,146 @@
-.legend-container {
+/* Map Legend UI Styles */
+
+.map-legend {
     position: absolute;
     top: 20px;
     left: 20px;
-    background-color: rgba(0, 0, 0, 0.8);
-    border-radius: 10px;
-    padding: 15px;
+    width: 280px;
     min-width: 250px;
-    border-width: 2px;
-    border-color: rgba(255, 255, 255, 0.3);
+    max-width: 350px;
+    flex-direction: column;
+}
+
+.legend-toggle-btn {
+    background-color: rgba(32, 32, 32, 0.95);
+    color: white;
+    border-top-left-radius: 8px;
+    border-top-right-radius: 8px;
+    border-bottom-left-radius: 0px;
+    border-bottom-right-radius: 0px;
+    border-width: 0px;
+    padding: 10px 15px;
+    font-size: 14px;
+    transition-duration: 0.3s;
+    transition-property: background-color;
+}
+
+.legend-toggle-btn:hover {
+    background-color: rgba(48, 48, 48, 0.95);
+}
+
+.legend-toggle-btn:active {
+    background-color: rgba(64, 64, 64, 0.95);
+}
+
+.legend-content {
+    background-color: rgba(16, 16, 16, 0.95);
+    border-bottom-left-radius: 8px;
+    border-bottom-right-radius: 8px;
+    border-top-width: 1px;
+    border-top-color: rgba(64, 64, 64, 0.8);
+    padding: 15px;
+    flex-direction: column;
 }
 
 .legend-title {
-    font-size: 18px;
+    font-size: 16px;
     color: white;
-    font-style: bold;
-    margin-bottom: 10px;
-    text-align: center;
+    -unity-font-style: bold;
+    margin-bottom: 12px;
+    -unity-text-align: upper-center;
 }
 
-.legend-items {
+.legend-section {
     margin-bottom: 15px;
+    flex-direction: column;
+}
+
+.legend-section-title {
+    font-size: 14px;
+    color: rgb(220, 220, 220);
+    -unity-font-style: bold;
+    margin-bottom: 8px;
+    padding-bottom: 4px;
+    border-bottom-width: 1px;
+    border-bottom-color: rgba(64, 64, 64, 0.6);
 }
 
 .legend-item {
     flex-direction: row;
     align-items: center;
-    margin-bottom: 5px;
+    margin-bottom: 6px;
+    padding: 2px 0px;
 }
 
 .color-box {
-    width: 20px;
-    height: 20px;
+    width: 16px;
+    height: 16px;
+    border-radius: 2px;
     margin-right: 10px;
-    border-radius: 3px;
     border-width: 1px;
-    border-color: rgba(255, 255, 255, 0.5);
+    border-color: rgba(255, 255, 255, 0.3);
 }
 
 .legend-text {
-    color: white;
-    font-size: 14px;
+    color: rgb(200, 200, 200);
+    font-size: 12px;
     flex-grow: 1;
 }
 
+.name-toggle {
+    margin-bottom: 6px;
+    color: rgb(200, 200, 200);
+}
+
+.name-toggle Label {
+    color: rgb(200, 200, 200);
+    font-size: 12px;
+}
+
+.name-toggle > .unity-toggle__input {
+    background-color: rgba(64, 64, 64, 0.8);
+    border-color: rgba(128, 128, 128, 0.6);
+    border-radius: 3px;
+}
+
+.name-toggle > .unity-toggle__input:checked {
+    background-color: rgba(0, 128, 255, 0.8);
+    border-color: rgba(0, 128, 255, 1.0);
+}
+
+.name-toggle > .unity-toggle__input > .unity-toggle__checkmark {
+    background-color: white;
+    border-radius: 1px;
+}
+
 .controls-info {
     border-top-width: 1px;
-    border-top-color: rgba(255, 255, 255, 0.3);
+    border-top-color: rgba(64, 64, 64, 0.6);
     padding-top: 10px;
+    margin-bottom: 0px;
+}
+
+.controls-text {
+    color: rgba(180, 180, 180, 0.9);
+    font-size: 11px;
+    margin-bottom: 3px;
+}
+
+/* Legacy styles for compatibility */
+.legend-container {
+    position: absolute;
+    top: 20px;
+    left: 20px;
+    background-color: rgba(0, 0, 0, 0.8);
+    border-radius: 10px;
+    padding: 15px;
+    min-width: 250px;
+    border-width: 2px;
+    border-color: rgba(255, 255, 255, 0.3);
+}
+
+.legend-items {
+    margin-bottom: 15px;
 }
 
 .controls-title {
@@ -64,23 +158,23 @@
 
 /* Color definitions matching your WorldMapGenerator colors */
 .ocean-color {
-    background-color: rgb(0, 0, 255); /* Blue */
+    background-color: rgb(0, 100, 200); /* Blue */
 }
 
 .river-color {
-    background-color: rgb(0, 255, 255); /* Cyan */
+    background-color: rgb(64, 164, 223); /* Light Blue */
 }
 
 .plain-color {
-    background-color: rgb(0, 128, 0); /* Green */
+    background-color: rgb(124, 178, 124); /* Light Green */
 }
 
 .forest-color {
-    background-color: rgb(51, 179, 51); /* Dark green (0.2, 0.7, 0.2) */
+    background-color: rgb(34, 139, 34); /* Forest Green */
 }
 
 .mountain-color {
-    background-color: rgb(128, 128, 128); /* Gray */
+    background-color: rgb(139, 139, 139); /* Gray */
 }
 
 .town-color {
@@ -98,3 +192,47 @@
 .dock-color {
     background-color: rgb(102, 77, 51); /* Dark brown (0.4, 0.3, 0.2) */
 }
+
+/* Location Name Label Styles */
+.location-name-label {
+    position: absolute;
+    font-size: 12px;
+    color: white;
+    padding: 2px 6px;
+    background-color: rgba(0, 0, 0, 0.7);
+    border-radius: 3px;
+    white-space: nowrap;
+    pointer-events: none;
+    -unity-text-align: middle-center;
+    border-width: 1px;
+    border-color: rgba(255, 255, 255, 0.2);
+}
+
+.settlement-name {
+    color: rgb(255, 215, 0); /* Gold */
+    -unity-font-style: bold;
+    font-size: 13px;
+}
+
+.forest-name {
+    color: rgb(144, 238, 144); /* Light Green */
+}
+
+.lake-name {
+    color: rgb(173, 216, 230); /* Light Blue */
+}
+
+.plain-name {
+    color: rgb(255, 255, 224); /* Light Yellow */
+    font-size: 11px;
+}
+
+.mountain-name {
+    color: rgb(192, 192, 192); /* Silver */
+    -unity-font-style: bold;
+}
+
+.river-name {
+    color: rgb(135, 206, 250); /* Light Sky Blue */
+    font-size: 11px;
+}

+ 55 - 46
Assets/Resources/UI/MapLegend.uxml

@@ -1,50 +1,59 @@
 <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
-    <ui:VisualElement name="MapLegend" class="legend-container">
-        <ui:Label text="Map Legend" class="legend-title" />
-        <ui:VisualElement class="legend-items">
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box ocean-color" />
-                <ui:Label text="Ocean / Large Water Bodies" class="legend-text" />
+    <Style src="project://database/Assets/Resources/UI/MapLegend.uss?fileID=7433441132597879392&amp;guid=1cea1e1f65c13914b820e2a77d2ba1e3&amp;type=3#MapLegend" />
+    <ui:ScrollView name="legend-scroll-view" class="legend-scroll-container" style="height: 100%;">
+        <ui:VisualElement name="map-legend-container" class="legend-container">
+            <ui:Label text="Map Legend" class="legend-title" />
+            <ui:VisualElement class="legend-section">
+                <ui:Label text="Terrain" class="legend-section-title" />
+                <ui:VisualElement class="legend-items">
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box ocean-color" />
+                        <ui:Label text="Ocean / Large Water Bodies" class="legend-text" />
+                    </ui:VisualElement>
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box river-color" />
+                        <ui:Label text="Rivers / Lakes" class="legend-text" />
+                    </ui:VisualElement>
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box plain-color" />
+                        <ui:Label text="Plains / Grasslands" class="legend-text" />
+                    </ui:VisualElement>
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box forest-color" />
+                        <ui:Label text="Forests" class="legend-text" />
+                    </ui:VisualElement>
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box mountain-color" />
+                        <ui:Label text="Mountains" class="legend-text" />
+                    </ui:VisualElement>
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box town-color" />
+                        <ui:Label text="Towns / Cities" class="legend-text" />
+                    </ui:VisualElement>
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box village-color" />
+                        <ui:Label text="Villages" class="legend-text" />
+                    </ui:VisualElement>
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box road-color" />
+                        <ui:Label text="Roads" class="legend-text" />
+                    </ui:VisualElement>
+                    <ui:VisualElement class="legend-item">
+                        <ui:VisualElement class="color-box dock-color" />
+                        <ui:Label text="Docks / Ports" class="legend-text" />
+                    </ui:VisualElement>
+                </ui:VisualElement>
+            </ui:VisualElement>
+            <ui:VisualElement name="name-toggle-section" class="legend-section">
+                <ui:Label text="Location Names" class="legend-section-title" />
+            </ui:VisualElement>
+            <ui:VisualElement class="legend-section controls-info">
+                <ui:Label text="Controls" class="legend-section-title" />
+                <ui:Label text="WASD / Arrow Keys: Move Camera" class="controls-text" />
+                <ui:Label text="Mouse Wheel: Zoom In/Out" class="controls-text" />
+                <ui:Label text="L: Toggle Legend" class="controls-text" />
+                <ui:Label text="Mouse Hover: Show Tooltips" class="controls-text" />
             </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box river-color" />
-                <ui:Label text="Rivers / Lakes" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box plain-color" />
-                <ui:Label text="Plains / Grasslands" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box forest-color" />
-                <ui:Label text="Forests" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box mountain-color" />
-                <ui:Label text="Mountains" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box town-color" />
-                <ui:Label text="Towns / Cities" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box village-color" />
-                <ui:Label text="Villages" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box road-color" />
-                <ui:Label text="Roads" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box dock-color" />
-                <ui:Label text="Docks / Ports" class="legend-text" />
-            </ui:VisualElement>
-        </ui:VisualElement>
-        <ui:VisualElement class="controls-info">
-            <ui:Label text="Controls:" class="controls-title" />
-            <ui:Label text="WASD / Arrow Keys: Move Camera" class="controls-text" />
-            <ui:Label text="Mouse Wheel: Zoom In/Out" class="controls-text" />
-            <ui:Label text="N: Toggle Name Labels" class="controls-text" />
-            <ui:Label text="Mouse Hover: Show Tooltips" class="controls-text" />
         </ui:VisualElement>
-    </ui:VisualElement>
+    </ui:ScrollView>
 </ui:UXML>

+ 5 - 0
Assets/Resources/UI/MapLocationNameDisplay.uxml

@@ -0,0 +1,5 @@
+<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
+    <ui:VisualElement name="map-container" picking-mode="Ignore" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: visible;">
+        <!-- Location name labels will be added programmatically -->
+    </ui:VisualElement>
+</ui:UXML>

+ 9 - 0
Assets/Resources/UI/MapLocationNamesLayer.uss

@@ -0,0 +1,9 @@
+/* Map Location Names Layer Control */
+
+.map-location-names-layer {
+    z-index: -1; /* Place behind all other UI elements */
+    pointer-events: none; /* CSS equivalent of PickingMode.Ignore */
+    visibility: visible; /* Ensure container is visible */
+    display: flex; /* Ensure container can contain children */
+    overflow: visible; /* Allow children to be visible even if they extend beyond container */
+}

+ 64 - 17
Assets/Scenes/MapScene2.unity

@@ -470,7 +470,6 @@ GameObject:
   - component: {fileID: 855536325}
   - component: {fileID: 855536327}
   - component: {fileID: 855536326}
-  - component: {fileID: 855536328}
   m_Layer: 0
   m_Name: ActiveQuestUI
   m_TagString: Untagged
@@ -525,22 +524,6 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   uiDocument: {fileID: 855536326}
---- !u!114 &855536328
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 855536324}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: f4592822c869e2a43b530e81618cf5b4, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  enableDebugMode: 1
-  showClickDetails: 1
-  showUIBounds: 1
-  testKey: 290
 --- !u!1 &874597726
 GameObject:
   m_ObjectHideFlags: 0
@@ -625,6 +608,69 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1141868171
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1141868173}
+  - component: {fileID: 1141868172}
+  m_Layer: 0
+  m_Name: WorldSpaceLocationNames
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &1141868172
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1141868171}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 348700d8cfcee3141998527195049f44, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  showSettlementNames: 1
+  showForestNames: 1
+  showLakeNames: 1
+  showPlainNames: 1
+  showMountainNames: 1
+  showRiverNames: 1
+  settlementNameColor: {r: 1, g: 1, b: 1, a: 1}
+  forestNameColor: {r: 0, g: 1, b: 0, a: 1}
+  lakeNameColor: {r: 0, g: 1, b: 1, a: 1}
+  plainNameColor: {r: 1, g: 0.92156863, b: 0.015686275, a: 1}
+  mountainNameColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+  riverNameColor: {r: 0, g: 0, b: 1, a: 1}
+  textPrefab: {fileID: 0}
+  textSize: 2
+  heightOffset: 1
+  faceCamera: 1
+  maxViewDistance: 50
+  useBuiltInTextMesh: 0
+  debugMode: 1
+--- !u!4 &1141868173
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1141868171}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &1243674619
 GameObject:
   m_ObjectHideFlags: 0
@@ -1382,3 +1428,4 @@ SceneRoots:
   - {fileID: 2053130505}
   - {fileID: 1079165145}
   - {fileID: 874597728}
+  - {fileID: 1141868173}

+ 15 - 1
Assets/Scripts/Map/SettlementInteractionManager.cs

@@ -134,7 +134,15 @@ public class SettlementInteractionManager : MonoBehaviour
             interactionPrompt.SetActive(false);
         }
 
-        lastTeamMarkerPosition = teamMarker.position;
+        // Initialize team marker position tracking if teamMarker is found
+        if (teamMarker != null)
+        {
+            lastTeamMarkerPosition = teamMarker.position;
+        }
+        else
+        {
+            LogDebug("WARNING: TeamMarker is null - position tracking will not work until teamMarker is assigned");
+        }
     }
 
     /// <summary>
@@ -142,6 +150,12 @@ public class SettlementInteractionManager : MonoBehaviour
     /// </summary>
     private void CheckForSettlementInteraction()
     {
+        // Check if teamMarker is assigned
+        if (teamMarker == null)
+        {
+            return; // Skip interaction check if no team marker
+        }
+
         Vector2 teamWorldPos = new Vector2(teamMarker.position.x, teamMarker.position.z);
 
         // Convert world position to map coordinates

+ 52 - 0
Assets/Scripts/MapMaker2/Data/GeographicFeature.cs

@@ -0,0 +1,52 @@
+using UnityEngine;
+using System.Collections.Generic;
+
+[System.Serializable]
+public class GeographicFeature
+{
+    public string name;
+    public GeographicFeatureType type;
+    public Vector2Int centerPosition;
+    public List<Vector2Int> tiles;
+    public bool isDiscovered = false;
+
+    public GeographicFeature(string name, GeographicFeatureType type, Vector2Int centerPosition)
+    {
+        this.name = name;
+        this.type = type;
+        this.centerPosition = centerPosition;
+        this.tiles = new List<Vector2Int>();
+        this.isDiscovered = false;
+    }
+
+    public void AddTile(Vector2Int tile)
+    {
+        if (!tiles.Contains(tile))
+        {
+            tiles.Add(tile);
+        }
+    }
+
+    public Vector2Int GetCenterPosition()
+    {
+        if (tiles.Count == 0)
+            return centerPosition;
+
+        Vector2 sum = Vector2.zero;
+        foreach (var tile in tiles)
+        {
+            sum += new Vector2(tile.x, tile.y);
+        }
+        Vector2 center = sum / tiles.Count;
+        return new Vector2Int(Mathf.RoundToInt(center.x), Mathf.RoundToInt(center.y));
+    }
+}
+
+public enum GeographicFeatureType
+{
+    Forest,
+    Lake,
+    Plain,
+    Mountain,
+    River
+}

+ 296 - 0
Assets/Scripts/MapMaker2/Features/GeographicFeatureGenerator.cs

@@ -0,0 +1,296 @@
+using UnityEngine;
+using System.Collections.Generic;
+using System.Linq;
+
+public class GeographicFeatureGenerator
+{
+    private static readonly string[] forestNames = {
+        "Whispering Woods", "Ancient Grove", "Darkwood Forest", "Silverleaf Woods",
+        "Thornwick Forest", "Emerald Thicket", "Shadowmere Woods", "Moonlight Grove",
+        "Iron Bark Forest", "Mystic Woodland", "Deeproot Forest", "Starfall Woods",
+        "Bramblewood", "Goldleaf Grove", "Stormwind Forest", "Twilight Woods"
+    };
+
+    private static readonly string[] lakeNames = {
+        "Crystal Lake", "Mirror Waters", "Dragon's Rest Lake", "Silver Mirror",
+        "Moonbeam Lake", "Clearwater Basin", "Starfall Lake", "Azure Waters",
+        "Misty Lake", "Tranquil Waters", "Golden Pond", "Serene Lake",
+        "Echo Lake", "Shimmer Waters", "Peaceful Basin", "Reflection Lake"
+    };
+
+    private static readonly string[] plainNames = {
+        "Golden Plains", "Emerald Fields", "Windswept Meadows", "Sunset Plains",
+        "Harmony Fields", "Verdant Expanse", "Rolling Hills", "Peaceful Meadows",
+        "Sunlit Plains", "Gentle Fields", "Open Grasslands", "Green Expanse",
+        "Fertile Plains", "Wide Meadows", "Bright Fields", "Vast Grasslands"
+    };
+
+    private static readonly string[] mountainNames = {
+        "Frostpeak Mountains", "Dragon's Spine", "Stormhaven Peaks", "Iron Crags",
+        "Skyreach Mountains", "Cloudtop Peaks", "Granite Heights", "Thunder Ridge",
+        "Snowcap Mountains", "Windbreak Peaks", "Stone Sentinels", "Frost Crown"
+    };
+
+    private static readonly string[] riverNames = {
+        "Swift Current", "Silver Stream", "Moonflow River", "Crystal Brook",
+        "Whisper Creek", "Golden Waters", "Peaceful Stream", "Starlight River",
+        "Gentle Current", "Clear Stream", "Harmony River", "Serene Waters"
+    };
+
+    private HashSet<Vector2Int> processedTiles = new HashSet<Vector2Int>();
+
+    public List<GeographicFeature> GenerateFeatures(MapData mapData)
+    {
+        var features = new List<GeographicFeature>();
+        processedTiles.Clear();
+
+        // Generate forest features
+        features.AddRange(GenerateForestFeatures(mapData));
+
+        // Generate lake features
+        features.AddRange(GenerateLakeFeatures(mapData));
+
+        // Generate plain features (larger areas only)
+        features.AddRange(GeneratePlainFeatures(mapData));
+
+        // Generate mountain features
+        features.AddRange(GenerateMountainFeatures(mapData));
+
+        // Generate river features
+        features.AddRange(GenerateRiverFeatures(mapData));
+
+        return features;
+    }
+
+    private List<GeographicFeature> GenerateForestFeatures(MapData mapData)
+    {
+        var features = new List<GeographicFeature>();
+        var forestClusters = FindConnectedAreas(mapData, TerrainType.Forest, 6); // Minimum 6 tiles
+
+        foreach (var cluster in forestClusters)
+        {
+            if (!IsClusterProcessed(cluster))
+            {
+                string name = GetRandomName(forestNames);
+                var center = GetClusterCenter(cluster);
+                var feature = new GeographicFeature(name, GeographicFeatureType.Forest, center);
+
+                foreach (var tile in cluster)
+                {
+                    feature.AddTile(tile);
+                    processedTiles.Add(tile);
+                }
+
+                features.Add(feature);
+            }
+        }
+
+        return features;
+    }
+
+    private List<GeographicFeature> GenerateLakeFeatures(MapData mapData)
+    {
+        var features = new List<GeographicFeature>();
+        var lakeClusters = FindConnectedAreas(mapData, TerrainType.Lake, 4); // Minimum 4 tiles
+
+        foreach (var cluster in lakeClusters)
+        {
+            if (!IsClusterProcessed(cluster))
+            {
+                string name = GetRandomName(lakeNames);
+                var center = GetClusterCenter(cluster);
+                var feature = new GeographicFeature(name, GeographicFeatureType.Lake, center);
+
+                foreach (var tile in cluster)
+                {
+                    feature.AddTile(tile);
+                    processedTiles.Add(tile);
+                }
+
+                features.Add(feature);
+            }
+        }
+
+        return features;
+    }
+
+    private List<GeographicFeature> GeneratePlainFeatures(MapData mapData)
+    {
+        var features = new List<GeographicFeature>();
+        var plainClusters = FindConnectedAreas(mapData, TerrainType.Plains, 25); // Minimum 25 tiles for named plains
+
+        foreach (var cluster in plainClusters)
+        {
+            if (!IsClusterProcessed(cluster))
+            {
+                // Check if this plain area is far enough from settlements
+                var center = GetClusterCenter(cluster);
+                if (IsFarFromSettlements(mapData, center, 8))
+                {
+                    string name = GetRandomName(plainNames);
+                    var feature = new GeographicFeature(name, GeographicFeatureType.Plain, center);
+
+                    foreach (var tile in cluster)
+                    {
+                        feature.AddTile(tile);
+                        processedTiles.Add(tile);
+                    }
+
+                    features.Add(feature);
+                }
+            }
+        }
+
+        return features;
+    }
+
+    private List<GeographicFeature> GenerateMountainFeatures(MapData mapData)
+    {
+        var features = new List<GeographicFeature>();
+        var mountainClusters = FindConnectedAreas(mapData, TerrainType.Mountain, 6); // Minimum 6 tiles
+
+        foreach (var cluster in mountainClusters)
+        {
+            if (!IsClusterProcessed(cluster))
+            {
+                string name = GetRandomName(mountainNames);
+                var center = GetClusterCenter(cluster);
+                var feature = new GeographicFeature(name, GeographicFeatureType.Mountain, center);
+
+                foreach (var tile in cluster)
+                {
+                    feature.AddTile(tile);
+                    processedTiles.Add(tile);
+                }
+
+                features.Add(feature);
+            }
+        }
+
+        return features;
+    }
+
+    private List<GeographicFeature> GenerateRiverFeatures(MapData mapData)
+    {
+        var features = new List<GeographicFeature>();
+        var riverClusters = FindConnectedAreas(mapData, TerrainType.River, 8); // Minimum 8 tiles
+
+        foreach (var cluster in riverClusters)
+        {
+            if (!IsClusterProcessed(cluster))
+            {
+                string name = GetRandomName(riverNames);
+                var center = GetClusterCenter(cluster);
+                var feature = new GeographicFeature(name, GeographicFeatureType.River, center);
+
+                foreach (var tile in cluster)
+                {
+                    feature.AddTile(tile);
+                    processedTiles.Add(tile);
+                }
+
+                features.Add(feature);
+            }
+        }
+
+        return features;
+    }
+
+    private List<List<Vector2Int>> FindConnectedAreas(MapData mapData, TerrainType terrainType, int minSize)
+    {
+        var visited = new HashSet<Vector2Int>();
+        var clusters = new List<List<Vector2Int>>();
+
+        for (int x = 0; x < mapData.Width; x++)
+        {
+            for (int y = 0; y < mapData.Height; y++)
+            {
+                var pos = new Vector2Int(x, y);
+                if (!visited.Contains(pos) && mapData.GetTile(x, y)?.terrainType == terrainType)
+                {
+                    var cluster = FloodFill(mapData, pos, terrainType, visited);
+                    if (cluster.Count >= minSize)
+                    {
+                        clusters.Add(cluster);
+                    }
+                }
+            }
+        }
+
+        return clusters;
+    }
+
+    private List<Vector2Int> FloodFill(MapData mapData, Vector2Int start, TerrainType targetType, HashSet<Vector2Int> visited)
+    {
+        var cluster = new List<Vector2Int>();
+        var stack = new Stack<Vector2Int>();
+        stack.Push(start);
+
+        while (stack.Count > 0)
+        {
+            var current = stack.Pop();
+
+            if (visited.Contains(current) || !mapData.IsValidPosition(current.x, current.y))
+                continue;
+
+            var tile = mapData.GetTile(current.x, current.y);
+            if (tile?.terrainType != targetType)
+                continue;
+
+            visited.Add(current);
+            cluster.Add(current);
+
+            // Add neighbors
+            for (int dx = -1; dx <= 1; dx++)
+            {
+                for (int dy = -1; dy <= 1; dy++)
+                {
+                    if (dx == 0 && dy == 0) continue;
+
+                    var neighbor = new Vector2Int(current.x + dx, current.y + dy);
+                    if (!visited.Contains(neighbor))
+                        stack.Push(neighbor);
+                }
+            }
+        }
+
+        return cluster;
+    }
+
+    private Vector2Int GetClusterCenter(List<Vector2Int> cluster)
+    {
+        if (cluster.Count == 0)
+            return Vector2Int.zero;
+
+        Vector2 sum = Vector2.zero;
+        foreach (var tile in cluster)
+        {
+            sum += new Vector2(tile.x, tile.y);
+        }
+
+        Vector2 center = sum / cluster.Count;
+        return new Vector2Int(Mathf.RoundToInt(center.x), Mathf.RoundToInt(center.y));
+    }
+
+    private bool IsClusterProcessed(List<Vector2Int> cluster)
+    {
+        return cluster.Any(tile => processedTiles.Contains(tile));
+    }
+
+    private bool IsFarFromSettlements(MapData mapData, Vector2Int position, float minDistance)
+    {
+        var settlements = mapData.GetAllSettlements();
+        foreach (var settlement in settlements)
+        {
+            float distance = Vector2.Distance(position, settlement.position);
+            if (distance < minDistance)
+                return false;
+        }
+        return true;
+    }
+
+    private string GetRandomName(string[] nameArray)
+    {
+        return nameArray[Random.Range(0, nameArray.Length)];
+    }
+}

+ 172 - 0
Assets/Scripts/MapMaker2/GeographicFeatureManager.cs

@@ -0,0 +1,172 @@
+using UnityEngine;
+using System.Collections.Generic;
+
+public class GeographicFeatureManager : MonoBehaviour
+{
+    [Header("Feature Configuration")]
+    public bool autoGenerateFeatures = true;
+    public bool regenerateOnMapChange = true;
+
+    [Header("Debug")]
+    public bool debugMode = false;
+
+    private List<GeographicFeature> geographicFeatures = new List<GeographicFeature>();
+    private GeographicFeatureGenerator featureGenerator;
+    private MapData currentMapData;
+
+    public List<GeographicFeature> GeographicFeatures => geographicFeatures;
+
+    private void Awake()
+    {
+        featureGenerator = new GeographicFeatureGenerator();
+    }
+
+    private void Start()
+    {
+        if (autoGenerateFeatures)
+        {
+            // Try to find MapMaker2 in the scene
+            var mapMaker = FindFirstObjectByType<MapMaker2>();
+            if (mapMaker != null)
+            {
+                StartCoroutine(WaitForMapDataAndGenerate(mapMaker));
+            }
+            else if (debugMode)
+            {
+                Debug.LogWarning("GeographicFeatureManager: MapMaker2 not found in scene");
+            }
+        }
+    }
+
+    private System.Collections.IEnumerator WaitForMapDataAndGenerate(MapMaker2 mapMaker)
+    {
+        // Wait a frame to ensure MapData is initialized
+        yield return null;
+
+        // Wait until MapData is available
+        int attempts = 0;
+        while (mapMaker.GetMapData() == null && attempts < 60) // Max 1 second wait
+        {
+            yield return new WaitForSeconds(0.1f);
+            attempts++;
+        }
+
+        if (mapMaker.GetMapData() != null)
+        {
+            GenerateFeatures(mapMaker.GetMapData());
+        }
+        else if (debugMode)
+        {
+            Debug.LogError("GeographicFeatureManager: Failed to get MapData after waiting");
+        }
+    }
+
+    public void GenerateFeatures(MapData mapData)
+    {
+        if (mapData == null)
+        {
+            if (debugMode)
+                Debug.LogWarning("GeographicFeatureManager: Cannot generate features - MapData is null");
+            return;
+        }
+
+        currentMapData = mapData;
+        geographicFeatures.Clear();
+
+        if (debugMode)
+            Debug.Log("GeographicFeatureManager: Starting feature generation...");
+
+        geographicFeatures = featureGenerator.GenerateFeatures(mapData);
+
+        if (debugMode)
+        {
+            Debug.Log($"GeographicFeatureManager: Generated {geographicFeatures.Count} geographic features");
+            foreach (var feature in geographicFeatures)
+            {
+                Debug.Log($"- {feature.name} ({feature.type}) at {feature.centerPosition} with {feature.tiles.Count} tiles");
+            }
+        }
+
+        // Notify other systems that features have been generated
+        NotifyFeaturesGenerated();
+    }
+
+    public List<GeographicFeature> GetFeaturesByType(GeographicFeatureType type)
+    {
+        var result = new List<GeographicFeature>();
+        foreach (var feature in geographicFeatures)
+        {
+            if (feature.type == type)
+                result.Add(feature);
+        }
+        return result;
+    }
+
+    public GeographicFeature GetFeatureAtPosition(Vector2Int position)
+    {
+        foreach (var feature in geographicFeatures)
+        {
+            if (feature.tiles.Contains(position))
+                return feature;
+        }
+        return null;
+    }
+
+    public void SetFeatureDiscovered(GeographicFeature feature, bool discovered)
+    {
+        if (feature != null)
+        {
+            feature.isDiscovered = discovered;
+        }
+    }
+
+    public void SetFeatureDiscoveredByName(string featureName, bool discovered)
+    {
+        var feature = geographicFeatures.Find(f => f.name == featureName);
+        SetFeatureDiscovered(feature, discovered);
+    }
+
+    private void NotifyFeaturesGenerated()
+    {
+        // Find and notify the map legend system
+        var mapLegend = FindFirstObjectByType<MapSceneLegendUI>();
+        if (mapLegend != null)
+        {
+            mapLegend.OnFeaturesGenerated();
+        }
+
+        // Find and notify the location naming system
+        var locationNaming = FindFirstObjectByType<MapLocationNameDisplay>();
+        if (locationNaming != null)
+        {
+            locationNaming.OnFeaturesGenerated();
+        }
+    }
+
+    [ContextMenu("Regenerate Features")]
+    public void RegenerateFeatures()
+    {
+        if (currentMapData != null)
+        {
+            GenerateFeatures(currentMapData);
+        }
+        else
+        {
+            var mapMaker = FindFirstObjectByType<MapMaker2>();
+            if (mapMaker != null && mapMaker.GetMapData() != null)
+            {
+                GenerateFeatures(mapMaker.GetMapData());
+            }
+            else
+            {
+                Debug.LogWarning("GeographicFeatureManager: Cannot regenerate - no MapData available");
+            }
+        }
+    }
+
+    public void ClearFeatures()
+    {
+        geographicFeatures.Clear();
+        NotifyFeaturesGenerated();
+    }
+}

+ 508 - 0
Assets/Scripts/UI/MapScene/MapLegendUI.cs

@@ -0,0 +1,508 @@
+using UnityEngine;
+using UnityEngine.UIElements;
+using System.Reflection;
+
+public class MapSceneLegendUI : MonoBehaviour, IClickBlocker
+{
+    [Header("UI References")]
+    public UIDocument uiDocument;
+
+    [Header("Settings")]
+    public bool startVisible = true;
+    public KeyCode toggleKey = KeyCode.L;
+    public bool debugMode = true;
+
+    // UI Elements
+    private VisualElement legendContainer;
+    private Button toggleButton;
+    private VisualElement legendContent;
+    private VisualElement nameToggleSection;
+
+    // Name toggle buttons
+    private Toggle settlementNamesToggle;
+    private Toggle forestNamesToggle;
+    private Toggle lakeNamesToggle;
+    private Toggle plainNamesToggle;
+    private Toggle mountainNamesToggle;
+    private Toggle riverNamesToggle;
+
+    // References
+    private MapLocationNameDisplay nameDisplay;
+    private bool isLegendVisible;
+
+    // Helper method to call methods on WorldSpaceLocationNames using reflection
+    private void TryCallWorldSpaceMethod(string methodName, bool parameter)
+    {
+        var allMonoBehaviours = FindObjectsByType<MonoBehaviour>(FindObjectsSortMode.None);
+        foreach (var mb in allMonoBehaviours)
+        {
+            if (mb.GetType().Name == "WorldSpaceLocationNames")
+            {
+                var method = mb.GetType().GetMethod(methodName);
+                if (method != null)
+                {
+                    method.Invoke(mb, new object[] { parameter });
+                    break;
+                }
+            }
+        }
+    }
+
+    private void Awake()
+    {
+        if (uiDocument == null)
+            uiDocument = GetComponent<UIDocument>();
+    }
+
+    private void Start()
+    {
+        nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+
+        if (debugMode)
+        {
+            Debug.Log($"MapSceneLegendUI: Starting setup. UIDocument: {(uiDocument != null ? "Found" : "NULL")}");
+            Debug.Log($"MapSceneLegendUI: NameDisplay: {(nameDisplay != null ? "Found" : "NULL")}");
+            Debug.Log($"MapSceneLegendUI: Root Visual Element: {(uiDocument?.rootVisualElement != null ? "Found" : "NULL")}");
+        }
+
+        SetupUI();
+        SetLegendVisible(startVisible);
+
+        if (debugMode)
+        {
+            Debug.Log($"MapSceneLegendUI: Setup complete. Legend visible: {isLegendVisible}");
+            Debug.Log($"MapSceneLegendUI: Legend container: {(legendContainer != null ? "Found" : "NULL")}");
+        }
+
+        // Register with ClickManager
+        if (ClickManager.Instance != null)
+        {
+            ClickManager.Instance.RegisterClickBlocker(this);
+            if (debugMode) Debug.Log("MapSceneLegendUI: Registered with ClickManager");
+        }
+        else if (debugMode)
+        {
+            Debug.LogWarning("MapSceneLegendUI: ClickManager not found");
+        }
+    }
+
+    private void OnDestroy()
+    {
+        // Unregister from ClickManager
+        if (ClickManager.Instance != null)
+        {
+            ClickManager.Instance.UnregisterClickBlocker(this);
+        }
+    }
+
+    private void Update()
+    {
+        if (Input.GetKeyDown(toggleKey))
+        {
+            ToggleLegend();
+        }
+    }
+
+    private void SetupUI()
+    {
+        if (uiDocument == null)
+        {
+            if (debugMode) Debug.LogError("MapSceneLegendUI: UIDocument is null! Cannot setup UI.");
+            return;
+        }
+
+        var root = uiDocument.rootVisualElement;
+        if (root == null)
+        {
+            if (debugMode) Debug.LogError("MapSceneLegendUI: Root visual element is null!");
+            return;
+        }
+
+        if (debugMode) Debug.Log("MapSceneLegendUI: Setting up UI...");
+
+        // Try to find existing legend container from UXML first
+        legendContainer = root.Q<VisualElement>("map-legend-container");
+
+        if (legendContainer != null)
+        {
+            // UXML is loaded, use existing structure
+            if (debugMode) Debug.Log("MapSceneLegendUI: Using UXML structure");
+            legendContent = legendContainer;
+
+            // Find the name toggle section
+            nameToggleSection = root.Q<VisualElement>("name-toggle-section");
+            if (nameToggleSection == null)
+            {
+                // Create it if not found
+                nameToggleSection = new VisualElement();
+                nameToggleSection.name = "name-toggle-section";
+                nameToggleSection.AddToClassList("legend-section");
+                var sectionTitle = new Label("Location Names");
+                sectionTitle.AddToClassList("legend-section-title");
+                nameToggleSection.Add(sectionTitle);
+                legendContainer.Add(nameToggleSection);
+            }
+
+            // Create name toggles
+            CreateNameTogglesSection();
+        }
+        else
+        {
+            // Fallback to programmatic creation
+            if (debugMode) Debug.Log("MapSceneLegendUI: Using programmatic UI creation");
+
+            // Create main legend container
+            legendContainer = new VisualElement();
+            legendContainer.name = "map-legend-container";
+            legendContainer.AddToClassList("map-legend");
+
+            // Create toggle button
+            toggleButton = new Button(() => ToggleLegend());
+            toggleButton.text = "Map Legend";
+            toggleButton.name = "legend-toggle-button";
+            toggleButton.AddToClassList("legend-toggle-btn");
+
+            // Create legend content
+            legendContent = new VisualElement();
+            legendContent.name = "legend-content";
+            legendContent.AddToClassList("legend-content");
+
+            // Add title
+            var title = new Label("Map Legend");
+            title.AddToClassList("legend-title");
+            legendContent.Add(title);
+
+            // Create terrain legend section
+            CreateTerrainLegend();
+
+            // Create name toggles section
+            CreateNameTogglesSection();
+
+            // Create controls info
+            CreateControlsInfo();
+
+            // Assemble the UI
+            legendContainer.Add(toggleButton);
+            legendContainer.Add(legendContent);
+
+            root.Add(legendContainer);
+        }
+
+        // Apply styles
+        ApplyStyles();
+
+        if (debugMode) Debug.Log("MapSceneLegendUI: UI setup complete");
+    }
+
+    private void CreateTerrainLegend()
+    {
+        var terrainSection = new VisualElement();
+        terrainSection.AddToClassList("legend-section");
+
+        var terrainTitle = new Label("Terrain");
+        terrainTitle.AddToClassList("legend-section-title");
+        terrainSection.Add(terrainTitle);
+
+        // Terrain items
+        var terrainItems = new[]
+        {
+            ("Ocean", "ocean-color"),
+            ("Rivers / Lakes", "river-color"),
+            ("Plains / Grasslands", "plain-color"),
+            ("Forests", "forest-color"),
+            ("Mountains", "mountain-color"),
+            ("Towns / Cities", "town-color"),
+            ("Villages", "village-color"),
+            ("Roads", "road-color")
+        };
+
+        foreach (var (label, colorClass) in terrainItems)
+        {
+            var item = CreateLegendItem(label, colorClass);
+            terrainSection.Add(item);
+        }
+
+        legendContent.Add(terrainSection);
+    }
+
+    private void CreateNameTogglesSection()
+    {
+        nameToggleSection = new VisualElement();
+        nameToggleSection.AddToClassList("legend-section");
+
+        var nameTitle = new Label("Location Names");
+        nameTitle.AddToClassList("legend-section-title");
+        nameToggleSection.Add(nameTitle);
+
+        // Create toggle switches for each name type
+        settlementNamesToggle = CreateNameToggle("Settlements", true, (show) =>
+        {
+            // Try both old and new name display systems
+            if (nameDisplay == null) nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+            if (nameDisplay != null) nameDisplay.ToggleSettlementNames(show);
+
+            // Also try to find WorldSpaceLocationNames component using reflection
+            TryCallWorldSpaceMethod("ToggleSettlementNames", show);
+        });
+
+        forestNamesToggle = CreateNameToggle("Forests", true, (show) =>
+        {
+            if (nameDisplay == null) nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+            if (nameDisplay != null) nameDisplay.ToggleForestNames(show);
+
+            TryCallWorldSpaceMethod("ToggleForestNames", show);
+        });
+
+        lakeNamesToggle = CreateNameToggle("Lakes", true, (show) =>
+        {
+            if (nameDisplay == null) nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+            if (nameDisplay != null) nameDisplay.ToggleLakeNames(show);
+
+            TryCallWorldSpaceMethod("ToggleLakeNames", show);
+        });
+
+        plainNamesToggle = CreateNameToggle("Plains", true, (show) =>
+        {
+            if (nameDisplay == null) nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+            if (nameDisplay != null) nameDisplay.TogglePlainNames(show);
+
+            TryCallWorldSpaceMethod("TogglePlainNames", show);
+        });
+
+        mountainNamesToggle = CreateNameToggle("Mountains", true, (show) =>
+        {
+            if (nameDisplay == null) nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+            if (nameDisplay != null) nameDisplay.ToggleMountainNames(show);
+
+            TryCallWorldSpaceMethod("ToggleMountainNames", show);
+        });
+
+        riverNamesToggle = CreateNameToggle("Rivers", true, (show) =>
+        {
+            if (nameDisplay == null) nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+            if (nameDisplay != null) nameDisplay.ToggleRiverNames(show);
+
+            TryCallWorldSpaceMethod("ToggleRiverNames", show);
+        });
+
+        nameToggleSection.Add(settlementNamesToggle);
+        nameToggleSection.Add(forestNamesToggle);
+        nameToggleSection.Add(lakeNamesToggle);
+        nameToggleSection.Add(plainNamesToggle);
+        nameToggleSection.Add(mountainNamesToggle);
+        nameToggleSection.Add(riverNamesToggle);
+
+        legendContent.Add(nameToggleSection);
+    }
+
+    private Toggle CreateNameToggle(string labelText, bool defaultValue, System.Action<bool> onValueChanged)
+    {
+        var toggle = new Toggle();
+        toggle.text = labelText;
+        toggle.value = defaultValue;
+        toggle.AddToClassList("name-toggle");
+
+        toggle.RegisterValueChangedCallback(evt => onValueChanged(evt.newValue));
+
+        return toggle;
+    }
+
+    private void CreateControlsInfo()
+    {
+        var controlsSection = new VisualElement();
+        controlsSection.AddToClassList("legend-section");
+        controlsSection.AddToClassList("controls-info");
+
+        var controlsTitle = new Label("Controls");
+        controlsTitle.AddToClassList("legend-section-title");
+        controlsSection.Add(controlsTitle);
+
+        var controls = new[]
+        {
+            "WASD / Arrow Keys: Move Camera",
+            "Mouse Wheel: Zoom In/Out",
+            $"{toggleKey}: Toggle Legend",
+            "Click: Select Location",
+            "Mouse Hover: Show Details"
+        };
+
+        foreach (var controlText in controls)
+        {
+            var controlLabel = new Label(controlText);
+            controlLabel.AddToClassList("controls-text");
+            controlsSection.Add(controlLabel);
+        }
+
+        legendContent.Add(controlsSection);
+    }
+
+    private VisualElement CreateLegendItem(string labelText, string colorClass)
+    {
+        var item = new VisualElement();
+        item.AddToClassList("legend-item");
+
+        var colorBox = new VisualElement();
+        colorBox.AddToClassList("color-box");
+        colorBox.AddToClassList(colorClass);
+
+        var label = new Label(labelText);
+        label.AddToClassList("legend-text");
+
+        item.Add(colorBox);
+        item.Add(label);
+
+        return item;
+    }
+
+    private void ApplyStyles()
+    {
+        var styleSheet = Resources.Load<StyleSheet>("UI/MapLegend");
+        if (styleSheet != null)
+        {
+            uiDocument.rootVisualElement.styleSheets.Add(styleSheet);
+        }
+        else
+        {
+            // Apply inline styles if stylesheet not found
+            ApplyInlineStyles();
+        }
+    }
+
+    private void ApplyInlineStyles()
+    {
+        // Legend container positioning
+        legendContainer.style.position = Position.Absolute;
+        legendContainer.style.top = 20;
+        legendContainer.style.left = 20;
+        legendContainer.style.width = 250;
+
+        // Toggle button
+        toggleButton.style.backgroundColor = new Color(0.2f, 0.2f, 0.2f, 0.9f);
+        toggleButton.style.color = Color.white;
+        toggleButton.style.borderTopLeftRadius = 5;
+        toggleButton.style.borderTopRightRadius = 5;
+        toggleButton.style.borderBottomLeftRadius = 0;
+        toggleButton.style.borderBottomRightRadius = 0;
+        toggleButton.style.paddingTop = 8;
+        toggleButton.style.paddingBottom = 8;
+        toggleButton.style.paddingLeft = 12;
+        toggleButton.style.paddingRight = 12;
+
+        // Legend content
+        legendContent.style.backgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.9f);
+        legendContent.style.borderBottomLeftRadius = 5;
+        legendContent.style.borderBottomRightRadius = 5;
+        legendContent.style.borderTopWidth = 1;
+        legendContent.style.borderTopColor = new Color(0.4f, 0.4f, 0.4f, 0.8f);
+        legendContent.style.paddingTop = 10;
+        legendContent.style.paddingBottom = 10;
+        legendContent.style.paddingLeft = 12;
+        legendContent.style.paddingRight = 12;
+
+        // Apply basic color classes
+        ApplyTerrainColors();
+    }
+
+    private void ApplyTerrainColors()
+    {
+        // This would ideally be done via USS, but for now we'll handle it in the legend creation
+        // The actual color styling should be handled by the MapLegend.uss file
+    }
+
+    public void ToggleLegend()
+    {
+        if (debugMode) Debug.Log($"MapSceneLegendUI: Toggling legend. Current state: {isLegendVisible}");
+        SetLegendVisible(!isLegendVisible);
+    }
+
+    public void SetLegendVisible(bool visible)
+    {
+        isLegendVisible = visible;
+        if (legendContent != null)
+        {
+            legendContent.style.display = visible ? DisplayStyle.Flex : DisplayStyle.None;
+            if (debugMode) Debug.Log($"MapSceneLegendUI: Set legend visible: {visible}");
+        }
+        else if (debugMode)
+        {
+            Debug.LogWarning("MapSceneLegendUI: Cannot set visibility - legendContent is null");
+        }
+
+        if (toggleButton != null)
+        {
+            toggleButton.text = visible ? "Hide Legend" : "Map Legend";
+        }
+    }
+
+    public void OnFeaturesGenerated()
+    {
+        // Refresh the toggle states to match the current display settings
+        if (nameDisplay != null)
+        {
+            settlementNamesToggle?.SetValueWithoutNotify(nameDisplay.showSettlementNames);
+            forestNamesToggle?.SetValueWithoutNotify(nameDisplay.showForestNames);
+            lakeNamesToggle?.SetValueWithoutNotify(nameDisplay.showLakeNames);
+            plainNamesToggle?.SetValueWithoutNotify(nameDisplay.showPlainNames);
+            mountainNamesToggle?.SetValueWithoutNotify(nameDisplay.showMountainNames);
+            riverNamesToggle?.SetValueWithoutNotify(nameDisplay.showRiverNames);
+        }
+    }
+
+    // IClickBlocker implementation
+    public bool IsBlockingClick(Vector2 screenPosition)
+    {
+        if (!isLegendVisible || legendContainer == null)
+            return false;
+
+        // Convert screen position to UI coordinates and check if it's within the legend bounds
+        var panelGeometry = legendContainer.worldBound;
+        return panelGeometry.Contains(screenPosition);
+    }
+
+    [ContextMenu("Toggle Legend")]
+    public void ToggleLegendManual()
+    {
+        ToggleLegend();
+    }
+
+    [ContextMenu("Show Legend")]
+    public void ShowLegend()
+    {
+        SetLegendVisible(true);
+    }
+
+    [ContextMenu("Hide Legend")]
+    public void HideLegend()
+    {
+        SetLegendVisible(false);
+    }
+
+    [ContextMenu("Debug Legend")]
+    public void RefreshNameDisplayConnection()
+    {
+        // Try to find the name display if it wasn't found initially
+        if (nameDisplay == null)
+        {
+            nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+            if (debugMode && nameDisplay != null)
+            {
+                Debug.Log("MapSceneLegendUI: Successfully connected to MapLocationNameDisplay");
+            }
+        }
+    }
+
+    public void DebugLegend()
+    {
+        Debug.Log($"=== MapSceneLegendUI Debug Info ===");
+        Debug.Log($"UIDocument: {(uiDocument != null ? "Found" : "NULL")}");
+        Debug.Log($"LegendContainer: {(legendContainer != null ? "Found" : "NULL")}");
+        Debug.Log($"LegendContent: {(legendContent != null ? "Found" : "NULL")}");
+        Debug.Log($"IsLegendVisible: {isLegendVisible}");
+        Debug.Log($"NameDisplay: {(nameDisplay != null ? "Found" : "NULL")}");
+
+        if (uiDocument?.rootVisualElement != null)
+        {
+            Debug.Log($"Root element children: {uiDocument.rootVisualElement.childCount}");
+        }
+    }
+}

+ 217 - 0
Assets/Scripts/UI/MapScene/MapLocationDebugger.cs

@@ -0,0 +1,217 @@
+using UnityEngine;
+using UnityEngine.UIElements;
+using System;
+using System.Collections;
+
+public class MapLocationDebugger : MonoBehaviour
+{
+    [Header("Debug Controls")]
+    public KeyCode debugKey = KeyCode.F9;
+    public KeyCode toggleLegendKey = KeyCode.F10;
+    public KeyCode toggleNamesKey = KeyCode.F11;
+    public KeyCode refreshKey = KeyCode.F12;
+
+    private MapSceneLegendUI legendUI;
+    private MapLocationNameDisplay nameDisplay;
+    private GeographicFeatureManager featureManager;
+
+    void Start()
+    {
+        RefreshComponentReferences();
+        PrintDebugKeys();
+    }
+
+    void RefreshComponentReferences()
+    {
+        legendUI = FindFirstObjectByType<MapSceneLegendUI>();
+        nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+        featureManager = FindFirstObjectByType<GeographicFeatureManager>();
+
+        Debug.Log($"MapLocationDebugger: Found Legend UI: {legendUI != null}");
+        Debug.Log($"MapLocationDebugger: Found Name Display: {nameDisplay != null}");
+        Debug.Log($"MapLocationDebugger: Found Feature Manager: {featureManager != null}");
+
+        // If we can't find them, let's see what GameObjects exist
+        if (nameDisplay == null || featureManager == null)
+        {
+            Debug.Log("=== SEARCHING FOR MISSING COMPONENTS ===");
+            var allObjects = FindObjectsByType<MonoBehaviour>(FindObjectsSortMode.None);
+            foreach (var obj in allObjects)
+            {
+                if (obj is MapLocationNameDisplay || obj is GeographicFeatureManager)
+                {
+                    Debug.Log($"Found {obj.GetType().Name} on GameObject: {obj.gameObject.name}");
+                }
+            }
+            Debug.Log("=== END SEARCH ===");
+        }
+    }
+
+    void Update()
+    {
+        if (Input.GetKeyDown(debugKey))
+        {
+            PrintDetailedDebugInfo();
+        }
+
+        if (Input.GetKeyDown(toggleLegendKey))
+        {
+            if (legendUI != null)
+            {
+                legendUI.ToggleLegend();
+                Debug.Log("MapLocationDebugger: Toggled legend");
+            }
+        }
+
+        if (Input.GetKeyDown(toggleNamesKey))
+        {
+            if (nameDisplay != null)
+            {
+                nameDisplay.showSettlementNames = !nameDisplay.showSettlementNames;
+                nameDisplay.RefreshLocationNames();
+                Debug.Log($"MapLocationDebugger: Settlement names: {nameDisplay.showSettlementNames}");
+            }
+        }
+
+        if (Input.GetKeyDown(refreshKey))
+        {
+            if (nameDisplay != null)
+            {
+                nameDisplay.RefreshLocationNames();
+                Debug.Log("MapLocationDebugger: Refreshed location names");
+
+                // Print immediate debug info
+                StartCoroutine(PrintLabelsAfterDelay());
+            }
+        }
+    }
+
+    System.Collections.IEnumerator PrintLabelsAfterDelay()
+    {
+        yield return new WaitForSeconds(0.1f); // Wait for refresh to complete
+
+        if (nameDisplay != null)
+        {
+            var uiDoc = nameDisplay.GetComponent<UIDocument>();
+            if (uiDoc?.rootVisualElement != null)
+            {
+                var mapContainer = uiDoc.rootVisualElement.Q("map-container");
+                if (mapContainer != null)
+                {
+                    Debug.Log($"=== LABEL DEBUG: Container has {mapContainer.childCount} children ===");
+                    for (int i = 0; i < Math.Min(10, mapContainer.childCount); i++)
+                    {
+                        var child = mapContainer.ElementAt(i);
+                        if (child is Label label)
+                        {
+                            var left = label.style.left.value.value;
+                            var top = label.style.top.value.value;
+                            var color = label.style.color.value;
+                            Debug.Log($"Label {i}: '{label.text}' at ({left:F1}, {top:F1}) color={color} visible={label.style.display.value}");
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    void PrintDebugKeys()
+    {
+        Debug.Log("=== MAP LOCATION DEBUGGER ===");
+        Debug.Log($"Press {debugKey} for detailed debug info");
+        Debug.Log($"Press {toggleLegendKey} to toggle legend");
+        Debug.Log($"Press {toggleNamesKey} to toggle settlement names");
+        Debug.Log($"Press {refreshKey} to refresh names");
+        Debug.Log("============================");
+    }
+
+    void PrintDetailedDebugInfo()
+    {
+        // Refresh component references in case they were created after Start
+        RefreshComponentReferences();
+
+        Debug.Log("=== DETAILED DEBUG INFO ===");
+
+        // Legend UI Info
+        if (legendUI != null)
+        {
+            var uiDoc = legendUI.GetComponent<UIDocument>();
+            Debug.Log($"Legend UI Document: {uiDoc != null}");
+            if (uiDoc != null)
+            {
+                Debug.Log($"Root Element: {uiDoc.rootVisualElement != null}");
+                if (uiDoc.rootVisualElement != null)
+                {
+                    var legendContainer = uiDoc.rootVisualElement.Q("map-legend-container");
+                    Debug.Log($"Legend Container Found: {legendContainer != null}");
+                    if (legendContainer != null)
+                    {
+                        Debug.Log($"Legend Visible: {legendContainer.style.display.value}");
+                        Debug.Log($"Legend Position: {legendContainer.style.position.value}");
+                        Debug.Log($"Legend Size: {legendContainer.resolvedStyle.width}x{legendContainer.resolvedStyle.height}");
+                    }
+                }
+            }
+        }
+        else
+        {
+            Debug.LogWarning("Legend UI not found!");
+        }
+
+        // Name Display Info
+        if (nameDisplay != null)
+        {
+            var uiDoc = nameDisplay.GetComponent<UIDocument>();
+            Debug.Log($"Name Display UI Document: {uiDoc != null}");
+            if (uiDoc != null)
+            {
+                Debug.Log($"Root Element: {uiDoc.rootVisualElement != null}");
+                if (uiDoc.rootVisualElement != null)
+                {
+                    var mapContainer = uiDoc.rootVisualElement.Q("map-container");
+                    Debug.Log($"Map Container Found: {mapContainer != null}");
+                    if (mapContainer != null)
+                    {
+                        Debug.Log($"Map Container Children: {mapContainer.childCount}");
+                        Debug.Log($"Map Container Size: {mapContainer.resolvedStyle.width}x{mapContainer.resolvedStyle.height}");
+                        Debug.Log($"Map Container World Bound: {mapContainer.worldBound}");
+
+                        // List some children for debugging
+                        for (int i = 0; i < Math.Min(5, mapContainer.childCount); i++)
+                        {
+                            var child = mapContainer.ElementAt(i);
+                            if (child is Label label)
+                            {
+                                Debug.Log($"  Child {i}: Label '{label.text}' at ({label.style.left.value.value:F1}, {label.style.top.value.value:F1}) - Color: {label.style.color.value}");
+                            }
+                        }
+                    }
+                }
+            }
+
+            Debug.Log($"Settlement Names Enabled: {nameDisplay.showSettlementNames}");
+            Debug.Log($"Forest Names Enabled: {nameDisplay.showForestNames}");
+        }
+        else
+        {
+            Debug.LogWarning("Name Display not found!");
+        }
+
+        // Feature Manager Info
+        if (featureManager != null)
+        {
+            Debug.Log($"Geographic Features Count: {featureManager.GeographicFeatures.Count}");
+            if (featureManager.GeographicFeatures.Count > 0)
+            {
+                var feature = featureManager.GeographicFeatures[0];
+                Debug.Log($"Sample Feature: {feature.name} ({feature.type}) at {feature.centerPosition}");
+            }
+        }
+        else
+        {
+            Debug.LogWarning("Feature Manager not found!");
+        }
+
+        Debug.Log("==========================");
+    }
+}

+ 683 - 0
Assets/Scripts/UI/MapScene/MapLocationNameDisplay.cs

@@ -0,0 +1,683 @@
+using UnityEngine;
+using UnityEngine.UIElements;
+using System.Collections.Generic;
+using System.Collections;
+
+public class MapLocationNameDisplay : MonoBehaviour, IClickBlocker
+{
+    [Header("System Control")]
+    public bool systemEnabled = false; // Disabled - moving to 3D world space approach
+
+    [Header("UI References")]
+    public UIDocument mapUIDocument;
+
+    [Header("Display Settings")]
+    public bool showSettlementNames = true;
+    public bool showForestNames = true;
+    public bool showLakeNames = true;
+    public bool showPlainNames = true;
+    public bool showMountainNames = true;
+    public bool showRiverNames = true;
+
+    [Header("Visual Settings")]
+    public Color settlementNameColor = Color.white;
+    public Color forestNameColor = Color.green;
+    public Color lakeNameColor = Color.cyan;
+    public Color plainNameColor = Color.yellow;
+    public Color mountainNameColor = Color.gray;
+    public Color riverNameColor = Color.blue;
+
+    [Header("World Positioning")]
+    public bool debugMode = true;
+    public float updateFrequency = 0.33f; // Update positions 3 times per second for good performance
+
+    private VisualElement mapContainer;
+    private List<Label> nameLabels = new List<Label>();
+    private List<Vector3> worldPositions = new List<Vector3>(); // Store world positions for each label
+    private GeographicFeatureManager featureManager;
+    private MapData mapData;
+    private MapMaker2 mapMaker;
+    private Camera mainCamera;
+    private Coroutine positionUpdateCoroutine;
+    private Vector3 lastCameraPosition;
+    private float lastCameraSize;
+
+    private void Start()
+    {
+        if (!systemEnabled)
+        {
+            if (debugMode) Debug.Log("MapLocationNameDisplay: System disabled, not initializing");
+            return;
+        }
+
+        InitializeReferences();
+        SetupUI();
+
+        // Find the main camera
+        mainCamera = Camera.main;
+        if (mainCamera == null)
+        {
+            mainCamera = FindFirstObjectByType<Camera>();
+        }
+
+        // Initialize camera tracking
+        if (mainCamera != null)
+        {
+            lastCameraPosition = mainCamera.transform.position;
+            lastCameraSize = mainCamera.orthographicSize;
+        }
+
+        if (debugMode)
+        {
+            Debug.Log($"MapLocationNameDisplay: Started. MapData: {(mapData != null ? $"{mapData.Width}x{mapData.Height}" : "NULL")}");
+            Debug.Log($"MapLocationNameDisplay: FeatureManager: {(featureManager != null ? "Found" : "NULL")}");
+            Debug.Log($"MapLocationNameDisplay: MapContainer: {(mapContainer != null ? "Created" : "NULL")}");
+            Debug.Log($"MapLocationNameDisplay: Camera: {(mainCamera != null ? "Found" : "NULL")}");
+        }
+
+        // Initial refresh of location names
+        StartCoroutine(InitialRefreshDelayed());
+    }
+
+    private void InitializeReferences()
+    {
+        if (mapUIDocument == null)
+            mapUIDocument = GetComponent<UIDocument>();
+
+        featureManager = FindFirstObjectByType<GeographicFeatureManager>();
+        mapMaker = FindFirstObjectByType<MapMaker2>();
+
+        if (mapMaker != null)
+        {
+            mapData = mapMaker.GetMapData();
+        }
+
+        if (debugMode)
+        {
+            Debug.Log($"MapLocationNameDisplay.InitializeReferences:");
+            Debug.Log($"  - mapUIDocument: {(mapUIDocument != null ? "Found" : "NULL")}");
+            Debug.Log($"  - featureManager: {(featureManager != null ? $"Found ({featureManager.GeographicFeatures.Count} features)" : "NULL")}");
+            Debug.Log($"  - mapMaker: {(mapMaker != null ? "Found" : "NULL")}");
+            Debug.Log($"  - mapData: {(mapData != null ? $"Found ({mapData.Width}x{mapData.Height})" : "NULL")}");
+        }
+    }
+
+    private void SetupUI()
+    {
+        if (mapUIDocument?.rootVisualElement != null)
+        {
+            // Load the CSS for proper layering
+            var layerStyleSheet = Resources.Load<StyleSheet>("UI/MapLocationNamesLayer");
+            if (layerStyleSheet != null)
+            {
+                mapUIDocument.rootVisualElement.styleSheets.Add(layerStyleSheet);
+                if (debugMode) Debug.Log("MapLocationNameDisplay: Loaded MapLocationNamesLayer stylesheet");
+            }
+            else if (debugMode)
+            {
+                Debug.LogWarning("MapLocationNameDisplay: Could not load MapLocationNamesLayer stylesheet from Resources/UI/");
+            }
+
+            // Try to find existing map container
+            mapContainer = mapUIDocument.rootVisualElement.Q<VisualElement>("map-container");
+
+            if (mapContainer == null)
+            {
+                // Create map container if it doesn't exist
+                mapContainer = new VisualElement();
+                mapContainer.name = "map-container";
+                mapContainer.style.position = Position.Absolute;
+                mapContainer.style.width = Length.Percent(100);
+                mapContainer.style.height = Length.Percent(100);
+                mapContainer.style.left = 0;
+                mapContainer.style.top = 0;
+                mapContainer.pickingMode = PickingMode.Ignore; // Allow clicks to pass through
+
+                // Ensure the container is visible and can contain children
+                mapContainer.style.overflow = Overflow.Visible;
+                mapContainer.style.visibility = Visibility.Visible;
+                mapContainer.style.display = DisplayStyle.Flex;
+
+                // Use CSS to control layering instead of insertion position
+                mapContainer.AddToClassList("map-location-names-layer");
+
+                // Add to the end of the hierarchy, but use CSS z-index to control layering
+                mapUIDocument.rootVisualElement.Add(mapContainer);
+
+                if (debugMode) Debug.Log("MapLocationNameDisplay: Created new map-container with click-through enabled");
+            }
+            else
+            {
+                // Ensure existing container also has proper picking mode and visibility
+                mapContainer.pickingMode = PickingMode.Ignore;
+                mapContainer.AddToClassList("map-location-names-layer");
+                mapContainer.style.overflow = Overflow.Visible;
+                mapContainer.style.visibility = Visibility.Visible;
+                mapContainer.style.display = DisplayStyle.Flex;
+
+                if (debugMode) Debug.Log($"MapLocationNameDisplay: Found existing map-container with {mapContainer.childCount} children, ensured click-through");
+            }
+        }
+        else if (debugMode)
+        {
+            Debug.LogWarning("MapLocationNameDisplay: mapUIDocument or rootVisualElement is null");
+        }
+    }
+
+    public void OnFeaturesGenerated()
+    {
+        // Wait a frame to ensure everything is set up
+        StartCoroutine(RefreshNamesDelayed());
+    }
+
+    private System.Collections.IEnumerator InitialRefreshDelayed()
+    {
+        yield return null; // Wait one frame for setup
+        yield return null; // Wait another frame to be sure
+
+        if (debugMode) Debug.Log("MapLocationNameDisplay: Initial refresh triggered");
+        RefreshLocationNames();
+    }
+
+    private System.Collections.IEnumerator RefreshNamesDelayed()
+    {
+        yield return null; // Wait one frame
+        yield return null; // Wait another frame to be sure
+
+        if (debugMode) Debug.Log("MapLocationNameDisplay: Delayed refresh triggered");
+        RefreshLocationNames();
+    }
+
+    public void RefreshLocationNames()
+    {
+        if (!systemEnabled)
+        {
+            if (debugMode) Debug.Log("MapLocationNameDisplay: System disabled, skipping refresh");
+            return;
+        }
+
+        ClearAllLabels();
+
+        if (mapContainer == null || mapData == null)
+        {
+            if (debugMode) Debug.LogWarning($"MapLocationNameDisplay: Cannot refresh - mapContainer: {(mapContainer != null ? "OK" : "NULL")}, mapData: {(mapData != null ? "OK" : "NULL")}");
+            return;
+        }
+
+        if (debugMode) Debug.Log($"MapLocationNameDisplay: Refreshing location names... Container children before: {mapContainer.childCount}");
+
+        // Display settlement names
+        if (showSettlementNames)
+        {
+            if (debugMode) Debug.Log("MapLocationNameDisplay: Attempting to display settlement names...");
+            DisplaySettlementNames();
+        }
+
+        // Display geographic feature names
+        if (featureManager != null)
+        {
+            if (debugMode) Debug.Log($"MapLocationNameDisplay: Found {featureManager.GeographicFeatures.Count} geographic features");
+            var features = featureManager.GeographicFeatures;
+            if (debugMode) Debug.Log($"MapLocationNameDisplay: Found {features.Count} geographic features");
+
+            foreach (var feature in features)
+            {
+                if (ShouldDisplayFeature(feature))
+                {
+                    CreateFeatureLabel(feature);
+                }
+            }
+        }
+        else if (debugMode)
+        {
+            Debug.LogWarning("MapLocationNameDisplay: FeatureManager is null");
+        }
+
+        if (debugMode) Debug.Log($"MapLocationNameDisplay: Created {nameLabels.Count} name labels total");
+
+        // Debug final container state
+        if (debugMode && mapContainer != null)
+        {
+            Debug.Log($"MapLocationNameDisplay: Final container state - Children: {mapContainer.childCount}, PickingMode: {mapContainer.pickingMode}, Parent: {(mapContainer.parent != null ? mapContainer.parent.name : "NULL")}");
+            Debug.Log($"MapLocationNameDisplay: Container bounds: {mapContainer.localBound}, World bounds: {mapContainer.worldBound}");
+            Debug.Log($"MapLocationNameDisplay: Container visible: {mapContainer.style.visibility}, Display: {mapContainer.style.display}, Overflow: {mapContainer.style.overflow}");
+            Debug.Log($"MapLocationNameDisplay: Container size: width={mapContainer.style.width}, height={mapContainer.style.height}");
+            Debug.Log($"MapLocationNameDisplay: Container position: left={mapContainer.style.left}, top={mapContainer.style.top}, position={mapContainer.style.position}");
+
+            // Double-check that labels are actually in the container
+            if (mapContainer.childCount != nameLabels.Count)
+            {
+                Debug.LogError($"MapLocationNameDisplay: MISMATCH! Container has {mapContainer.childCount} children but nameLabels has {nameLabels.Count} items!");
+
+                // Try to re-add labels if they're missing
+                for (int i = 0; i < nameLabels.Count; i++)
+                {
+                    if (nameLabels[i].parent == null)
+                    {
+                        Debug.Log($"MapLocationNameDisplay: Re-adding orphaned label: {nameLabels[i].text}");
+                        mapContainer.Add(nameLabels[i]);
+                    }
+                }
+                Debug.Log($"MapLocationNameDisplay: After re-adding, container has {mapContainer.childCount} children");
+            }
+            else
+            {
+                Debug.Log($"MapLocationNameDisplay: SUCCESS! Container and nameLabels count match: {mapContainer.childCount}");
+
+                // Check first few labels for debugging
+                for (int i = 0; i < Mathf.Min(3, nameLabels.Count); i++)
+                {
+                    var label = nameLabels[i];
+                    Debug.Log($"MapLocationNameDisplay: Label {i}: '{label.text}' - Visible: {label.style.visibility}, Display: {label.style.display}, Position: ({label.style.left.value.value:F1}, {label.style.top.value.value:F1}), PickingMode: {label.pickingMode}, Parent: {(label.parent != null ? label.parent.name : "NULL")}");
+                }
+            }
+        }
+
+        // Start position updates if we have labels and camera
+        if (nameLabels.Count > 0 && mainCamera != null)
+        {
+            StartPositionUpdates();
+            if (debugMode) Debug.Log("MapLocationNameDisplay: Started continuous position updates");
+        }
+    }
+
+    private void OnDestroy()
+    {
+        StopPositionUpdates();
+    }
+
+    private void DisplaySettlementNames()
+    {
+        var settlements = mapData.GetAllSettlements();
+        if (debugMode) Debug.Log($"MapLocationNameDisplay: Displaying {settlements.Count} settlement names");
+
+        foreach (var settlement in settlements)
+        {
+            CreateSettlementLabel(settlement);
+        }
+    }
+
+    private bool ShouldDisplayFeature(GeographicFeature feature)
+    {
+        switch (feature.type)
+        {
+            case GeographicFeatureType.Forest:
+                return showForestNames;
+            case GeographicFeatureType.Lake:
+                return showLakeNames;
+            case GeographicFeatureType.Plain:
+                return showPlainNames;
+            case GeographicFeatureType.Mountain:
+                return showMountainNames;
+            case GeographicFeatureType.River:
+                return showRiverNames;
+            default:
+                return false;
+        }
+    }
+
+    private void CreateSettlementLabel(Settlement settlement)
+    {
+        var label = new Label(settlement.name);
+        label.AddToClassList("location-name-label");
+        label.AddToClassList("settlement-name");
+
+        // Store the world position for this label
+        Vector3 worldPos = new Vector3(settlement.position.x, 0, settlement.position.y);
+        worldPositions.Add(worldPos);
+
+        // Position the label (will be updated continuously)
+        Vector2 uiPosition = WorldToUIPosition(settlement.position);
+        PositionLabel(label, uiPosition);
+
+        // Manual styling to avoid CSS conflicts
+        label.style.color = Color.white;
+        label.style.fontSize = settlement.Type == SettlementType.Town ? 14 : 12;
+        label.style.unityFontStyleAndWeight = settlement.Type == SettlementType.Town ? FontStyle.Bold : FontStyle.Normal;
+
+        // Background for visibility
+        label.style.backgroundColor = new Color(0, 0, 0, 0.7f);
+        label.style.paddingLeft = 3;
+        label.style.paddingRight = 3;
+        label.style.paddingTop = 1;
+        label.style.paddingBottom = 1;
+        label.style.borderTopLeftRadius = 3;
+        label.style.borderTopRightRadius = 3;
+        label.style.borderBottomLeftRadius = 3;
+        label.style.borderBottomRightRadius = 3;
+
+        // CRITICAL: Allow clicks to pass through labels to the map beneath
+        label.pickingMode = PickingMode.Ignore;
+
+        // Ensure label is visible
+        label.style.visibility = Visibility.Visible;
+        label.style.display = DisplayStyle.Flex;
+
+        mapContainer.Add(label);
+        nameLabels.Add(label);
+
+        // Debug verification
+        if (debugMode)
+        {
+            Debug.Log($"MapLocationNameDisplay: Added settlement label '{label.text}' at world {worldPos} -> UI {uiPosition}. Container children: {mapContainer.childCount}. PickingMode: {label.pickingMode}");
+        }
+    }
+
+    private void CreateFeatureLabel(GeographicFeature feature)
+    {
+        var label = new Label(feature.name);
+        label.AddToClassList("location-name-label");
+        label.AddToClassList($"{feature.type.ToString().ToLower()}-name");
+
+        // Store the world position for this label
+        Vector2Int featureCenter = feature.GetCenterPosition();
+        Vector3 worldPos = new Vector3(featureCenter.x, 0, featureCenter.y);
+        worldPositions.Add(worldPos);
+
+        // Position the label at feature center (will be updated continuously)
+        Vector2 uiPosition = WorldToUIPosition(featureCenter);
+        PositionLabel(label, uiPosition);
+
+        // Manual styling based on feature type to avoid CSS conflicts
+        Color featureColor = GetFeatureColor(feature.type);
+        label.style.color = featureColor;
+        label.style.fontSize = GetFeatureFontSize(feature.type);
+        label.style.unityFontStyleAndWeight = FontStyle.Normal;
+
+        // Background for visibility
+        label.style.backgroundColor = new Color(0, 0, 0, 0.6f);
+        label.style.paddingLeft = 2;
+        label.style.paddingRight = 2;
+        label.style.paddingTop = 1;
+        label.style.paddingBottom = 1;
+        label.style.borderTopLeftRadius = 3;
+        label.style.borderTopRightRadius = 3;
+        label.style.borderBottomLeftRadius = 3;
+        label.style.borderBottomRightRadius = 3;
+
+        // CRITICAL: Allow clicks to pass through labels to the map beneath
+        label.pickingMode = PickingMode.Ignore;
+
+        // Ensure label is visible
+        label.style.visibility = Visibility.Visible;
+        label.style.display = DisplayStyle.Flex;
+
+        // Add opacity for undiscovered features
+        if (!feature.isDiscovered)
+        {
+            label.style.opacity = 0.6f;
+        }
+
+        mapContainer.Add(label);
+        nameLabels.Add(label);
+
+        // Debug verification
+        if (debugMode)
+        {
+            Debug.Log($"MapLocationNameDisplay: Added feature label '{label.text}' to container. Container children: {mapContainer.childCount}. PickingMode: {label.pickingMode}");
+        }
+    }
+
+    private Color GetFeatureColor(GeographicFeatureType type)
+    {
+        switch (type)
+        {
+            case GeographicFeatureType.Forest:
+                return forestNameColor;
+            case GeographicFeatureType.Lake:
+                return lakeNameColor;
+            case GeographicFeatureType.Plain:
+                return plainNameColor;
+            case GeographicFeatureType.Mountain:
+                return mountainNameColor;
+            case GeographicFeatureType.River:
+                return riverNameColor;
+            default:
+                return Color.white;
+        }
+    }
+
+    private int GetFeatureFontSize(GeographicFeatureType type)
+    {
+        switch (type)
+        {
+            case GeographicFeatureType.Mountain:
+                return 13;
+            case GeographicFeatureType.Forest:
+            case GeographicFeatureType.Lake:
+                return 12;
+            case GeographicFeatureType.Plain:
+            case GeographicFeatureType.River:
+                return 11;
+            default:
+                return 12;
+        }
+    }
+
+    private Vector2 WorldToUIPosition(Vector2Int worldPosition)
+    {
+        if (mainCamera == null || mapData == null)
+        {
+            if (debugMode) Debug.LogWarning("MapLocationNameDisplay: Camera or MapData is null in WorldToUIPosition");
+            return Vector2.zero;
+        }
+
+        // Convert map grid coordinates to world position
+        // Each tile is 1 unit in world space
+        Vector3 worldPos = new Vector3(worldPosition.x, 0, worldPosition.y);
+
+        // Convert world position to screen position
+        Vector3 screenPos = mainCamera.WorldToScreenPoint(worldPos);
+
+        // Convert screen position to UI coordinates
+        if (mapContainer == null)
+        {
+            if (debugMode) Debug.LogWarning("MapLocationNameDisplay: MapContainer is null in WorldToUIPosition");
+            return Vector2.zero;
+        }
+
+        // Get the container's bounds in screen space
+        var containerBounds = mapContainer.worldBound;
+
+        // Convert screen coordinates to UI element coordinates
+        Vector2 uiPosition = new Vector2(
+            screenPos.x - containerBounds.x,
+            (Screen.height - screenPos.y) - containerBounds.y // Flip Y coordinate for UI space
+        );
+
+        if (debugMode && Random.Range(0f, 1f) < 0.05f) // Log occasionally to avoid spam
+        {
+            Debug.Log($"MapLocationNameDisplay: World {worldPosition} -> WorldPos {worldPos} -> Screen {screenPos} -> UI {uiPosition}");
+        }
+
+        return uiPosition;
+    }
+
+    private void PositionLabel(Label label, Vector2 uiPosition)
+    {
+        label.style.position = Position.Absolute;
+
+        // The uiPosition is already calculated relative to the container
+        label.style.left = uiPosition.x;
+        label.style.top = uiPosition.y;
+
+        if (debugMode && Random.Range(0f, 1f) < 0.05f) // Log occasionally to avoid spam
+        {
+            Debug.Log($"MapLocationNameDisplay: Positioned label '{label.text}' at ({uiPosition.x:F1}, {uiPosition.y:F1})");
+        }
+    }
+
+    private void ClearAllLabels()
+    {
+        if (debugMode) Debug.Log($"MapLocationNameDisplay: Clearing {nameLabels.Count} existing labels");
+
+        foreach (var label in nameLabels)
+        {
+            if (label.parent != null)
+            {
+                label.parent.Remove(label);
+            }
+        }
+        nameLabels.Clear();
+        worldPositions.Clear(); // Clear corresponding world positions
+
+        if (debugMode && mapContainer != null)
+        {
+            Debug.Log($"MapLocationNameDisplay: After clearing, container has {mapContainer.childCount} children");
+        }
+    }
+
+    private void StartPositionUpdates()
+    {
+        if (positionUpdateCoroutine != null)
+        {
+            StopCoroutine(positionUpdateCoroutine);
+        }
+        positionUpdateCoroutine = StartCoroutine(UpdateLabelPositions());
+    }
+
+    private void StopPositionUpdates()
+    {
+        if (positionUpdateCoroutine != null)
+        {
+            StopCoroutine(positionUpdateCoroutine);
+            positionUpdateCoroutine = null;
+        }
+    }
+
+    private IEnumerator UpdateLabelPositions()
+    {
+        while (true)
+        {
+            if (mainCamera != null && nameLabels.Count > 0 && worldPositions.Count == nameLabels.Count)
+            {
+                // Only update if camera has moved or zoom changed (more sensitive for smoother updates)
+                bool cameraChanged = false;
+                Vector3 currentCameraPos = mainCamera.transform.position;
+                float currentCameraSize = mainCamera.orthographicSize;
+
+                if (Vector3.Distance(currentCameraPos, lastCameraPosition) > 0.05f ||
+                    Mathf.Abs(currentCameraSize - lastCameraSize) > 0.05f)
+                {
+                    cameraChanged = true;
+                    lastCameraPosition = currentCameraPos;
+                    lastCameraSize = currentCameraSize;
+                }
+
+                if (cameraChanged)
+                {
+                    for (int i = 0; i < nameLabels.Count; i++)
+                    {
+                        if (nameLabels[i] != null && i < worldPositions.Count)
+                        {
+                            Vector3 worldPos = worldPositions[i];
+                            Vector3 screenPos = mainCamera.WorldToScreenPoint(worldPos);
+
+                            // Check if the position is in front of the camera
+                            if (screenPos.z > 0)
+                            {
+                                Vector2 uiPos = ScreenToUIPosition(screenPos);
+                                PositionLabel(nameLabels[i], uiPos);
+                                nameLabels[i].style.visibility = Visibility.Visible;
+                            }
+                            else
+                            {
+                                // Hide labels that are behind the camera
+                                nameLabels[i].style.visibility = Visibility.Hidden;
+                            }
+                        }
+                    }
+                }
+            }
+            yield return new WaitForSeconds(updateFrequency);
+        }
+    }
+
+    private Vector2 ScreenToUIPosition(Vector3 screenPos)
+    {
+        if (mapContainer == null) return Vector2.zero;
+
+        var containerBounds = mapContainer.worldBound;
+
+        // Convert screen coordinates to UI element coordinates
+        Vector2 uiPosition = new Vector2(
+            screenPos.x - containerBounds.x,
+            (Screen.height - screenPos.y) - containerBounds.y // Flip Y coordinate for UI space
+        );
+
+        return uiPosition;
+    }
+
+    // Public methods for toggling different name types
+    public void ToggleSettlementNames(bool show)
+    {
+        showSettlementNames = show;
+        RefreshLocationNames();
+    }
+
+    public void ToggleForestNames(bool show)
+    {
+        showForestNames = show;
+        RefreshLocationNames();
+    }
+
+    public void ToggleLakeNames(bool show)
+    {
+        showLakeNames = show;
+        RefreshLocationNames();
+    }
+
+    public void TogglePlainNames(bool show)
+    {
+        showPlainNames = show;
+        RefreshLocationNames();
+    }
+
+    public void ToggleMountainNames(bool show)
+    {
+        showMountainNames = show;
+        RefreshLocationNames();
+    }
+
+    public void ToggleRiverNames(bool show)
+    {
+        showRiverNames = show;
+        RefreshLocationNames();
+    }
+
+    [ContextMenu("Refresh Names")]
+    public void RefreshNamesManual()
+    {
+        RefreshLocationNames();
+    }
+
+    [ContextMenu("Debug Info")]
+    public void DebugInfo()
+    {
+        Debug.Log($"=== MapLocationNameDisplay Debug Info ===");
+        Debug.Log($"MapData: {(mapData != null ? $"{mapData.Width}x{mapData.Height}" : "NULL")}");
+        Debug.Log($"FeatureManager: {(featureManager != null ? "Found" : "NULL")}");
+        Debug.Log($"MapContainer: {(mapContainer != null ? "Found" : "NULL")}");
+        Debug.Log($"MapUIDocument: {(mapUIDocument != null ? "Found" : "NULL")}");
+        Debug.Log($"Name Labels: {nameLabels.Count}");
+
+        if (featureManager != null)
+        {
+            Debug.Log($"Geographic Features: {featureManager.GeographicFeatures.Count}");
+        }
+
+        if (mapData != null)
+        {
+            var settlements = mapData.GetAllSettlements();
+            Debug.Log($"Settlements: {settlements.Count}");
+        }
+    }
+
+    // IClickBlocker implementation - system disabled, never blocks clicks
+    public bool IsBlockingClick(Vector2 screenPosition)
+    {
+        // System disabled - UI toolkit approach caused too many issues
+        // Moving to 3D world space TextMeshPro approach instead
+        return false;
+    }
+}

+ 228 - 0
Assets/Scripts/UI/MapScene/MapLocationSystemInitializer.cs

@@ -0,0 +1,228 @@
+using UnityEngine;
+using System.Collections;
+
+[System.Serializable]
+public class MapLocationSystemSettings
+{
+    [Header("System Settings")]
+    public bool enableDebugMode = true;
+    public bool autoGenerateFeatures = true;
+    public bool showLegendOnStart = true;
+    public bool showSettlementNamesOnStart = true;
+
+    [Header("Name Display Settings")]
+    public bool showForestNames = true;
+    public bool showLakeNames = true;
+    public bool showPlainNames = false;
+    public bool showMountainNames = true;
+    public bool showRiverNames = true;
+}
+
+public class MapLocationSystemInitializer : MonoBehaviour
+{
+    [Header("System Configuration")]
+    public MapLocationSystemSettings settings = new MapLocationSystemSettings();
+
+    [Header("Component References (Auto-found if null)")]
+    public GeographicFeatureManager featureManager;
+    public MapLocationNameDisplay nameDisplay;
+    public MapSceneLegendUI legendUI;
+    public MapMaker2 mapMaker;
+
+    void Start()
+    {
+        StartCoroutine(InitializeSystemDelayed());
+    }
+
+    IEnumerator InitializeSystemDelayed()
+    {
+        // Wait a frame for all components to awake
+        yield return null;
+
+        Debug.Log("MapLocationSystemInitializer: Starting system initialization...");
+
+        // Find components if not assigned
+        FindComponents();
+
+        // Configure debug modes
+        ConfigureDebugModes();
+
+        // Wait for map generation if needed
+        yield return StartCoroutine(WaitForMapGeneration());
+
+        // Initialize geographic features
+        yield return StartCoroutine(InitializeGeographicFeatures());
+
+        // Initialize name display
+        yield return StartCoroutine(InitializeNameDisplay());
+
+        // Initialize legend UI
+        yield return StartCoroutine(InitializeLegendUI());
+
+        // Connect legend to name display
+        ConnectLegendToNameDisplay();
+
+        Debug.Log("MapLocationSystemInitializer: System initialization complete!");
+
+        // Print status
+        PrintSystemStatus();
+    }
+
+    void FindComponents()
+    {
+        if (featureManager == null)
+            featureManager = FindFirstObjectByType<GeographicFeatureManager>();
+
+        if (nameDisplay == null)
+            nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+
+        if (legendUI == null)
+            legendUI = FindFirstObjectByType<MapSceneLegendUI>();
+
+        if (mapMaker == null)
+            mapMaker = FindFirstObjectByType<MapMaker2>();
+
+        Debug.Log($"Found components - FeatureManager: {featureManager != null}, NameDisplay: {nameDisplay != null}, LegendUI: {legendUI != null}, MapMaker: {mapMaker != null}");
+    }
+
+    void ConfigureDebugModes()
+    {
+        if (nameDisplay != null)
+            nameDisplay.debugMode = settings.enableDebugMode;
+
+        if (legendUI != null)
+            legendUI.debugMode = settings.enableDebugMode;
+
+        if (featureManager != null)
+            featureManager.debugMode = settings.enableDebugMode;
+    }
+
+    IEnumerator WaitForMapGeneration()
+    {
+        if (mapMaker == null)
+        {
+            Debug.LogWarning("MapLocationSystemInitializer: MapMaker not found - cannot wait for map generation");
+            yield break;
+        }
+
+        // Wait for map to be generated
+        int maxWaitFrames = 300; // 5 seconds at 60fps
+        int waitedFrames = 0;
+
+        while (mapMaker.GetMapData() == null && waitedFrames < maxWaitFrames)
+        {
+            yield return null;
+            waitedFrames++;
+        }
+
+        if (mapMaker.GetMapData() != null)
+        {
+            Debug.Log("MapLocationSystemInitializer: Map generation complete");
+        }
+        else
+        {
+            Debug.LogWarning("MapLocationSystemInitializer: Timeout waiting for map generation");
+        }
+    }
+
+    IEnumerator InitializeGeographicFeatures()
+    {
+        if (featureManager == null)
+        {
+            Debug.LogWarning("MapLocationSystemInitializer: FeatureManager not found");
+            yield break;
+        }
+
+        if (settings.autoGenerateFeatures)
+        {
+            Debug.Log("MapLocationSystemInitializer: Generating geographic features...");
+            featureManager.GenerateFeatures(mapMaker.GetMapData());
+
+            // Wait a frame for generation to complete
+            yield return null;
+
+            Debug.Log($"MapLocationSystemInitializer: Generated {featureManager.GeographicFeatures.Count} geographic features");
+        }
+    }
+
+    IEnumerator InitializeNameDisplay()
+    {
+        if (nameDisplay == null)
+        {
+            Debug.LogWarning("MapLocationSystemInitializer: NameDisplay not found");
+            yield break;
+        }
+
+        Debug.Log("MapLocationSystemInitializer: Initializing name display...");
+
+        // Configure name visibility settings
+        nameDisplay.showSettlementNames = settings.showSettlementNamesOnStart;
+        nameDisplay.showForestNames = settings.showForestNames;
+        nameDisplay.showLakeNames = settings.showLakeNames;
+        nameDisplay.showPlainNames = settings.showPlainNames;
+        nameDisplay.showMountainNames = settings.showMountainNames;
+        nameDisplay.showRiverNames = settings.showRiverNames;
+
+        // Wait a frame for UI layout
+        yield return null;
+
+        // Refresh names
+        nameDisplay.RefreshLocationNames();
+
+        Debug.Log("MapLocationSystemInitializer: Name display initialized");
+    }
+
+    IEnumerator InitializeLegendUI()
+    {
+        if (legendUI == null)
+        {
+            Debug.LogWarning("MapLocationSystemInitializer: LegendUI not found");
+            yield break;
+        }
+
+        Debug.Log("MapLocationSystemInitializer: Initializing legend UI...");
+
+        // Wait a frame for UI setup
+        yield return null;
+
+        // Set initial visibility
+        if (settings.showLegendOnStart)
+        {
+            legendUI.SetLegendVisible(true);
+        }
+
+        Debug.Log("MapLocationSystemInitializer: Legend UI initialized");
+    }
+
+    void PrintSystemStatus()
+    {
+        Debug.Log("=== MAP LOCATION SYSTEM STATUS ===");
+        Debug.Log($"Geographic Features: {(featureManager != null ? featureManager.GeographicFeatures.Count.ToString() : "N/A")}");
+        Debug.Log($"Legend UI Active: {(legendUI != null ? "Yes" : "No")}");
+        Debug.Log($"Name Display Active: {(nameDisplay != null ? "Yes" : "No")}");
+        Debug.Log($"Settlement Names: {(nameDisplay != null ? nameDisplay.showSettlementNames.ToString() : "N/A")}");
+        Debug.Log($"Forest Names: {(nameDisplay != null ? nameDisplay.showForestNames.ToString() : "N/A")}");
+        Debug.Log("=================================");
+    }
+
+    private void ConnectLegendToNameDisplay()
+    {
+        if (legendUI != null)
+        {
+            legendUI.RefreshNameDisplayConnection();
+            Debug.Log("MapLocationSystemInitializer: Connected legend to name display");
+        }
+    }
+
+    [ContextMenu("Reinitialize System")]
+    public void ReinitializeSystem()
+    {
+        StartCoroutine(InitializeSystemDelayed());
+    }
+
+    [ContextMenu("Print System Status")]
+    public void PrintCurrentStatus()
+    {
+        PrintSystemStatus();
+    }
+}

+ 342 - 0
Assets/Scripts/UI/MapScene/MapLocationSystemSetup.cs

@@ -0,0 +1,342 @@
+using UnityEngine;
+using UnityEngine.UIElements;
+
+/// <summary>
+/// Helper script to automatically set up the Map Location Names and Legend system.
+/// Add this to a GameObject in MapScene2 to automatically configure all components.
+/// </summary>
+public class MapLocationSystemSetup : MonoBehaviour
+{
+    [Header("Auto Setup Configuration")]
+    public bool setupOnStart = true;
+    public bool findExistingComponents = true;
+
+    [Header("Feature Generation Settings")]
+    public bool enableAutoGeneration = true;
+    public bool enableDebugMode = false;
+
+    [Header("Legend Settings")]
+    public bool legendStartVisible = true;
+    public KeyCode legendToggleKey = KeyCode.L;
+
+    [Header("Name Display Settings")]
+    public bool showSettlements = true;
+    public bool showForests = true;
+    public bool showLakes = true;
+    public bool showPlains = true;
+    public bool showMountains = true;
+    public bool showRivers = true;
+
+    [Header("References (Optional - will auto-find if not set)")]
+    public UIDocument mapUIDocument;
+
+    private void Start()
+    {
+        if (setupOnStart)
+        {
+            SetupMapLocationSystem();
+        }
+    }
+
+    [ContextMenu("Setup Map Location System")]
+    public void SetupMapLocationSystem()
+    {
+        Debug.Log("🚀 Setting up Map Location Names and Legend System...");
+
+        SetupGeographicFeatureManager();
+        SetupMapLocationNameDisplay();
+        SetupMapLegendUI();
+        ConnectLegendToNameDisplay();
+        SetupClickManager();
+
+        Debug.Log("✅ Map Location System setup complete!");
+    }
+
+    [ContextMenu("Force Refresh All Components")]
+    public void ForceRefreshAllComponents()
+    {
+        Debug.Log("🔄 Force refreshing all map location components...");
+
+        // Force setup even for existing components
+        bool originalFindExisting = findExistingComponents;
+        findExistingComponents = false;
+
+        SetupMapLocationSystem();
+
+        findExistingComponents = originalFindExisting;
+
+        // Force refresh names
+        RefreshLocationNames();
+
+        Debug.Log("✅ Force refresh complete!");
+    }
+
+    private void ConnectLegendToNameDisplay()
+    {
+        var legendUI = FindFirstObjectByType<MapSceneLegendUI>();
+        if (legendUI != null)
+        {
+            legendUI.RefreshNameDisplayConnection();
+            Debug.Log("🔗 Connected legend to name display");
+        }
+    }
+
+    private void SetupGeographicFeatureManager()
+    {
+        var existing = FindFirstObjectByType<GeographicFeatureManager>();
+        if (existing != null && findExistingComponents)
+        {
+            Debug.Log("📍 Found existing GeographicFeatureManager");
+            ConfigureFeatureManager(existing);
+            return;
+        }
+
+        // Create GeographicFeatureManager
+        GameObject featureManagerGO = new GameObject("GeographicFeatureManager");
+        var featureManager = featureManagerGO.AddComponent<GeographicFeatureManager>();
+        ConfigureFeatureManager(featureManager);
+
+        Debug.Log("📍 Created GeographicFeatureManager");
+    }
+
+    private void ConfigureFeatureManager(GeographicFeatureManager manager)
+    {
+        manager.autoGenerateFeatures = enableAutoGeneration;
+        manager.debugMode = enableDebugMode;
+    }
+
+    private void SetupMapLocationNameDisplay()
+    {
+        var existing = FindFirstObjectByType<MapLocationNameDisplay>();
+        if (existing != null && findExistingComponents)
+        {
+            Debug.Log("🏷️ Found existing MapLocationNameDisplay");
+            ConfigureNameDisplay(existing);
+
+            // Ensure existing component has proper UIDocument setup
+            var existingUIDocument = existing.GetComponent<UIDocument>();
+            if (existingUIDocument != null)
+            {
+                SetupUIDocumentForNameDisplay(existingUIDocument);
+            }
+            return;
+        }
+
+        // Create MapLocationNameDisplay
+        GameObject nameDisplayGO = new GameObject("MapLocationNameDisplay");
+        var nameDisplay = nameDisplayGO.AddComponent<MapLocationNameDisplay>();
+
+        // Add UIDocument component for the name display
+        var nameUIDocument = nameDisplayGO.AddComponent<UIDocument>();
+        SetupUIDocumentForNameDisplay(nameUIDocument);
+
+        ConfigureNameDisplay(nameDisplay);
+
+        Debug.Log("🏷️ Created MapLocationNameDisplay");
+    }
+
+    private void SetupUIDocumentForNameDisplay(UIDocument uiDocument)
+    {
+        uiDocument.sortingOrder = 1; // Above map terrain, below UI panels
+
+        // Set PanelSettings using fallback approach
+        SetupPanelSettings(uiDocument, "Name Display");
+
+        // Load the UXML template
+        var nameDisplayUXML = Resources.Load<VisualTreeAsset>("UI/MapLocationNameDisplay");
+        if (nameDisplayUXML != null)
+        {
+            uiDocument.visualTreeAsset = nameDisplayUXML;
+            Debug.Log("✅ Loaded UXML template for Name Display");
+        }
+        else
+        {
+            Debug.LogWarning("Could not find MapLocationNameDisplay.uxml template in Resources/UI/");
+        }
+    }
+
+    private void ConfigureNameDisplay(MapLocationNameDisplay display)
+    {
+        // Configure the display settings
+        display.showSettlementNames = showSettlements;
+        display.showForestNames = showForests;
+        display.showLakeNames = showLakes;
+        display.showPlainNames = showPlains;
+        display.showMountainNames = showMountains;
+        display.showRiverNames = showRivers;
+    }
+
+    private void SetupMapLegendUI()
+    {
+        var existing = FindFirstObjectByType<MapSceneLegendUI>();
+        if (existing != null && findExistingComponents)
+        {
+            Debug.Log("🗺️ Found existing MapSceneLegendUI");
+            ConfigureLegendUI(existing);
+
+            // Ensure existing component has proper UIDocument setup
+            var existingUIDocument = existing.GetComponent<UIDocument>();
+            if (existingUIDocument != null)
+            {
+                SetupUIDocumentForLegend(existingUIDocument);
+            }
+            return;
+        }
+
+        // Create MapSceneLegendUI
+        GameObject legendGO = new GameObject("MapSceneLegendUI");
+        var uiDocument = legendGO.AddComponent<UIDocument>();
+        var legendUI = legendGO.AddComponent<MapSceneLegendUI>();
+
+        SetupUIDocumentForLegend(uiDocument);
+        legendUI.uiDocument = uiDocument;
+        ConfigureLegendUI(legendUI);
+
+        Debug.Log("🗺️ Created MapSceneLegendUI");
+    }
+
+    private void SetupUIDocumentForLegend(UIDocument uiDocument)
+    {
+        // Set sorting order to be above name display but below modal UIs
+        uiDocument.sortingOrder = 2; // Above name display (1), below other UI panels (3+)
+
+        // Set PanelSettings using fallback approach
+        SetupPanelSettings(uiDocument, "Legend UI");
+
+        // Load the UXML template for the legend
+        var legendUXML = Resources.Load<VisualTreeAsset>("UI/MapLegend");
+        if (legendUXML != null)
+        {
+            uiDocument.visualTreeAsset = legendUXML;
+            Debug.Log("✅ Loaded UXML template for Legend UI");
+        }
+        else
+        {
+            Debug.LogWarning("Could not find MapLegend.uxml template in Resources/UI/");
+        }
+    }
+
+    private void ConfigureLegendUI(MapSceneLegendUI legendUI)
+    {
+        legendUI.startVisible = legendStartVisible;
+        legendUI.toggleKey = legendToggleKey;
+    }
+
+    private void SetupClickManager()
+    {
+        // ClickManager is a singleton that creates itself, just ensure it exists
+        var clickManager = ClickManager.Instance;
+        if (clickManager != null)
+        {
+            Debug.Log("🖱️ ClickManager ready");
+        }
+        else
+        {
+            Debug.LogWarning("⚠️ ClickManager could not be initialized");
+        }
+    }
+
+    private void SetupPanelSettings(UIDocument uiDocument, string componentName)
+    {
+        // Try multiple fallback approaches to find PanelSettings
+        UnityEngine.UIElements.PanelSettings panelSettings = null;
+
+        // 1. Try loading from Resources (original approach)
+        panelSettings = Resources.Load<UnityEngine.UIElements.PanelSettings>("MainSettings");
+        if (panelSettings != null)
+        {
+            uiDocument.panelSettings = panelSettings;
+            Debug.Log($"✅ Set Panel Settings for {componentName} from Resources");
+            return;
+        }
+
+        // 2. Try getting from TravelUI GameObject
+        var travelUI = FindFirstObjectByType<TravelUI>();
+        if (travelUI != null && travelUI.uiDocument != null && travelUI.uiDocument.panelSettings != null)
+        {
+            uiDocument.panelSettings = travelUI.uiDocument.panelSettings;
+            Debug.Log($"✅ Set Panel Settings for {componentName} from TravelUI");
+            return;
+        }
+
+        // 3. Try getting from any existing UIDocument with valid PanelSettings
+        var allUIDocuments = FindObjectsByType<UIDocument>(FindObjectsSortMode.None);
+        foreach (var existingUIDoc in allUIDocuments)
+        {
+            if (existingUIDoc.panelSettings != null)
+            {
+                uiDocument.panelSettings = existingUIDoc.panelSettings;
+                Debug.Log($"✅ Set Panel Settings for {componentName} from existing UIDocument");
+                return;
+            }
+        }
+
+        Debug.LogWarning($"⚠️ Could not find any PanelSettings for {componentName}");
+    }
+
+    [ContextMenu("Find Map UI Document")]
+    public void FindMapUIDocument()
+    {
+        var uiDocs = FindObjectsByType<UIDocument>(FindObjectsSortMode.None);
+        foreach (var doc in uiDocs)
+        {
+            if (doc.rootVisualElement != null)
+            {
+                mapUIDocument = doc;
+                Debug.Log($"📄 Found UIDocument on {doc.gameObject.name}");
+                break;
+            }
+        }
+
+        if (mapUIDocument == null)
+        {
+            Debug.LogWarning("⚠️ No suitable UIDocument found in scene");
+        }
+    }
+
+    [ContextMenu("Regenerate All Features")]
+    public void RegenerateAllFeatures()
+    {
+        var featureManager = FindFirstObjectByType<GeographicFeatureManager>();
+        if (featureManager != null)
+        {
+            featureManager.RegenerateFeatures();
+            Debug.Log("🔄 Regenerated geographic features");
+        }
+        else
+        {
+            Debug.LogWarning("⚠️ GeographicFeatureManager not found");
+        }
+    }
+
+    [ContextMenu("Refresh Location Names")]
+    public void RefreshLocationNames()
+    {
+        var nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+        if (nameDisplay != null)
+        {
+            nameDisplay.RefreshLocationNames();
+            Debug.Log("🔄 Refreshed location names");
+        }
+        else
+        {
+            Debug.LogWarning("⚠️ MapLocationNameDisplay not found");
+        }
+    }
+
+    [ContextMenu("Test Click Blocking")]
+    public void TestClickBlocking()
+    {
+        var clickManager = ClickManager.Instance;
+        if (clickManager != null)
+        {
+            bool isBlocked = clickManager.IsClickBlocked(Input.mousePosition);
+            Debug.Log($"🖱️ Click at mouse position {Input.mousePosition} is {(isBlocked ? "BLOCKED" : "ALLOWED")}");
+            Debug.Log($"📊 Active blockers: {clickManager.GetRegisteredBlockersCount()}");
+        }
+        else
+        {
+            Debug.LogWarning("⚠️ ClickManager not available");
+        }
+    }
+}

+ 260 - 0
Assets/Scripts/UI/MapScene/MapLocationTestHelper.cs

@@ -0,0 +1,260 @@
+using UnityEngine;
+using UnityEngine.UIElements;
+
+/// <summary>
+/// Simple test script to help debug and fix map location positioning issues.
+/// Add this to a GameObject in MapScene2 to test the location naming system.
+/// </summary>
+public class MapLocationTestHelper : MonoBehaviour
+{
+    [Header("Test Settings")]
+    public bool runTestOnStart = false;
+    public KeyCode testKey = KeyCode.T;
+
+    [Header("Debug")]
+    public bool verboseLogging = true;
+
+    private void Start()
+    {
+        if (runTestOnStart)
+        {
+            RunDiagnostics();
+        }
+    }
+
+    private void Update()
+    {
+        if (Input.GetKeyDown(testKey))
+        {
+            RunDiagnostics();
+        }
+    }
+
+    [ContextMenu("Run Full Diagnostics")]
+    public void RunDiagnostics()
+    {
+        Debug.Log("=== MAP LOCATION SYSTEM DIAGNOSTICS ===");
+
+        TestMapMaker();
+        TestGeographicFeatures();
+        TestNameDisplay();
+        TestLegend();
+        TestUISetup();
+
+        Debug.Log("=== DIAGNOSTICS COMPLETE ===");
+    }
+
+    private void TestMapMaker()
+    {
+        Debug.Log("--- Testing MapMaker2 ---");
+        var mapMaker = FindFirstObjectByType<MapMaker2>();
+        if (mapMaker != null)
+        {
+            var mapData = mapMaker.GetMapData();
+            if (mapData != null)
+            {
+                Debug.Log($"✅ MapMaker2 found with MapData: {mapData.Width}x{mapData.Height}");
+                var settlements = mapData.GetAllSettlements();
+                Debug.Log($"✅ Settlements found: {settlements.Count}");
+
+                if (verboseLogging && settlements.Count > 0)
+                {
+                    foreach (var settlement in settlements)
+                    {
+                        Debug.Log($"  - {settlement.name} ({settlement.Type}) at {settlement.position}");
+                    }
+                }
+            }
+            else
+            {
+                Debug.LogError("❌ MapMaker2 found but MapData is null");
+            }
+        }
+        else
+        {
+            Debug.LogError("❌ MapMaker2 not found in scene");
+        }
+    }
+
+    private void TestGeographicFeatures()
+    {
+        Debug.Log("--- Testing Geographic Features ---");
+        var featureManager = FindFirstObjectByType<GeographicFeatureManager>();
+        if (featureManager != null)
+        {
+            var features = featureManager.GeographicFeatures;
+            Debug.Log($"✅ GeographicFeatureManager found with {features.Count} features");
+
+            if (verboseLogging && features.Count > 0)
+            {
+                foreach (var feature in features)
+                {
+                    Debug.Log($"  - {feature.name} ({feature.type}) at {feature.centerPosition} with {feature.tiles.Count} tiles");
+                }
+            }
+        }
+        else
+        {
+            Debug.LogError("❌ GeographicFeatureManager not found in scene");
+        }
+    }
+
+    private void TestNameDisplay()
+    {
+        Debug.Log("--- Testing Name Display ---");
+        var nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+        if (nameDisplay != null)
+        {
+            Debug.Log($"✅ MapLocationNameDisplay found");
+            Debug.Log($"  - Show Settlements: {nameDisplay.showSettlementNames}");
+            Debug.Log($"  - Show Forests: {nameDisplay.showForestNames}");
+            Debug.Log($"  - Show Lakes: {nameDisplay.showLakeNames}");
+
+            // Test if it has a UIDocument
+            if (nameDisplay.mapUIDocument != null)
+            {
+                Debug.Log($"✅ UIDocument assigned");
+                if (nameDisplay.mapUIDocument.rootVisualElement != null)
+                {
+                    Debug.Log($"✅ Root visual element exists");
+                    var mapContainer = nameDisplay.mapUIDocument.rootVisualElement.Q<VisualElement>("map-container");
+                    if (mapContainer != null)
+                    {
+                        Debug.Log($"✅ Map container found: {mapContainer.worldBound}");
+                    }
+                    else
+                    {
+                        Debug.LogWarning("⚠️ Map container not found");
+                    }
+                }
+                else
+                {
+                    Debug.LogError("❌ Root visual element is null");
+                }
+            }
+            else
+            {
+                Debug.LogError("❌ UIDocument not assigned to MapLocationNameDisplay");
+            }
+        }
+        else
+        {
+            Debug.LogError("❌ MapLocationNameDisplay not found in scene");
+        }
+    }
+
+    private void TestLegend()
+    {
+        Debug.Log("--- Testing Legend ---");
+        var legend = FindFirstObjectByType<MapSceneLegendUI>();
+        if (legend != null)
+        {
+            Debug.Log($"✅ MapSceneLegendUI found");
+            Debug.Log($"  - Start Visible: {legend.startVisible}");
+            Debug.Log($"  - Toggle Key: {legend.toggleKey}");
+
+            if (legend.uiDocument != null)
+            {
+                Debug.Log($"✅ UIDocument assigned");
+                if (legend.uiDocument.rootVisualElement != null)
+                {
+                    Debug.Log($"✅ Root visual element exists with {legend.uiDocument.rootVisualElement.childCount} children");
+                }
+                else
+                {
+                    Debug.LogError("❌ Root visual element is null");
+                }
+            }
+            else
+            {
+                Debug.LogError("❌ UIDocument not assigned to MapSceneLegendUI");
+            }
+        }
+        else
+        {
+            Debug.LogError("❌ MapSceneLegendUI not found in scene");
+        }
+    }
+
+    private void TestUISetup()
+    {
+        Debug.Log("--- Testing UI Setup ---");
+        var uiDocuments = FindObjectsByType<UIDocument>(FindObjectsSortMode.None);
+        Debug.Log($"Found {uiDocuments.Length} UIDocument components in scene");
+
+        foreach (var doc in uiDocuments)
+        {
+            if (doc.rootVisualElement != null)
+            {
+                Debug.Log($"  - {doc.gameObject.name}: Root element with {doc.rootVisualElement.childCount} children");
+            }
+            else
+            {
+                Debug.LogWarning($"  - {doc.gameObject.name}: No root element");
+            }
+        }
+    }
+
+    [ContextMenu("Force Refresh All")]
+    public void ForceRefreshAll()
+    {
+        Debug.Log("=== FORCING REFRESH OF ALL SYSTEMS ===");
+
+        // Refresh geographic features
+        var featureManager = FindFirstObjectByType<GeographicFeatureManager>();
+        if (featureManager != null)
+        {
+            featureManager.RegenerateFeatures();
+            Debug.Log("✅ Regenerated geographic features");
+        }
+
+        // Refresh name display
+        var nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+        if (nameDisplay != null)
+        {
+            nameDisplay.RefreshLocationNames();
+            Debug.Log("✅ Refreshed location names");
+        }
+
+        // Refresh legend
+        var legend = FindFirstObjectByType<MapSceneLegendUI>();
+        if (legend != null)
+        {
+            legend.OnFeaturesGenerated();
+            Debug.Log("✅ Refreshed legend");
+        }
+
+        Debug.Log("=== REFRESH COMPLETE ===");
+    }
+
+    [ContextMenu("Test Coordinate Conversion")]
+    public void TestCoordinateConversion()
+    {
+        var nameDisplay = FindFirstObjectByType<MapLocationNameDisplay>();
+        var mapMaker = FindFirstObjectByType<MapMaker2>();
+
+        if (nameDisplay != null && mapMaker != null)
+        {
+            var mapData = mapMaker.GetMapData();
+            if (mapData != null)
+            {
+                Debug.Log("=== TESTING COORDINATE CONVERSION ===");
+
+                // Test corner coordinates
+                var testPoints = new Vector2Int[]
+                {
+                    new Vector2Int(0, 0),
+                    new Vector2Int(mapData.Width / 2, mapData.Height / 2),
+                    new Vector2Int(mapData.Width - 1, mapData.Height - 1)
+                };
+
+                foreach (var point in testPoints)
+                {
+                    // We can't directly call WorldToUIPosition as it's private,
+                    // but we can test with settlements at those positions
+                    Debug.Log($"World point {point} would be at map bounds");
+                }
+            }
+        }
+    }
+}

+ 993 - 0
Assets/Scripts/UI/MapScene/WorldSpaceLocationNames.cs

@@ -0,0 +1,993 @@
+using UnityEngine;
+using TMPro;
+using System.Collections.Generic;
+using System.Collections;
+
+public class WorldSpaceLocationNames : MonoBehaviour
+{
+    [Header("Display Settings")]
+    public bool showSettlementNames = true;
+    public bool showForestNames = true;
+    public bool showLakeNames = true;
+    public bool showPlainNames = true;
+    public bool showMountainNames = true;
+    public bool showRiverNames = true;
+
+    [Header("Visual Settings")]
+    public Color settlementNameColor = Color.white;
+    public Color forestNameColor = Color.green;
+    public Color lakeNameColor = Color.cyan;
+    public Color plainNameColor = Color.yellow;
+    public Color mountainNameColor = Color.gray;
+    public Color riverNameColor = Color.blue;
+
+    [Header("3D Text Settings")]
+    public GameObject textPrefab; // TextMeshPro 3D prefab
+    public float textSize = 72f; // Large size for visibility (was 10f)
+    public float heightOffset = 0.5f; // Small offset above terrain (0.5 = just above ground)
+    public bool faceCamera = false; // Disabled by default to allow manual rotation control
+    public Vector3 fixedRotation = new Vector3(90, 0, 0); // Fixed rotation for text (X=90 for flat text)
+    public float maxViewDistance = 0f; // Disabled by default (was 100f) - distance culling causes visibility issues
+
+    [Header("Rendering Order")]
+    public string sortingLayerName = "Default"; // Sorting layer for text rendering
+    public int sortingOrder = 2; // Order in layer (higher = renders on top). Roads are 1, so use 2+
+    public bool useBuiltInTextMesh = false; // Fallback to Unity's TextMesh if TextMeshPro fails
+
+    [Header("Debug")]
+    public bool debugMode = true;
+
+    private List<GameObject> nameObjects = new List<GameObject>();
+    private GeographicFeatureManager featureManager;
+    private MapData mapData;
+    private MapMaker2 mapMaker;
+    private Camera mainCamera;
+    private Transform nameContainer;
+
+    private void Start()
+    {
+        StartCoroutine(InitializeDelayed());
+    }
+
+    private IEnumerator InitializeDelayed()
+    {
+        // Wait for map generation to complete
+        yield return new WaitForSeconds(1f);
+
+        InitializeReferences();
+        CreateNameContainer();
+
+        if (textPrefab == null)
+        {
+            CreateDefaultTextPrefab();
+
+            // If TextMeshPro setup failed, try built-in TextMesh as fallback
+            if (textPrefab == null)
+            {
+                useBuiltInTextMesh = true;
+                CreateFallbackTextPrefab();
+            }
+        }
+
+        yield return new WaitForSeconds(0.5f);
+        RefreshLocationNames();
+
+        // Automatically apply visibility fixes at startup
+        yield return new WaitForSeconds(0.1f); // Small delay to ensure objects are created
+        ApplyVisibilityFixesAtStartup();
+    }
+
+    private void InitializeReferences()
+    {
+        featureManager = FindFirstObjectByType<GeographicFeatureManager>();
+
+        // If GeographicFeatureManager isn't found, try to find it by name
+        if (featureManager == null)
+        {
+            GameObject gfmObject = GameObject.Find("GeographicFeatureManager");
+            if (gfmObject != null)
+            {
+                featureManager = gfmObject.GetComponent<GeographicFeatureManager>();
+            }
+        }
+
+        mapMaker = FindFirstObjectByType<MapMaker2>();
+        mainCamera = Camera.main ?? FindFirstObjectByType<Camera>();
+
+        if (mapMaker != null)
+        {
+            mapData = mapMaker.GetMapData();
+        }
+
+        if (debugMode)
+        {
+            Debug.Log($"WorldSpaceLocationNames: Initialized");
+            Debug.Log($"  - FeatureManager: {(featureManager != null ? $"Found ({featureManager.GeographicFeatures.Count} features)" : "NULL")}");
+            Debug.Log($"  - MapData: {(mapData != null ? $"Found ({mapData.Width}x{mapData.Height})" : "NULL")}");
+            Debug.Log($"  - Camera: {(mainCamera != null ? "Found" : "NULL")}");
+        }
+    }
+
+    private void CreateNameContainer()
+    {
+        GameObject containerObj = new GameObject("LocationNameContainer");
+        containerObj.transform.parent = transform;
+        containerObj.transform.localPosition = Vector3.zero;
+        containerObj.transform.localRotation = Quaternion.identity;
+        containerObj.transform.localScale = Vector3.one;
+        nameContainer = containerObj.transform;
+    }
+
+    private void CreateDefaultTextPrefab()
+    {
+        // Create a simple TextMeshPro 3D prefab if none is assigned
+        GameObject prefab = new GameObject("DefaultLocationNameText");
+
+        TextMeshPro tmp = prefab.AddComponent<TextMeshPro>();
+        tmp.text = "Sample Text";
+        tmp.fontSize = textSize; // Use the large font size (72f)
+        tmp.color = Color.white;
+        tmp.alignment = TextAlignmentOptions.Center;
+        tmp.autoSizeTextContainer = false; // Disable auto-sizing based on user findings
+
+        // Make sure the text has proper bounds - use larger size based on user findings
+        tmp.rectTransform.sizeDelta = new Vector2(40, 20);
+
+        // Try to assign a font asset - this is crucial for visibility
+        TMP_FontAsset fontAsset = null;
+
+        // First try to get the default font from TMP Settings
+        if (TMP_Settings.defaultFontAsset != null)
+        {
+            fontAsset = TMP_Settings.defaultFontAsset;
+        }
+        else
+        {
+            // Try to load the default TMP font from Resources
+            fontAsset = Resources.Load<TMP_FontAsset>("LiberationSans SDF");
+            if (fontAsset == null)
+            {
+                // Try alternative resource paths
+                fontAsset = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF");
+            }
+        }
+
+        if (fontAsset != null)
+        {
+            tmp.font = fontAsset;
+        }
+        else
+        {
+            // If no TMP font is found, we'll rely on the default behavior
+            Debug.LogWarning("WorldSpaceLocationNames: No TMP_FontAsset found, using default font");
+        }
+
+        // Set up the material properly
+        MeshRenderer renderer = prefab.GetComponent<MeshRenderer>();
+        if (renderer != null)
+        {
+            // Ensure renderer is enabled
+            renderer.enabled = true;
+            renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
+            renderer.receiveShadows = false;
+
+            // Try to use the font's material if available
+            if (tmp.font != null && tmp.font.material != null)
+            {
+                renderer.material = tmp.font.material;
+            }
+            else
+            {
+                // Create a basic material for TextMeshPro with fallbacks
+                Material tmpMaterial = null;
+
+                if (Shader.Find("TextMeshPro/Distance Field") != null)
+                {
+                    tmpMaterial = new Material(Shader.Find("TextMeshPro/Distance Field"));
+                    tmpMaterial.color = Color.white;
+                }
+                else if (Shader.Find("TextMeshPro/Mobile/Distance Field") != null)
+                {
+                    tmpMaterial = new Material(Shader.Find("TextMeshPro/Mobile/Distance Field"));
+                    tmpMaterial.color = Color.white;
+                }
+                else if (Shader.Find("GUI/Text Shader") != null)
+                {
+                    tmpMaterial = new Material(Shader.Find("GUI/Text Shader"));
+                    tmpMaterial.color = Color.white;
+                }
+                else
+                {
+                    // Last resort - simple unlit color
+                    tmpMaterial = new Material(Shader.Find("Unlit/Color"));
+                    tmpMaterial.color = Color.white;
+                }
+
+                if (tmpMaterial != null)
+                {
+                    renderer.material = tmpMaterial;
+                }
+            }
+        }
+
+        textPrefab = prefab;
+
+        if (debugMode)
+        {
+            Debug.Log($"WorldSpaceLocationNames: Created default TextMeshPro prefab");
+            Debug.Log($"  - Font: {(tmp.font != null ? tmp.font.name : "NULL")}");
+            Debug.Log($"  - Material: {(renderer.material != null ? renderer.material.name : "NULL")}");
+            Debug.Log($"  - Shader: {(renderer.material != null && renderer.material.shader != null ? renderer.material.shader.name : "NULL")}");
+        }
+    }
+
+    private void CreateFallbackTextPrefab()
+    {
+        // Create a simple Unity TextMesh 3D prefab as fallback
+        GameObject prefab = new GameObject("FallbackLocationNameText");
+
+        TextMesh textMesh = prefab.AddComponent<TextMesh>();
+        textMesh.text = "Sample Text";
+        textMesh.fontSize = (int)textSize;
+        textMesh.color = Color.white;
+        textMesh.anchor = TextAnchor.MiddleCenter;
+        textMesh.alignment = TextAlignment.Center;
+
+        // Set up the mesh renderer with a simple material
+        MeshRenderer renderer = prefab.GetComponent<MeshRenderer>();
+        if (renderer != null)
+        {
+            // Use Unity's default font material
+            Material fontMaterial = Resources.GetBuiltinResource<Material>("Default-Material");
+            if (fontMaterial != null)
+            {
+                renderer.material = fontMaterial;
+            }
+            else
+            {
+                // Create a simple unlit material
+                Material simpleMaterial = new Material(Shader.Find("Unlit/Color"));
+                simpleMaterial.color = Color.white;
+                renderer.material = simpleMaterial;
+            }
+        }
+
+        textPrefab = prefab;
+
+        if (debugMode) Debug.Log("WorldSpaceLocationNames: Created fallback Unity TextMesh prefab");
+    }
+
+    public void RefreshLocationNames()
+    {
+        ClearAllNames();
+
+        if (mapData == null || textPrefab == null)
+        {
+            if (debugMode) Debug.LogWarning($"WorldSpaceLocationNames: Cannot refresh - mapData: {(mapData != null ? "OK" : "NULL")}, textPrefab: {(textPrefab != null ? "OK" : "NULL")}");
+            return;
+        }
+
+        if (debugMode) Debug.Log("WorldSpaceLocationNames: Refreshing location names...");
+
+        // Display settlement names
+        if (showSettlementNames)
+        {
+            DisplaySettlementNames();
+        }
+
+        // Display geographic feature names
+        if (featureManager != null && featureManager.GeographicFeatures != null)
+        {
+            foreach (var feature in featureManager.GeographicFeatures)
+            {
+                if (ShouldDisplayFeature(feature))
+                {
+                    CreateFeatureName(feature);
+                }
+            }
+        }
+
+        if (debugMode)
+        {
+            Debug.Log($"WorldSpaceLocationNames: Created {nameObjects.Count} name objects");
+
+            // Debug camera information
+            if (mainCamera != null)
+            {
+                Debug.Log($"  - Camera position: {mainCamera.transform.position}");
+                Debug.Log($"  - Camera rotation: {mainCamera.transform.rotation.eulerAngles}");
+                Debug.Log($"  - Camera far clip: {mainCamera.farClipPlane}");
+            }
+
+            // Debug first few name objects
+            for (int i = 0; i < Mathf.Min(3, nameObjects.Count); i++)
+            {
+                if (nameObjects[i] != null)
+                {
+                    Debug.Log($"  - Name object {i}: '{nameObjects[i].name}' at {nameObjects[i].transform.position}");
+
+                    // Check if it has TextMeshPro
+                    TextMeshPro tmp = nameObjects[i].GetComponent<TextMeshPro>();
+                    if (tmp != null)
+                    {
+                        Debug.Log($"    - TMP text: '{tmp.text}', size: {tmp.fontSize}, bounds: {tmp.bounds}");
+                        Debug.Log($"    - TMP renderer enabled: {tmp.renderer.enabled}");
+                    }
+
+                    // Check distance to camera
+                    if (mainCamera != null)
+                    {
+                        float distance = Vector3.Distance(mainCamera.transform.position, nameObjects[i].transform.position);
+                        Debug.Log($"    - Distance to camera: {distance:F2}");
+                    }
+                }
+            }
+        }
+    }
+
+    private void DisplaySettlementNames()
+    {
+        var settlements = mapData.GetAllSettlements();
+        if (debugMode) Debug.Log($"WorldSpaceLocationNames: Creating {settlements.Count} settlement names");
+
+        foreach (var settlement in settlements)
+        {
+            CreateSettlementName(settlement);
+        }
+    }
+
+    private bool ShouldDisplayFeature(GeographicFeature feature)
+    {
+        switch (feature.type)
+        {
+            case GeographicFeatureType.Forest:
+                return showForestNames;
+            case GeographicFeatureType.Lake:
+                return showLakeNames;
+            case GeographicFeatureType.Plain:
+                return showPlainNames;
+            case GeographicFeatureType.Mountain:
+                return showMountainNames;
+            case GeographicFeatureType.River:
+                return showRiverNames;
+            default:
+                return false;
+        }
+    }
+
+    private void CreateSettlementName(Settlement settlement)
+    {
+        // Position text directly at the settlement location with a small height offset
+        Vector3 worldPosition = new Vector3(settlement.position.x, heightOffset, settlement.position.y);
+        Color color = settlementNameColor;
+        float fontSize = settlement.Type == SettlementType.Town ? textSize * 1.2f : textSize;
+
+        GameObject nameObj = CreateNameObject(settlement.name, worldPosition, color, fontSize);
+
+        if (debugMode)
+        {
+            Debug.Log($"WorldSpaceLocationNames: Created settlement name '{settlement.name}' at {worldPosition}");
+            Debug.Log($"  - Settlement position: {settlement.position}");
+            Debug.Log($"  - GameObject position: {nameObj.transform.position}");
+            Debug.Log($"  - Container position: {nameContainer.position}");
+            Debug.Log($"  - Text height: {heightOffset} (directly on terrain)");
+        }
+    }
+
+    private void CreateFeatureName(GeographicFeature feature)
+    {
+        Vector2Int featureCenter = feature.GetCenterPosition();
+
+        // Position text directly at the feature center with a small height offset
+        Vector3 worldPosition = new Vector3(featureCenter.x, heightOffset, featureCenter.y);
+        Color color = GetFeatureColor(feature.type);
+        float fontSize = GetFeatureFontSize(feature.type);
+
+        GameObject nameObj = CreateNameObject(feature.name, worldPosition, color, fontSize);
+
+        // Add opacity for undiscovered features
+        if (!feature.isDiscovered)
+        {
+            TextMeshPro tmp = nameObj.GetComponent<TextMeshPro>();
+            if (tmp != null)
+            {
+                Color c = tmp.color;
+                c.a = 0.6f;
+                tmp.color = c;
+            }
+        }
+
+        if (debugMode)
+        {
+            Debug.Log($"WorldSpaceLocationNames: Created feature name '{feature.name}' at {worldPosition}");
+        }
+    }
+
+    private GameObject CreateNameObject(string text, Vector3 position, Color color, float fontSize)
+    {
+        GameObject nameObj = Instantiate(textPrefab, nameContainer);
+        nameObj.name = $"LocationName_{text}";
+
+        // Set position after instantiation to ensure it's not reset
+        nameObj.transform.position = position;
+        nameObj.transform.rotation = Quaternion.identity;
+
+        // Make sure the object is on a visible layer
+        nameObj.layer = 0; // Default layer
+
+        // Try TextMeshPro first
+        TextMeshPro tmp = nameObj.GetComponent<TextMeshPro>();
+        if (tmp != null)
+        {
+            tmp.text = text;
+            tmp.color = color;
+            tmp.fontSize = Mathf.Max(fontSize, 72f); // Force minimum 72pt size for visibility
+            tmp.alignment = TextAlignmentOptions.Center;
+
+            // Based on user findings: disable auto-sizing and set manual size
+            tmp.autoSizeTextContainer = false; // Disable auto-sizing 
+            tmp.rectTransform.sizeDelta = new Vector2(200, 50); // Much larger text area
+
+            // Force the text to update and generate mesh
+            tmp.ForceMeshUpdate();
+
+            // Ensure proper material setup and renderer activation
+            if (tmp.renderer != null)
+            {
+                tmp.renderer.enabled = true; // Explicitly enable renderer
+                tmp.renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
+                tmp.renderer.receiveShadows = false;
+
+                // Set sorting layer to render above roads and map tiles
+                tmp.renderer.sortingLayerName = sortingLayerName;
+                tmp.renderer.sortingOrder = sortingOrder;
+
+                // Force material assignment if missing
+                if (tmp.renderer.material == null || tmp.renderer.material.shader == null)
+                {
+                    Material tmpMaterial = null;
+
+                    // Try to find a working TextMeshPro shader
+                    if (Shader.Find("TextMeshPro/Distance Field") != null)
+                    {
+                        tmpMaterial = new Material(Shader.Find("TextMeshPro/Distance Field"));
+                    }
+                    else if (Shader.Find("TextMeshPro/Mobile/Distance Field") != null)
+                    {
+                        tmpMaterial = new Material(Shader.Find("TextMeshPro/Mobile/Distance Field"));
+                    }
+                    else if (Shader.Find("GUI/Text Shader") != null)
+                    {
+                        tmpMaterial = new Material(Shader.Find("GUI/Text Shader"));
+                    }
+                    else
+                    {
+                        // Last resort - unlit color
+                        tmpMaterial = new Material(Shader.Find("Unlit/Color"));
+                        tmpMaterial.color = color;
+                    }
+
+                    if (tmpMaterial != null)
+                    {
+                        tmp.renderer.material = tmpMaterial;
+                    }
+                }
+            }
+
+            // Force another mesh update after material assignment
+            tmp.ForceMeshUpdate();
+
+            if (debugMode)
+            {
+                Debug.Log($"WorldSpaceLocationNames: TextMeshPro setup - Text: '{text}', Font Size: {tmp.fontSize}, Color: {color}");
+                Debug.Log($"  - Position: {nameObj.transform.position}");
+                Debug.Log($"  - Renderer enabled: {tmp.renderer.enabled}");
+                Debug.Log($"  - Material: {(tmp.renderer.material != null ? tmp.renderer.material.name : "NULL")}");
+                Debug.Log($"  - Shader: {(tmp.renderer.material != null && tmp.renderer.material.shader != null ? tmp.renderer.material.shader.name : "NULL")}");
+                Debug.Log($"  - Bounds: {tmp.bounds}");
+                Debug.Log($"  - Auto-size enabled: {tmp.autoSizeTextContainer}");
+            }
+        }
+        else
+        {
+            // Fallback to Unity TextMesh
+            TextMesh textMesh = nameObj.GetComponent<TextMesh>();
+            if (textMesh != null)
+            {
+                textMesh.text = text;
+                textMesh.color = color;
+                textMesh.fontSize = (int)Mathf.Max(fontSize, 72f); // Force minimum 72pt size for visibility
+                textMesh.anchor = TextAnchor.MiddleCenter;
+                textMesh.alignment = TextAlignment.Center;
+
+                // Ensure renderer is enabled
+                MeshRenderer meshRenderer = nameObj.GetComponent<MeshRenderer>();
+                if (meshRenderer != null)
+                {
+                    meshRenderer.enabled = true; // Explicitly enable renderer
+                    meshRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
+                    meshRenderer.receiveShadows = false;
+
+                    // Set sorting layer to render above roads and map tiles
+                    meshRenderer.sortingLayerName = sortingLayerName;
+                    meshRenderer.sortingOrder = sortingOrder;
+                }
+
+                if (debugMode)
+                {
+                    Debug.Log($"WorldSpaceLocationNames: Unity TextMesh setup - Text: '{text}', Font Size: {textMesh.fontSize}, Color: {color}");
+                    Debug.Log($"  - Position: {nameObj.transform.position}");
+                    Debug.Log($"  - Renderer enabled: {(meshRenderer != null ? meshRenderer.enabled : false)}");
+                }
+            }
+        }
+
+        // Use a more visible scale
+        nameObj.transform.localScale = Vector3.one;
+
+        // Set rotation based on settings
+        if (faceCamera)
+        {
+            // Add camera-facing behavior if enabled
+            LookAtCamera lookAt = nameObj.GetComponent<LookAtCamera>();
+            if (lookAt == null)
+            {
+                lookAt = nameObj.AddComponent<LookAtCamera>();
+            }
+            lookAt.targetCamera = mainCamera;
+        }
+        else
+        {
+            // Use fixed rotation for better control
+            nameObj.transform.rotation = Quaternion.Euler(fixedRotation);
+
+            if (debugMode)
+            {
+                Debug.Log($"  - Applied fixed rotation: {fixedRotation}");
+            }
+        }
+
+        // Distance-based visibility disabled by default (causes visibility issues)
+        // Only add if maxViewDistance is explicitly set > 0
+        if (maxViewDistance > 0)
+        {
+            DistanceBasedVisibility visibility = nameObj.GetComponent<DistanceBasedVisibility>();
+            if (visibility == null)
+            {
+                visibility = nameObj.AddComponent<DistanceBasedVisibility>();
+            }
+            visibility.maxDistance = maxViewDistance;
+            visibility.targetCamera = mainCamera;
+
+            if (debugMode)
+            {
+                Debug.Log($"  - Added distance visibility with max distance: {maxViewDistance}");
+            }
+        }
+        else if (debugMode)
+        {
+            Debug.Log($"  - Distance-based visibility disabled (maxViewDistance = {maxViewDistance})");
+        }
+
+        nameObjects.Add(nameObj);
+        return nameObj;
+    }
+
+    private Color GetFeatureColor(GeographicFeatureType type)
+    {
+        switch (type)
+        {
+            case GeographicFeatureType.Forest:
+                return forestNameColor;
+            case GeographicFeatureType.Lake:
+                return lakeNameColor;
+            case GeographicFeatureType.Plain:
+                return plainNameColor;
+            case GeographicFeatureType.Mountain:
+                return mountainNameColor;
+            case GeographicFeatureType.River:
+                return riverNameColor;
+            default:
+                return Color.white;
+        }
+    }
+
+    private float GetFeatureFontSize(GeographicFeatureType type)
+    {
+        float baseSize = textSize;
+        switch (type)
+        {
+            case GeographicFeatureType.Mountain:
+                return baseSize * 1.1f;
+            case GeographicFeatureType.Forest:
+            case GeographicFeatureType.Lake:
+                return baseSize;
+            case GeographicFeatureType.Plain:
+            case GeographicFeatureType.River:
+                return baseSize * 0.9f;
+            default:
+                return baseSize;
+        }
+    }
+
+    private void ClearAllNames()
+    {
+        if (debugMode && nameObjects.Count > 0)
+        {
+            Debug.Log($"WorldSpaceLocationNames: Clearing {nameObjects.Count} existing name objects");
+        }
+
+        foreach (var nameObj in nameObjects)
+        {
+            if (nameObj != null)
+            {
+                DestroyImmediate(nameObj);
+            }
+        }
+        nameObjects.Clear();
+    }
+
+    // Public methods for toggling different name types
+    public void ToggleSettlementNames(bool show)
+    {
+        showSettlementNames = show;
+        RefreshLocationNames();
+    }
+
+    public void ToggleForestNames(bool show)
+    {
+        showForestNames = show;
+        RefreshLocationNames();
+    }
+
+    public void ToggleLakeNames(bool show)
+    {
+        showLakeNames = show;
+        RefreshLocationNames();
+    }
+
+    public void TogglePlainNames(bool show)
+    {
+        showPlainNames = show;
+        RefreshLocationNames();
+    }
+
+    public void ToggleMountainNames(bool show)
+    {
+        showMountainNames = show;
+        RefreshLocationNames();
+    }
+
+    public void ToggleRiverNames(bool show)
+    {
+        showRiverNames = show;
+        RefreshLocationNames();
+    }
+
+    [ContextMenu("Refresh Names")]
+    public void RefreshNamesManual()
+    {
+        RefreshLocationNames();
+    }
+
+    private void OnDestroy()
+    {
+        ClearAllNames();
+    }
+
+    // Test method to create a simple text object at camera position for debugging
+    [ContextMenu("Create Test Text")]
+    public void CreateTestText()
+    {
+        if (mainCamera == null)
+        {
+            mainCamera = Camera.main ?? FindFirstObjectByType<Camera>();
+        }
+
+        if (textPrefab == null)
+        {
+            CreateDefaultTextPrefab();
+        }
+
+        if (nameContainer == null)
+        {
+            CreateNameContainer();
+        }
+
+        if (mainCamera != null)
+        {
+            // Create test text in front of camera at terrain level
+            Vector3 testPosition = mainCamera.transform.position + mainCamera.transform.forward * 10f;
+            testPosition.y = heightOffset; // Same height as location names (on terrain)
+
+            GameObject testObj = CreateNameObject("TEST TEXT", testPosition, Color.yellow, textSize);
+
+            Debug.Log($"Created test text at {testPosition}");
+            Debug.Log($"Camera is at {mainCamera.transform.position}");
+            Debug.Log($"Distance: {Vector3.Distance(mainCamera.transform.position, testPosition):F2}");
+        }
+        else
+        {
+            Debug.LogError("No camera found for test text creation");
+        }
+    }
+
+    // Refresh all location names from context menu
+    [ContextMenu("Refresh Location Names")]
+    public void ForceRefreshLocationNames()
+    {
+        RefreshLocationNames();
+    }
+
+    // Remove all LookAtCamera components to allow manual rotation control
+    [ContextMenu("Remove Camera Facing")]
+    public void RemoveCameraFacing()
+    {
+        foreach (var nameObj in nameObjects)
+        {
+            if (nameObj != null)
+            {
+                LookAtCamera lookAt = nameObj.GetComponent<LookAtCamera>();
+                if (lookAt != null)
+                {
+                    DestroyImmediate(lookAt);
+                    // Apply fixed rotation
+                    nameObj.transform.rotation = Quaternion.Euler(fixedRotation);
+                }
+            }
+        }
+
+        // Also disable face camera for future objects
+        faceCamera = false;
+
+        Debug.Log($"Removed LookAtCamera components from {nameObjects.Count} objects and applied fixed rotation: {fixedRotation}");
+    }
+
+    // Apply all the manual fixes you discovered automatically
+    [ContextMenu("Fix Text Visibility")]
+    public void FixTextVisibility()
+    {
+        int fixedCount = 0;
+
+        foreach (var nameObj in nameObjects)
+        {
+            if (nameObj != null)
+            {
+                // Remove distance-based visibility component
+                DistanceBasedVisibility distanceVis = nameObj.GetComponent<DistanceBasedVisibility>();
+                if (distanceVis != null)
+                {
+                    DestroyImmediate(distanceVis);
+                }
+
+                // Remove LookAtCamera component 
+                LookAtCamera lookAt = nameObj.GetComponent<LookAtCamera>();
+                if (lookAt != null)
+                {
+                    DestroyImmediate(lookAt);
+                }
+
+                // Apply fixed rotation
+                nameObj.transform.rotation = Quaternion.Euler(fixedRotation);
+
+                // Fix TextMeshPro settings
+                TextMeshPro tmp = nameObj.GetComponent<TextMeshPro>();
+                if (tmp != null)
+                {
+                    // Ensure renderer is enabled
+                    if (tmp.renderer != null)
+                    {
+                        tmp.renderer.enabled = true;
+                    }
+
+                    // Set proper font size and disable auto-sizing
+                    tmp.fontSize = textSize; // Use the large size (72f)
+                    tmp.autoSizeTextContainer = false;
+                    tmp.rectTransform.sizeDelta = new Vector2(200, 50);
+
+                    // Force mesh update
+                    tmp.ForceMeshUpdate();
+
+                    fixedCount++;
+                }
+
+                // Fix Unity TextMesh if used instead
+                TextMesh textMesh = nameObj.GetComponent<TextMesh>();
+                if (textMesh != null)
+                {
+                    MeshRenderer meshRenderer = nameObj.GetComponent<MeshRenderer>();
+                    if (meshRenderer != null)
+                    {
+                        meshRenderer.enabled = true;
+                    }
+                    textMesh.fontSize = (int)textSize;
+                    fixedCount++;
+                }
+            }
+        }
+
+        // Disable face camera and distance culling for future objects
+        faceCamera = false;
+        maxViewDistance = 0f;
+
+        Debug.Log($"Fixed visibility settings for {fixedCount} text objects");
+        Debug.Log($"- Removed distance-based visibility components");
+        Debug.Log($"- Removed LookAtCamera components");
+        Debug.Log($"- Enabled mesh renderers");
+        Debug.Log($"- Set font size to {textSize}");
+        Debug.Log($"- Applied fixed rotation: {fixedRotation}");
+    }
+
+    // Automatically apply visibility fixes at startup (no manual interaction needed)
+    private void ApplyVisibilityFixesAtStartup()
+    {
+        if (debugMode)
+        {
+            Debug.Log("WorldSpaceLocationNames: Applying automatic visibility fixes at startup...");
+        }
+
+        int fixedCount = 0;
+
+        foreach (var nameObj in nameObjects)
+        {
+            if (nameObj != null)
+            {
+                // Remove distance-based visibility component
+                DistanceBasedVisibility distanceVis = nameObj.GetComponent<DistanceBasedVisibility>();
+                if (distanceVis != null)
+                {
+                    DestroyImmediate(distanceVis);
+                }
+
+                // Remove LookAtCamera component 
+                LookAtCamera lookAt = nameObj.GetComponent<LookAtCamera>();
+                if (lookAt != null)
+                {
+                    DestroyImmediate(lookAt);
+                }
+
+                // Apply fixed rotation
+                nameObj.transform.rotation = Quaternion.Euler(fixedRotation);
+
+                // Fix TextMeshPro settings
+                TextMeshPro tmp = nameObj.GetComponent<TextMeshPro>();
+                if (tmp != null)
+                {
+                    // Ensure renderer is enabled
+                    if (tmp.renderer != null)
+                    {
+                        tmp.renderer.enabled = true;
+
+                        // Set sorting layer to render above roads
+                        tmp.renderer.sortingLayerName = sortingLayerName;
+                        tmp.renderer.sortingOrder = sortingOrder;
+                    }
+
+                    // FORCE the font size to be large - this was the main issue
+                    tmp.fontSize = Mathf.Max(textSize, 72f); // Ensure minimum 72pt size
+                    tmp.autoSizeTextContainer = false;
+                    tmp.rectTransform.sizeDelta = new Vector2(200, 50);
+
+                    // Force mesh update
+                    tmp.ForceMeshUpdate();
+
+                    if (debugMode)
+                    {
+                        Debug.Log($"  - Fixed text '{tmp.text}': fontSize={tmp.fontSize}, renderer enabled={tmp.renderer.enabled}");
+                    }
+
+                    fixedCount++;
+                }
+
+                // Fix Unity TextMesh if used instead
+                TextMesh textMesh = nameObj.GetComponent<TextMesh>();
+                if (textMesh != null)
+                {
+                    MeshRenderer meshRenderer = nameObj.GetComponent<MeshRenderer>();
+                    if (meshRenderer != null)
+                    {
+                        meshRenderer.enabled = true;
+
+                        // Set sorting layer to render above roads
+                        meshRenderer.sortingLayerName = sortingLayerName;
+                        meshRenderer.sortingOrder = sortingOrder;
+                    }
+                    textMesh.fontSize = (int)Mathf.Max(textSize, 72f);
+                    fixedCount++;
+                }
+            }
+        }
+
+        // Ensure settings are correct for future objects
+        faceCamera = false;
+        maxViewDistance = 0f;
+
+        if (debugMode)
+        {
+            Debug.Log($"WorldSpaceLocationNames: Automatically fixed {fixedCount} text objects at startup");
+        }
+    }
+
+    // Fix sorting order for existing text to render above roads
+    [ContextMenu("Fix Text Sorting Order")]
+    public void FixTextSortingOrder()
+    {
+        int fixedCount = 0;
+
+        foreach (var nameObj in nameObjects)
+        {
+            if (nameObj != null)
+            {
+                // Fix TextMeshPro sorting
+                TextMeshPro tmp = nameObj.GetComponent<TextMeshPro>();
+                if (tmp != null && tmp.renderer != null)
+                {
+                    tmp.renderer.sortingLayerName = sortingLayerName;
+                    tmp.renderer.sortingOrder = sortingOrder;
+                    fixedCount++;
+                }
+
+                // Fix Unity TextMesh sorting
+                TextMesh textMesh = nameObj.GetComponent<TextMesh>();
+                if (textMesh != null)
+                {
+                    MeshRenderer meshRenderer = nameObj.GetComponent<MeshRenderer>();
+                    if (meshRenderer != null)
+                    {
+                        meshRenderer.sortingLayerName = sortingLayerName;
+                        meshRenderer.sortingOrder = sortingOrder;
+                        fixedCount++;
+                    }
+                }
+            }
+        }
+
+        Debug.Log($"Fixed sorting order for {fixedCount} text objects");
+        Debug.Log($"- Sorting Layer: {sortingLayerName}");
+        Debug.Log($"- Sorting Order: {sortingOrder} (roads are 1, so text should be 2+)");
+    }
+}
+
+// Helper component to make text face the camera
+public class LookAtCamera : MonoBehaviour
+{
+    public Camera targetCamera;
+
+    private void Update()
+    {
+        if (targetCamera != null)
+        {
+            // Make the text face the camera without flipping
+            Vector3 directionToCamera = targetCamera.transform.position - transform.position;
+            directionToCamera.y = 0; // Keep text upright by ignoring Y rotation
+
+            if (directionToCamera != Vector3.zero)
+            {
+                transform.rotation = Quaternion.LookRotation(-directionToCamera, Vector3.up);
+            }
+        }
+    }
+}
+
+// Helper component for distance-based visibility
+public class DistanceBasedVisibility : MonoBehaviour
+{
+    public Camera targetCamera;
+    public float maxDistance = 50f;
+
+    private Renderer textRenderer;
+
+    private void Start()
+    {
+        textRenderer = GetComponent<Renderer>();
+    }
+
+    private void Update()
+    {
+        if (targetCamera != null && textRenderer != null)
+        {
+            float distance = Vector3.Distance(transform.position, targetCamera.transform.position);
+            textRenderer.enabled = distance <= maxDistance;
+        }
+    }
+}

+ 145 - 68
Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset

@@ -2,20 +2,24 @@
 %TAG !u! tag:unity3d.com,2011:
 --- !u!21 &2180264
 Material:
-  serializedVersion: 6
+  serializedVersion: 8
   m_ObjectHideFlags: 0
   m_CorrespondingSourceObject: {fileID: 0}
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_Name: LiberationSans SDF Material
   m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3}
-  m_ShaderKeywords: 
+  m_Parent: {fileID: 0}
+  m_ModifiedSerializedProperties: 0
+  m_ValidKeywords: []
+  m_InvalidKeywords: []
   m_LightmapFlags: 1
   m_EnableInstancingVariants: 0
   m_DoubleSidedGI: 0
   m_CustomRenderQueue: -1
   stringTagMap: {}
   disabledShaderPasses: []
+  m_LockedProperties: 
   m_SavedProperties:
     serializedVersion: 3
     m_TexEnvs:
@@ -67,6 +71,7 @@ Material:
         m_Texture: {fileID: 0}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
+    m_Ints: []
     m_Floats:
     - _Ambient: 0.5
     - _Bevel: 0.5
@@ -107,9 +112,9 @@ Material:
     - _Parallax: 0.02
     - _PerspectiveFilter: 0.875
     - _Reflectivity: 10
-    - _ScaleRatioA: 0.90909094
+    - _ScaleRatioA: 0.9
     - _ScaleRatioB: 0.73125
-    - _ScaleRatioC: 0.7386364
+    - _ScaleRatioC: 0.73125
     - _ScaleX: 1
     - _ScaleY: 1
     - _ShaderFlags: 0
@@ -148,6 +153,8 @@ Material:
     - _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
     - _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
     - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
+  m_BuildTextureStacks: []
+  m_AllowLocking: 1
 --- !u!114 &11400000
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -161,17 +168,13 @@ MonoBehaviour:
   m_Name: LiberationSans SDF - Fallback
   m_EditorClassIdentifier: 
   m_Version: 1.1.0
-  m_Material: {fileID: 2180264}
-  m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
-  m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
-  m_AtlasPopulationMode: 1
-  InternalDynamicOS: 0
   m_FaceInfo:
     m_FaceIndex: 0
     m_FamilyName: Liberation Sans
     m_StyleName: Regular
     m_PointSize: 86
     m_Scale: 1
+    m_UnitsPerEM: 2048
     m_LineHeight: 98.8916
     m_AscentLine: 77.853516
     m_CapLine: 59
@@ -187,57 +190,8 @@ MonoBehaviour:
     m_StrikethroughOffset: 18
     m_StrikethroughThickness: 6.298828
     m_TabWidth: 24
-  m_GlyphTable: []
-  m_CharacterTable: []
-  m_AtlasTextures:
-  - {fileID: 28268798066460806}
-  m_AtlasTextureIndex: 0
-  m_IsMultiAtlasTexturesEnabled: 1
-  m_ClearDynamicDataOnBuild: 1
-  m_UsedGlyphRects: []
-  m_FreeGlyphRects:
-  - m_X: 0
-    m_Y: 0
-    m_Width: 511
-    m_Height: 511
-  m_fontInfo:
-    Name: Liberation Sans
-    PointSize: 86
-    Scale: 1
-    CharacterCount: 250
-    LineHeight: 98.90625
-    Baseline: 0
-    Ascender: 77.84375
-    CapHeight: 59.1875
-    Descender: -18.21875
-    CenterLine: 0
-    SuperscriptOffset: 77.84375
-    SubscriptOffset: -12.261719
-    SubSize: 0.5
-    Underline: -12.261719
-    UnderlineThickness: 6.298828
-    strikethrough: 23.675
-    strikethroughThickness: 0
-    TabWidth: 239.0625
-    Padding: 9
-    AtlasWidth: 1024
-    AtlasHeight: 1024
-  atlas: {fileID: 0}
-  m_AtlasWidth: 512
-  m_AtlasHeight: 512
-  m_AtlasPadding: 9
-  m_AtlasRenderMode: 4169
-  m_glyphInfoList: []
-  m_KerningTable:
-    kerningPairs: []
-  m_FontFeatureTable:
-    m_MultipleSubstitutionRecords: []
-    m_LigatureSubstitutionRecords: []
-    m_GlyphPairAdjustmentRecords: []
-    m_MarkToBaseAdjustmentRecords: []
-    m_MarkToMarkAdjustmentRecords: []
-  fallbackFontAssets: []
-  m_FallbackFontAssetTable: []
+  m_Material: {fileID: 2180264}
+  m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
   m_CreationSettings:
     sourceFontFileName: 
     sourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
@@ -257,6 +211,96 @@ MonoBehaviour:
     fontStyleModifier: 0
     renderMode: 4169
     includeFontFeatures: 1
+  m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
+  m_SourceFontFilePath: 
+  m_AtlasPopulationMode: 1
+  InternalDynamicOS: 0
+  m_GlyphTable: []
+  m_CharacterTable: []
+  m_AtlasTextures:
+  - {fileID: 28268798066460806}
+  m_AtlasTextureIndex: 0
+  m_IsMultiAtlasTexturesEnabled: 1
+  m_GetFontFeatures: 1
+  m_ClearDynamicDataOnBuild: 1
+  m_AtlasWidth: 512
+  m_AtlasHeight: 512
+  m_AtlasPadding: 9
+  m_AtlasRenderMode: 4169
+  m_UsedGlyphRects: []
+  m_FreeGlyphRects:
+  - m_X: 0
+    m_Y: 0
+    m_Width: 511
+    m_Height: 511
+  m_FontFeatureTable:
+    m_MultipleSubstitutionRecords: []
+    m_LigatureSubstitutionRecords: []
+    m_GlyphPairAdjustmentRecords:
+    - m_FirstAdjustmentRecord:
+        m_GlyphIndex: 51
+        m_GlyphValueRecord:
+          m_XPlacement: 0
+          m_YPlacement: 0
+          m_XAdvance: -1.5537109
+          m_YAdvance: 0
+      m_SecondAdjustmentRecord:
+        m_GlyphIndex: 3
+        m_GlyphValueRecord:
+          m_XPlacement: 0
+          m_YPlacement: 0
+          m_XAdvance: 0
+          m_YAdvance: 0
+      m_FeatureLookupFlags: 0
+    - m_FirstAdjustmentRecord:
+        m_GlyphIndex: 51
+        m_GlyphValueRecord:
+          m_XPlacement: 0
+          m_YPlacement: 0
+          m_XAdvance: -11.0859375
+          m_YAdvance: 0
+      m_SecondAdjustmentRecord:
+        m_GlyphIndex: 15
+        m_GlyphValueRecord:
+          m_XPlacement: 0
+          m_YPlacement: 0
+          m_XAdvance: 0
+          m_YAdvance: 0
+      m_FeatureLookupFlags: 0
+    - m_FirstAdjustmentRecord:
+        m_GlyphIndex: 51
+        m_GlyphValueRecord:
+          m_XPlacement: 0
+          m_YPlacement: 0
+          m_XAdvance: -11.0859375
+          m_YAdvance: 0
+      m_SecondAdjustmentRecord:
+        m_GlyphIndex: 17
+        m_GlyphValueRecord:
+          m_XPlacement: 0
+          m_YPlacement: 0
+          m_XAdvance: 0
+          m_YAdvance: 0
+      m_FeatureLookupFlags: 0
+    - m_FirstAdjustmentRecord:
+        m_GlyphIndex: 51
+        m_GlyphValueRecord:
+          m_XPlacement: 0
+          m_YPlacement: 0
+          m_XAdvance: -6.3828125
+          m_YAdvance: 0
+      m_SecondAdjustmentRecord:
+        m_GlyphIndex: 36
+        m_GlyphValueRecord:
+          m_XPlacement: 0
+          m_YPlacement: 0
+          m_XAdvance: 0
+          m_YAdvance: 0
+      m_FeatureLookupFlags: 0
+    m_MarkToBaseAdjustmentRecords: []
+    m_MarkToMarkAdjustmentRecords: []
+  m_ShouldReimportFontFeatures: 0
+  m_FallbackFontAssetTable: []
   m_FontWeightTable:
   - regularTypeface: {fileID: 0}
     italicTypeface: {fileID: 0}
@@ -305,6 +349,33 @@ MonoBehaviour:
   boldSpacing: 7
   italicStyle: 35
   tabSize: 10
+  m_fontInfo:
+    Name: Liberation Sans
+    PointSize: 86
+    Scale: 1
+    CharacterCount: 250
+    LineHeight: 98.90625
+    Baseline: 0
+    Ascender: 77.84375
+    CapHeight: 59.1875
+    Descender: -18.21875
+    CenterLine: 0
+    SuperscriptOffset: 77.84375
+    SubscriptOffset: -12.261719
+    SubSize: 0.5
+    Underline: -12.261719
+    UnderlineThickness: 6.298828
+    strikethrough: 23.675
+    strikethroughThickness: 0
+    TabWidth: 239.0625
+    Padding: 9
+    AtlasWidth: 1024
+    AtlasHeight: 1024
+  m_glyphInfoList: []
+  m_KerningTable:
+    kerningPairs: []
+  fallbackFontAssets: []
+  atlas: {fileID: 0}
 --- !u!28 &28268798066460806
 Texture2D:
   m_ObjectHideFlags: 0
@@ -315,17 +386,21 @@ Texture2D:
   m_ImageContentsHash:
     serializedVersion: 2
     Hash: 00000000000000000000000000000000
-  m_ForcedFallbackFormat: 4
-  m_DownscaleFallback: 0
-  serializedVersion: 2
-  m_Width: 0
-  m_Height: 0
-  m_CompleteImageSize: 0
+  m_IsAlphaChannelOptional: 0
+  serializedVersion: 3
+  m_Width: 1
+  m_Height: 1
+  m_CompleteImageSize: 1
+  m_MipsStripped: 0
   m_TextureFormat: 1
   m_MipCount: 1
   m_IsReadable: 1
+  m_IsPreProcessed: 0
+  m_IgnoreMipmapLimit: 0
+  m_MipmapLimitGroupName: 
   m_StreamingMipmaps: 0
   m_StreamingMipmapsPriority: 0
+  m_VTOnly: 0
   m_AlphaIsTransparency: 0
   m_ImageCount: 1
   m_TextureDimension: 2
@@ -339,9 +414,11 @@ Texture2D:
     m_WrapW: 0
   m_LightmapFormat: 0
   m_ColorSpace: 0
-  image data: 0
-  _typelessdata: 
+  m_PlatformBlob: 
+  image data: 1
+  _typelessdata: 00
   m_StreamData:
+    serializedVersion: 2
     offset: 0
     size: 0
     path: 

+ 0 - 51
Assets/UI/Map/MapLegend.uxml

@@ -1,51 +0,0 @@
-<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
-    <Style src="project://database/Assets/UI/Map/MapLegend.uss?fileID=7433441132597879392&amp;guid=3d0abc87938a3d14c950a29cd58e78e0&amp;type=3#MapLegend" />
-    <ui:VisualElement name="MapLegend" enabled="true" class="legend-container" style="display: flex;">
-        <ui:Label text="Map Legend" class="legend-title" />
-        <ui:VisualElement class="legend-items">
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box ocean-color" />
-                <ui:Label text="Ocean / Large Water Bodies" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box river-color" />
-                <ui:Label text="Rivers / Lakes" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box plain-color" />
-                <ui:Label text="Plains / Grasslands" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box forest-color" />
-                <ui:Label text="Forests" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box mountain-color" />
-                <ui:Label text="Mountains" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box town-color" />
-                <ui:Label text="Towns / Cities" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box village-color" />
-                <ui:Label text="Villages" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box road-color" />
-                <ui:Label text="Roads" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box dock-color" />
-                <ui:Label text="Docks / Ports" class="legend-text" />
-            </ui:VisualElement>
-        </ui:VisualElement>
-        <ui:VisualElement class="controls-info">
-            <ui:Label text="Controls:" class="controls-title" />
-            <ui:Label text="WASD / Arrow Keys: Move Camera" class="controls-text" />
-            <ui:Label text="Mouse Wheel: Zoom In/Out" class="controls-text" />
-            <ui:Label text="N: Toggle Name Labels" class="controls-text" />
-            <ui:Label text="Mouse Hover: Show Tooltips" class="controls-text" />
-        </ui:VisualElement>
-    </ui:VisualElement>
-</ui:UXML>

+ 12 - 3
Assets/UI/MapLegend.uss

@@ -1,13 +1,22 @@
-.legend-container {
+.legend-scroll-container {
     position: absolute;
     top: 20px;
     left: 20px;
-    background-color: rgba(0, 0, 0, 0.8);
+    max-height: 70vh;
+    max-width: 320px;
+    min-width: 280px;
+    width: 320px;
+    z-index: 1000; /* Ensure it appears above other UI elements */
+}
+
+.legend-container {
+    background-color: rgba(0, 0, 0, 0.9);
     border-radius: 10px;
     padding: 15px;
-    min-width: 250px;
+    min-width: 280px;
     border-width: 2px;
     border-color: rgba(255, 255, 255, 0.3);
+    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5); /* Add shadow for better visibility */
 }
 
 .legend-title {

+ 0 - 51
Assets/UI/MapLegend.uxml

@@ -1,51 +0,0 @@
-<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
-    <Style src="project://database/Assets/UI/MapLegend.uss?fileID=7433441132597879392&amp;guid=bd9bd858f48084843ae4d8b28c85678d&amp;type=3#MapLegend" />
-    <ui:VisualElement name="MapLegend" class="legend-container">
-        <ui:Label text="Map Legend" class="legend-title" />
-        <ui:VisualElement class="legend-items">
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box ocean-color" />
-                <ui:Label text="Ocean / Large Water Bodies" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box river-color" />
-                <ui:Label text="Rivers / Lakes" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box plain-color" />
-                <ui:Label text="Plains / Grasslands" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box forest-color" />
-                <ui:Label text="Forests" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box mountain-color" />
-                <ui:Label text="Mountains" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box town-color" />
-                <ui:Label text="Towns / Cities" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box village-color" />
-                <ui:Label text="Villages" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box road-color" />
-                <ui:Label text="Roads" class="legend-text" />
-            </ui:VisualElement>
-            <ui:VisualElement class="legend-item">
-                <ui:VisualElement class="color-box dock-color" />
-                <ui:Label text="Docks / Ports" class="legend-text" />
-            </ui:VisualElement>
-        </ui:VisualElement>
-        <ui:VisualElement class="controls-info">
-            <ui:Label text="Controls:" class="controls-title" />
-            <ui:Label text="WASD / Arrow Keys: Move Camera" class="controls-text" />
-            <ui:Label text="Mouse Wheel: Zoom In/Out" class="controls-text" />
-            <ui:Label text="N: Toggle Name Labels" class="controls-text" />
-            <ui:Label text="Mouse Hover: Show Tooltips" class="controls-text" />
-        </ui:VisualElement>
-    </ui:VisualElement>
-</ui:UXML>

+ 5 - 0
Assets/UI/MapLocationNameDisplay.uxml

@@ -0,0 +1,5 @@
+<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
+    <ui:VisualElement name="map-container" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: visible;">
+        <!-- Location name labels will be added programmatically -->
+    </ui:VisualElement>
+</ui:UXML>

+ 69 - 0
Assets/UI/MapLocationNames.uss

@@ -0,0 +1,69 @@
+/* Map Location Names Stylesheet */
+
+.map-location-names-container {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    left: 0;
+    top: 0;
+    z-index: 1; /* Just above the map, below other UI elements */
+    pointer-events: none; /* CSS equivalent of PickingMode.Ignore */
+}
+
+.location-name-label {
+    position: absolute;
+    font-size: 12px;
+    color: white;
+    background-color: rgba(0, 0, 0, 0.6);
+    padding-left: 4px;
+    padding-right: 4px;
+    padding-top: 2px;
+    padding-bottom: 2px;
+    border-radius: 3px;
+    border-width: 1px;
+    border-color: rgba(255, 255, 255, 0.3);
+    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
+    white-space: nowrap;
+    pointer-events: none; /* Ensure labels don't block clicks */
+}
+
+/* Settlement name styles */
+.settlement-name {
+    font-size: 13px;
+    font-weight: bold;
+    color: rgb(255, 255, 200); /* Light yellow */
+    background-color: rgba(139, 69, 19, 0.8); /* Brown background */
+    border-color: rgba(255, 215, 0, 0.5); /* Gold border */
+}
+
+/* Geographic feature name styles */
+.forest-name {
+    color: rgb(144, 238, 144); /* Light green */
+    background-color: rgba(0, 100, 0, 0.7);
+    border-color: rgba(144, 238, 144, 0.5);
+}
+
+.lake-name {
+    color: rgb(173, 216, 230); /* Light blue */
+    background-color: rgba(0, 0, 139, 0.7);
+    border-color: rgba(173, 216, 230, 0.5);
+}
+
+.mountain-name {
+    color: rgb(220, 220, 220); /* Light gray */
+    background-color: rgba(105, 105, 105, 0.8);
+    border-color: rgba(220, 220, 220, 0.5);
+    font-weight: bold;
+}
+
+.plain-name {
+    color: rgb(255, 255, 224); /* Light yellow */
+    background-color: rgba(154, 205, 50, 0.7);
+    border-color: rgba(255, 255, 224, 0.5);
+}
+
+.river-name {
+    color: rgb(135, 206, 235); /* Sky blue */
+    background-color: rgba(0, 191, 255, 0.7);
+    border-color: rgba(135, 206, 235, 0.5);
+}

+ 124 - 0
MAPLOCATIONS_SETUP_GUIDE.md

@@ -0,0 +1,124 @@
+# Map Location Name System - Quick Setup & Debug Guide
+
+## Quick Setup Instructions
+
+### 1. Scene Setup
+1. Open MapScene2 in Unity
+2. Add these components to empty GameObjects or existing UI objects:
+   - **MapLocationSystemInitializer** (on any GameObject)
+   - **MapLocationDebugger** (on any GameObject)
+   - **GeographicFeatureManager** (if not already present)
+   - **MapLocationNameDisplay** (attach to GameObject with UIDocument)
+   - **MapSceneLegendUI** (attach to GameObject with UIDocument for legend)
+
+### 2. Component Configuration
+- **MapLocationSystemInitializer**: 
+  - Enable debug mode for detailed logging
+  - Configure which name types to show by default
+  - Auto-finds all required components
+  
+- **MapLocationDebugger**:
+  - Provides runtime debug controls via keyboard shortcuts
+  - No configuration needed
+
+### 3. Testing the System
+
+#### Debug Controls (MapLocationDebugger)
+- **F9**: Print detailed debug information
+- **F10**: Toggle legend visibility
+- **F11**: Toggle settlement names
+- **F12**: Refresh location names
+
+#### What to Look For
+1. **Console Messages**: Check for initialization logs
+2. **Legend UI**: Should appear on screen (toggle with L key or F10)
+3. **Location Names**: Should appear on settlements and features
+4. **Interactive Toggles**: Legend checkboxes should control name visibility
+
+## Troubleshooting
+
+### Legend Not Showing
+1. Check console for "Legend Container Found: False"
+2. Verify UIDocument is attached to MapSceneLegendUI GameObject
+3. Press F9 to get detailed UI element information
+4. Try pressing F10 to manually toggle legend
+
+### Names Not Positioned Correctly
+1. Check console for coordinate conversion warnings
+2. Press F9 to see map container size information
+3. Verify MapMaker2 is generating map data properly
+4. Press F12 to refresh name positions
+
+### Names Not Showing At All
+1. Check if geographic features are generated (F9 shows count)
+2. Verify name display toggles are enabled
+3. Check console for "MapData is null" warnings
+4. Use F11 to manually toggle settlement names
+
+### Geographic Features Not Generated
+1. Check if MapMaker2 has completed map generation
+2. Verify GeographicFeatureManager is attached to scene
+3. Use context menu "Reinitialize System" on MapLocationSystemInitializer
+4. Check console for feature generation logs
+
+## Console Debug Output Guide
+
+### Normal Initialization Sequence:
+```
+MapLocationSystemInitializer: Starting system initialization...
+Found components - FeatureManager: True, NameDisplay: True, LegendUI: True, MapMaker: True
+MapLocationSystemInitializer: Map generation complete
+MapLocationSystemInitializer: Generating geographic features...
+MapLocationSystemInitializer: Generated X geographic features
+MapLocationSystemInitializer: Name display initialized
+MapLocationSystemInitializer: Legend UI initialized
+MapLocationSystemInitializer: System initialization complete!
+```
+
+### Debug Information (F9):
+- UI element positions and sizes
+- Geographic feature count and sample data
+- Name display settings and container info
+- Legend UI visibility and positioning
+
+## Manual Testing Steps
+
+1. **Start the game** and check console for initialization messages
+2. **Press F9** to see detailed debug info
+3. **Press F10** to toggle legend - should see legend panel appear/disappear
+4. **Press F11** to toggle settlement names - should see names appear/disappear on towns
+5. **Use legend checkboxes** to toggle different name types
+6. **Press L key** to toggle legend (alternative method)
+
+## Common Issues and Solutions
+
+### Issue: "MapData is null"
+**Solution**: Ensure MapMaker2 has generated the map before the name system initializes. The MapLocationSystemInitializer waits for this automatically.
+
+### Issue: "nameContainer is null"
+**Solution**: Check that UIDocument is properly attached and contains the root visual element. The system creates containers automatically if missing.
+
+### Issue: Names appear but are positioned incorrectly
+**Solution**: This is usually a coordinate conversion issue. The debug output (F9) will show container bounds and conversion calculations.
+
+### Issue: Legend shows but toggles don't work
+**Solution**: Check that MapLocationNameDisplay is found by the legend UI. Console will show connection status during initialization.
+
+## Performance Notes
+
+- Geographic feature generation happens once at startup
+- Name positioning is calculated when names are toggled on
+- Debug mode adds console logging - disable in production
+- UI containers are created automatically and reused
+
+## File Structure
+```
+Assets/Scripts/UI/MapScene/
+├── GeographicFeature.cs               (Feature data structure)
+├── GeographicFeatureGenerator.cs      (Feature detection algorithms)
+├── GeographicFeatureManager.cs        (Feature management)
+├── MapLocationNameDisplay.cs          (Name positioning and display)
+├── MapLegendUI.cs                     (Legend UI - class: MapSceneLegendUI)
+├── MapLocationSystemInitializer.cs    (Setup and initialization)
+└── MapLocationDebugger.cs            (Runtime debugging tools)
+```

+ 224 - 0
MAP_LOCATION_NAMES_LEGEND_GUIDE.md

@@ -0,0 +1,224 @@
+# Map Location Names and Legend System Setup Guide
+
+## Overview
+This system adds named geographic features (forests, lakes, plains, mountains, rivers) and a toggleable map legend to MapScene2. The legend allows players to toggle the visibility of different types of location names and implements click blocking to prevent map interaction when the UI is active.
+
+## Components Created
+
+### 1. Geographic Feature System
+- **`GeographicFeature.cs`**: Data structure for named geographic features
+- **`GeographicFeatureGenerator.cs`**: Analyzes the map and creates named features
+- **`GeographicFeatureManager.cs`**: Manages the feature generation process
+
+### 2. Map Legend and Name Display
+- **`MapSceneLegendUI.cs`**: Interactive legend with terrain colors and name toggles
+- **`MapLocationNameDisplay.cs`**: Displays location names on the map
+- **`MapLegend.uss`**: Updated styles for the legend and location names
+
+### 3. Integration
+- Uses existing **`IClickBlocker.cs`** and **`ClickManager.cs`** for UI interaction
+
+## Features
+
+### 🏰 Named Locations
+- **Settlements**: Town and village names (existing system enhanced)
+- **Forests**: "Whispering Woods", "Ancient Grove", "Darkwood Forest", etc.
+- **Lakes**: "Crystal Lake", "Mirror Waters", "Dragon's Rest Lake", etc.
+- **Plains**: "Golden Plains", "Emerald Fields", "Windswept Meadows", etc.
+- **Mountains**: "Frostpeak Mountains", "Dragon's Spine", "Stormhaven Peaks", etc.
+- **Rivers**: "Swift Current", "Silver Stream", "Moonflow River", etc.
+
+### 🗺️ Interactive Map Legend
+- **Terrain Colors**: Visual legend showing terrain types
+- **Name Toggles**: Individual toggles for each location name type
+- **Collapsible**: Toggle button to show/hide the legend
+- **Click Blocking**: Prevents map interaction when legend is active
+
+### 🎨 Visual Design
+- **Color-coded Names**: Different colors for each feature type
+- **Proper Sizing**: Larger names for important features
+- **Discovery System**: Support for discovered/undiscovered features
+- **Non-intrusive**: Names don't block map interaction
+
+## Setup Instructions
+
+### Step 1: Add Geographic Feature System to MapScene2
+1. Create an empty GameObject called "GeographicFeatureManager"
+2. Add the `GeographicFeatureManager` component to it
+3. Configure settings:
+   - **Auto Generate Features**: ✓ (checked)
+   - **Regenerate On Map Change**: ✓ (checked)
+   - **Debug Mode**: ✓ (optional for testing)
+
+### Step 2: Add Location Name Display
+1. Create an empty GameObject called "MapLocationNameDisplay"
+2. Add the `MapLocationNameDisplay` component to it
+3. Configure settings:
+   - **Map UI Document**: Assign your map's UIDocument
+   - **Show [Feature Type] Names**: Configure which types to show by default
+   - **[Feature Type] Name Color**: Customize colors for each feature type
+   - **Map UI Size**: Set to match your map UI dimensions (e.g., 1920x1080)
+
+### Step 3: Add Map Legend UI
+1. Create an empty GameObject called "MapSceneLegendUI"
+2. Add a `UIDocument` component to it
+3. Add the `MapSceneLegendUI` component to it
+4. Configure settings:
+   - **UI Document**: The UIDocument component on the same GameObject
+   - **Start Visible**: ✓ (if you want legend visible by default)
+   - **Toggle Key**: L (or your preferred key)
+
+### Step 4: Verify Integration
+The system will automatically:
+- Generate geographic features when the map loads
+- Display settlement names from existing settlements
+- Create and display the map legend
+- Register click blocking with the ClickManager
+
+## Configuration Options
+
+### GeographicFeatureManager Settings
+```csharp
+[Header("Feature Configuration")]
+public bool autoGenerateFeatures = true;        // Auto-generate on start
+public bool regenerateOnMapChange = true;       // Update when map changes
+public bool debugMode = false;                  // Enable debug logging
+```
+
+### MapLocationNameDisplay Settings
+```csharp
+[Header("Display Settings")]
+public bool showSettlementNames = true;         // Show town/village names
+public bool showForestNames = true;             // Show forest names
+public bool showLakeNames = true;               // Show lake names
+public bool showPlainNames = true;              // Show plain names
+public bool showMountainNames = true;           // Show mountain names
+public bool showRiverNames = true;              // Show river names
+
+[Header("Visual Settings")]
+public Color settlementNameColor = Color.white; // Settlement name color
+public Color forestNameColor = Color.green;     // Forest name color
+// ... (other color settings)
+```
+
+### MapSceneLegendUI Settings
+```csharp
+[Header("Settings")]
+public bool startVisible = true;                // Legend visible on start
+public KeyCode toggleKey = KeyCode.L;           // Key to toggle legend
+```
+
+## How It Works
+
+### Feature Generation Process
+1. **Map Analysis**: System analyzes terrain types in the generated map
+2. **Cluster Detection**: Finds connected areas of the same terrain type
+3. **Size Filtering**: Only names areas above minimum size thresholds
+4. **Name Assignment**: Randomly assigns appropriate names from predefined lists
+5. **Center Calculation**: Determines optimal position for name display
+
+### Legend Integration
+1. **Terrain Legend**: Shows color codes for all terrain types
+2. **Name Toggles**: Individual switches for each location name type
+3. **Real-time Updates**: Immediately shows/hides names when toggled
+4. **Click Blocking**: Prevents map clicks when legend area is active
+
+### Click Management
+1. **IClickBlocker**: Legend implements the interface for click blocking
+2. **ClickManager**: Centralized system manages all UI click blocking
+3. **Position Detection**: Checks if clicks fall within legend bounds
+4. **Map Protection**: Prevents accidental map interaction
+
+## Testing
+
+### Verify Feature Generation
+1. **Play the scene** - Features should generate automatically
+2. **Check Console** - Enable debug mode to see generation messages
+3. **Context Menu** - Use "Regenerate Features" on GeographicFeatureManager
+
+### Test Legend Functionality
+1. **Toggle Visibility** - Press L (or configured key) to show/hide legend
+2. **Name Toggles** - Turn individual name types on/off
+3. **Click Blocking** - Verify map doesn't respond to clicks over legend
+4. **Visual Feedback** - Check that legend shows proper terrain colors
+
+### Debug Features
+- **Console Logs**: Enable debug mode for detailed generation info
+- **Context Menus**: Use component context menus for manual testing
+- **Feature Counts**: Check console for number of features generated
+
+## Customization
+
+### Adding New Feature Types
+1. **Update GeographicFeatureType enum** in `GeographicFeature.cs`
+2. **Add name arrays** in `GeographicFeatureGenerator.cs`
+3. **Create generation method** following existing patterns
+4. **Update display systems** to handle the new type
+
+### Adjusting Generation Parameters
+```csharp
+// In GeographicFeatureGenerator.cs
+var forestClusters = FindConnectedAreas(mapData, TerrainType.Forest, 6); // Min 6 tiles
+var lakeClusters = FindConnectedAreas(mapData, TerrainType.Lake, 4);     // Min 4 tiles
+var plainClusters = FindConnectedAreas(mapData, TerrainType.Plains, 25); // Min 25 tiles
+```
+
+### Customizing Names
+Edit the name arrays in `GeographicFeatureGenerator.cs`:
+```csharp
+private static readonly string[] forestNames = {
+    "Whispering Woods", "Ancient Grove", "Your Custom Forest Name"
+};
+```
+
+## Troubleshooting
+
+### No Names Appearing
+1. **Check Generation**: Verify GeographicFeatureManager is in scene and active
+2. **Check Display**: Ensure MapLocationNameDisplay has correct UI references
+3. **Check Map Size**: Verify mapUISize settings match your actual UI
+4. **Check Toggles**: Make sure name types are enabled in the legend
+
+### Legend Not Showing
+1. **Check UIDocument**: Verify MapSceneLegendUI has UIDocument component
+2. **Check Key Binding**: Press L or configured toggle key
+3. **Check Start Visible**: Verify startVisible setting
+4. **Check Console**: Look for UI setup errors
+
+### Click Blocking Issues
+1. **Check ClickManager**: Verify ClickManager exists in scene
+2. **Check Registration**: Legend should auto-register with ClickManager
+3. **Check Position**: Verify legend bounds detection is working
+
+### Performance Issues
+1. **Reduce Feature Count**: Increase minimum cluster sizes
+2. **Limit Name Updates**: Avoid frequent RefreshLocationNames() calls
+3. **Optimize Generation**: Consider caching generated features
+
+## Integration with Existing Systems
+
+### MapMaker2 Integration
+- **Automatic Detection**: System finds and uses existing MapMaker2
+- **MapData Access**: Reads terrain and settlement data from MapMaker2
+- **Coordinate Conversion**: Handles world-to-UI coordinate mapping
+
+### Settlement System Integration
+- **Existing Names**: Preserves and displays existing settlement names
+- **Color Coding**: Towns and villages have distinct visual styles
+- **Discovery System**: Ready for integration with discovery mechanics
+
+### UI System Integration
+- **IClickBlocker**: Follows established UI interaction patterns
+- **ClickManager**: Integrates with existing click management system
+- **UI Toolkit**: Built with Unity's modern UI system
+
+## Future Enhancements
+
+1. **Discovery System**: Show/hide names based on exploration
+2. **Interactive Features**: Click names for more information
+3. **Dynamic Names**: Generate contextual names based on surroundings
+4. **Distance Filtering**: Show different names at different zoom levels
+5. **Custom Icons**: Add visual markers for different feature types
+6. **Save/Load**: Persist discovered features between sessions
+
+This system provides a solid foundation for map location naming while maintaining clean integration with your existing RPG systems.

+ 35 - 35
UserSettings/Layouts/default-6000.dwlt

@@ -19,7 +19,7 @@ MonoBehaviour:
     width: 3440
     height: 1349
   m_ShowMode: 4
-  m_Title: Game
+  m_Title: Inspector
   m_RootView: {fileID: 5}
   m_MinSize: {x: 875, y: 332}
   m_MaxSize: {x: 10000, y: 10000}
@@ -74,7 +74,7 @@ MonoBehaviour:
   m_MinSize: {x: 200, y: 50}
   m_MaxSize: {x: 16192, y: 8096}
   vertical: 0
-  controlID: 126
+  controlID: 124
   draggingID: 0
 --- !u!114 &4
 MonoBehaviour:
@@ -91,9 +91,9 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 1218
+    x: 1180
     y: 0
-    width: 1526
+    width: 1564
     height: 854
   m_MinSize: {x: 52, y: 76}
   m_MaxSize: {x: 4002, y: 4026}
@@ -198,7 +198,7 @@ MonoBehaviour:
   m_MinSize: {x: 400, y: 100}
   m_MaxSize: {x: 32384, y: 16192}
   vertical: 0
-  controlID: 162
+  controlID: 160
   draggingID: 0
 --- !u!114 &9
 MonoBehaviour:
@@ -224,7 +224,7 @@ MonoBehaviour:
   m_MinSize: {x: 300, y: 100}
   m_MaxSize: {x: 24288, y: 16192}
   vertical: 1
-  controlID: 125
+  controlID: 40
   draggingID: 0
 --- !u!114 &10
 MonoBehaviour:
@@ -251,7 +251,7 @@ MonoBehaviour:
   m_MinSize: {x: 300, y: 50}
   m_MaxSize: {x: 24288, y: 8096}
   vertical: 0
-  controlID: 50
+  controlID: 41
   draggingID: 0
 --- !u!114 &11
 MonoBehaviour:
@@ -296,7 +296,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 620
     y: 0
-    width: 598
+    width: 560
     height: 854
   m_MinSize: {x: 202, y: 226}
   m_MaxSize: {x: 4002, y: 4026}
@@ -416,9 +416,9 @@ MonoBehaviour:
     m_TextWithWhitespace: "Game\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 1219
+    x: 1181
     y: 24
-    width: 1524
+    width: 1562
     height: 828
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -437,7 +437,7 @@ MonoBehaviour:
   m_ShowGizmos: 0
   m_TargetDisplay: 0
   m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
-  m_TargetSize: {x: 1524, y: 807}
+  m_TargetSize: {x: 1562, y: 807}
   m_TextureFilterMode: 0
   m_TextureHideFlags: 61
   m_RenderIMGUI: 1
@@ -452,8 +452,8 @@ MonoBehaviour:
     m_VRangeLocked: 0
     hZoomLockedByDefault: 0
     vZoomLockedByDefault: 0
-    m_HBaseRangeMin: -762
-    m_HBaseRangeMax: 762
+    m_HBaseRangeMin: -781
+    m_HBaseRangeMax: 781
     m_VBaseRangeMin: -403.5
     m_VBaseRangeMax: 403.5
     m_HAllowExceedBaseRangeMin: 1
@@ -464,7 +464,7 @@ MonoBehaviour:
     m_HSlider: 0
     m_VSlider: 0
     m_IgnoreScrollWheelUntilClicked: 0
-    m_EnableMouseInput: 0
+    m_EnableMouseInput: 1
     m_EnableSliderZoomHorizontal: 0
     m_EnableSliderZoomVertical: 0
     m_UniformScale: 1
@@ -473,23 +473,23 @@ MonoBehaviour:
       serializedVersion: 2
       x: 0
       y: 21
-      width: 1524
+      width: 1562
       height: 807
     m_Scale: {x: 1, y: 1}
-    m_Translation: {x: 762, y: 403.5}
+    m_Translation: {x: 781, y: 403.5}
     m_MarginLeft: 0
     m_MarginRight: 0
     m_MarginTop: 0
     m_MarginBottom: 0
     m_LastShownAreaInsideMargins:
       serializedVersion: 2
-      x: -762
+      x: -781
       y: -403.5
-      width: 1524
+      width: 1562
       height: 807
     m_MinimalGUI: 1
   m_defaultScale: 1
-  m_LastWindowPixelSize: {x: 1524, y: 828}
+  m_LastWindowPixelSize: {x: 1562, y: 828}
   m_ClearInEditMode: 1
   m_NoCameraWarning: 1
   m_LowResolutionForAspectRatios: 01000000000000000000
@@ -534,7 +534,7 @@ MonoBehaviour:
     m_OverlaysVisible: 1
   m_LockTracker:
     m_IsLocked: 0
-  m_LastSelectedObjectID: -1643170
+  m_LastSelectedObjectID: 45874
 --- !u!114 &18
 MonoBehaviour:
   m_ObjectHideFlags: 52
@@ -576,7 +576,7 @@ MonoBehaviour:
       scrollPos: {x: 0, y: 0}
       m_SelectedIDs: 
       m_LastClickedID: 0
-      m_ExpandedIDs: 1afbffffd8b20000
+      m_ExpandedIDs: 5200d6ff6464deff58d7e6ff4238efff2a98f7ffdeedffff1afbfffffcb20000
       m_RenameOverlay:
         m_UserAcceptedRename: 0
         m_Name: 
@@ -624,7 +624,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 621
     y: 24
-    width: 596
+    width: 558
     height: 828
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -1208,9 +1208,9 @@ MonoBehaviour:
   m_AudioPlay: 0
   m_DebugDrawModesUseInteractiveLightBakingData: 0
   m_Position:
-    m_Target: {x: 0, y: 0, z: 0}
+    m_Target: {x: 203.98952, y: 205.00319, z: 73.98748}
     speed: 2
-    m_Value: {x: 0, y: 0, z: 0}
+    m_Value: {x: 203.98952, y: 205.00319, z: 73.98748}
   m_RenderMode: 0
   m_CameraMode:
     drawMode: 0
@@ -1256,13 +1256,13 @@ MonoBehaviour:
     m_GridAxis: 1
     m_gridOpacity: 0.5
   m_Rotation:
-    m_Target: {x: 0.31192484, y: 0.67680126, z: -0.39066193, w: 0.54039305}
+    m_Target: {x: 0.39528129, y: -0.35928923, z: 0.17156628, w: 0.82778484}
     speed: 2
-    m_Value: {x: 0.31192487, y: 0.67680126, z: -0.39066193, w: 0.54039305}
+    m_Value: {x: -0.39528129, y: 0.35928923, z: -0.17156628, w: -0.8277849}
   m_Size:
-    m_Target: 10
+    m_Target: 0.78354865
     speed: 2
-    m_Value: 10
+    m_Value: 0.78354865
   m_Ortho:
     m_Target: 0
     speed: 2
@@ -1412,7 +1412,7 @@ MonoBehaviour:
     m_SkipHidden: 0
     m_SearchArea: 1
     m_Folders:
-    - Assets/Resources/UI/MapScene
+    - Assets/TextMesh Pro/Resources/Fonts & Materials
     m_Globs: []
     m_ProductIds: 
     m_AnyWithAssetOrigin: 0
@@ -1422,16 +1422,16 @@ MonoBehaviour:
   m_ViewMode: 1
   m_StartGridSize: 67
   m_LastFolders:
-  - Assets/Resources/UI/MapScene
+  - Assets/TextMesh Pro/Resources/Fonts & Materials
   m_LastFoldersGridSize: 67
   m_LastProjectPath: C:\Users\Axel-PC\RPG-RougeLiteBatteler
   m_LockTracker:
     m_IsLocked: 0
   m_FolderTreeState:
-    scrollPos: {x: 0, y: 319}
-    m_SelectedIDs: c2b70000
-    m_LastClickedID: 47042
-    m_ExpandedIDs: 000000004eb5000050b5000052b5000054b5000056b5000058b500005ab500005cb500005eb5000060b5000062b50000
+    scrollPos: {x: 0, y: 503}
+    m_SelectedIDs: bcb80000
+    m_LastClickedID: 47292
+    m_ExpandedIDs: 000000007eb5000080b5000082b5000084b5000086b5000088b500008ab500008cb500008eb5000090b5000092b50000
     m_RenameOverlay:
       m_UserAcceptedRename: 0
       m_Name: 
@@ -1460,7 +1460,7 @@ MonoBehaviour:
     scrollPos: {x: 0, y: 0}
     m_SelectedIDs: 
     m_LastClickedID: 0
-    m_ExpandedIDs: 000000004eb5000050b5000052b5000054b5000056b5000058b500005ab500005cb500005eb5000060b5000062b50000
+    m_ExpandedIDs: 000000007eb5000080b5000082b5000084b5000086b5000088b500008ab500008cb500008eb5000090b5000092b50000
     m_RenameOverlay:
       m_UserAcceptedRename: 0
       m_Name: