From 16fa1c26f1b45e1a92a7698f61a7a48a5dfac5ba Mon Sep 17 00:00:00 2001 From: C1XTZ Date: Thu, 5 Mar 2026 07:11:36 +0100 Subject: [PATCH 1/3] FastTravelPlugin: remove UseGroupInheritance --- FastTravelPlugin/FastTravelConfiguration.cs | 3 -- FastTravelPlugin/FastTravelModule.cs | 1 - FastTravelPlugin/FastTravelPlugin.cs | 1 - FastTravelPlugin/lua/fasttravel.lua | 44 +++++++-------------- 4 files changed, 15 insertions(+), 34 deletions(-) diff --git a/FastTravelPlugin/FastTravelConfiguration.cs b/FastTravelPlugin/FastTravelConfiguration.cs index b432e1ae..fee55d0c 100644 --- a/FastTravelPlugin/FastTravelConfiguration.cs +++ b/FastTravelPlugin/FastTravelConfiguration.cs @@ -22,9 +22,6 @@ public class FastTravelConfiguration : IValidateConfiguration MapFixedTargetPosition = [-2100, 0, 3200]; - [YamlMember(Description = "If set to true, points without a type inherit the type of the last explicitly typed point within their group.")] - public bool UseGroupInheritance { get; set; } = true; - [YamlMember(Description = "How teleport icons should cluster when zoomed out.\nTrue (Group mode): Displays only the first point of each type within a group.\nFalse (Distance mode): Displays one point of each type based on proximity, ignoring group names.")] public bool UseGroupDrawMode { get; set; } = true; diff --git a/FastTravelPlugin/FastTravelModule.cs b/FastTravelPlugin/FastTravelModule.cs index c5058660..481d7252 100644 --- a/FastTravelPlugin/FastTravelModule.cs +++ b/FastTravelPlugin/FastTravelModule.cs @@ -18,7 +18,6 @@ protected override void Load(ContainerBuilder builder) MapMoveSpeeds = [1, 2, 3, 0], ShowMapImage = false, MapFixedTargetPosition = [0, 0, 0], - UseGroupInheritance = true, UseGroupDrawMode = true, DistanceModeRange = 100 }; diff --git a/FastTravelPlugin/FastTravelPlugin.cs b/FastTravelPlugin/FastTravelPlugin.cs index 423e2251..ea4e1f46 100644 --- a/FastTravelPlugin/FastTravelPlugin.cs +++ b/FastTravelPlugin/FastTravelPlugin.cs @@ -49,7 +49,6 @@ public FastTravelPlugin(FastTravelConfiguration configuration, ["mapMoveSpeeds"] = $"\"{JsonSerializer.Serialize(configuration.MapMoveSpeeds)}\"", ["showMapImg"] = configuration.ShowMapImage ? "true" : "false", ["disableCollisions"] = configuration.DisableCollisions ? "true" : "false", - ["useGroupInheritance"] = configuration.UseGroupInheritance ? "true" : "false", ["useGroupDrawMode"] = configuration.UseGroupDrawMode ? "true" : "false", ["distanceModeRange"] = configuration.DistanceModeRange }); diff --git a/FastTravelPlugin/lua/fasttravel.lua b/FastTravelPlugin/lua/fasttravel.lua index fed4d506..8570a79e 100644 --- a/FastTravelPlugin/lua/fasttravel.lua +++ b/FastTravelPlugin/lua/fasttravel.lua @@ -11,7 +11,6 @@ local config = ac.configValues({ mapZoomValues = "", -- { 100, 1000, 4000, 15000 }, mapMoveSpeeds = "", -- { 1, 5, 20, 0 }, showMapImg = true, - useGroupInheritance = true, useGroupDrawMode = true, distanceModeRange = 100 }) @@ -31,17 +30,15 @@ local trackCompassOffset = 24 -- for SRP local font = 'Segoe UI' local fontBold = 'Segoe UI;Weight=Bold' ---c1xtz: read teleports from server options, requires 'POINT__TYPE = PA/ST' to be added to the teleports in csp_extra_options.ini to not show up as the default. ---c1xtz: additional custom types can be created as long as a corresponding 'mapicon_.png' is in the images folder. example: 'POINT_1_TYPE = GS' & 'mapicon_gs.png' for a gas station type. ---c1xtz: points inside of group inherite the type of the point before, meaning if 'POINT_1_TYPE = PA' and POINT_2 is not specifically given a type, it will inherit the PA type from point 1. ---c1xtz: this makes it possible to have multiple types per group, although only the first point per unique type is shown (see tpdrawing:) +--c1xtz: read teleports from server options, requires 'POINT_X_TYPE = PA/ST' to be added to the teleports in csp_extra_options.ini, otherwise they show up as the default. +--c1xtz: additional custom types can be created as long as a corresponding 'mapicon_.png' is in the wwwwroot folder. example: 'POINT_1_TYPE = GS' + 'mapicon_gs.png' for a gas station type. local extraOptions = ac.INIConfig.onlineExtras() -local onlineTeleports, encounteredTypes = {}, {} +local onlineTeleports = {} local defaultType = 'sp' local function getTeleports() if not extraOptions then return end - onlineTeleports, encounteredTypes = {}, {} + onlineTeleports = {} for _, points in extraOptions:iterateValues('TELEPORT_DESTINATIONS', 'POINT') do if points:match('_POS$') then local pointName = extraOptions:get('TELEPORT_DESTINATIONS', points:gsub('_POS$', ''), '') @@ -49,11 +46,7 @@ local function getTeleports() local position = extraOptions:get('TELEPORT_DESTINATIONS', points, vec3()) local heading = tonumber(extraOptions:get('TELEPORT_DESTINATIONS', points:gsub('_POS$', '_HEADING'), 0)) local typeName = extraOptions:get('TELEPORT_DESTINATIONS', points:gsub('_POS$', '_TYPE'), ''):lower() - if typeName == '' then - typeName = (config.useGroupInheritance and encounteredTypes[groupName]) or defaultType - else - if config.useGroupInheritance then encounteredTypes[groupName] = typeName end - end + if typeName == '' then typeName = defaultType end table.insert(onlineTeleports, { typeName, groupName, position, heading, pointName }) end end @@ -119,7 +112,7 @@ local debugPos = mapFixedTargetPosition:clone() local debugOrigPos = mapFixedTargetPosition:clone() local debugZoom, debugOrigZoom = table.clone(mapZoomValue), table.clone(mapZoomValue) local debugSpeed, debugOrigSpeed = table.clone(mapMoveSpeed), table.clone(mapMoveSpeed) -local debugUseGroupInheritance, debugOrigUseGroupInheritance = config.useGroupInheritance, config.useGroupInheritance + local debugUseGroupDrawMode, debugOrigUseGroupDrawMode = config.useGroupDrawMode, config.useGroupDrawMode local debugDistanceModeRange, debugOrigDistanceModeRange = config.distanceModeRange, config.distanceModeRange local debugOnlineExtra = nil @@ -324,32 +317,26 @@ local function window_FastTravelDebug() end) ui.tabItem("Point Display Settings", function() - if ui.checkbox("Use Group Inheritance", debugUseGroupInheritance) then - debugUseGroupInheritance = not debugUseGroupInheritance - config.useGroupInheritance = debugUseGroupInheritance - getTeleports() - end if ui.checkbox("Use Group Draw Mode", debugUseGroupDrawMode) then debugUseGroupDrawMode = not debugUseGroupDrawMode config.useGroupDrawMode = debugUseGroupDrawMode end - local rangeValue, rangeChanged = ui.slider("##distanceRange", debugDistanceModeRange, 1, 1000, "Distance Mode Range: %.0f") - if rangeChanged then - debugDistanceModeRange = rangeValue - config.distanceModeRange = debugDistanceModeRange + if not debugUseGroupDrawMode then + local rangeValue, rangeChanged = ui.slider("##distanceRange", debugDistanceModeRange, 1, 1000, "Distance Mode Range: %.0f") + if rangeChanged then + debugDistanceModeRange = rangeValue + config.distanceModeRange = debugDistanceModeRange + end end ui.separator() if ui.button("Reset") then - debugUseGroupInheritance = debugOrigUseGroupInheritance - config.useGroupInheritance = debugOrigUseGroupInheritance debugUseGroupDrawMode = debugOrigUseGroupDrawMode config.useGroupDrawMode = debugOrigUseGroupDrawMode debugDistanceModeRange = debugOrigDistanceModeRange config.distanceModeRange = debugOrigDistanceModeRange - getTeleports() end end) @@ -369,7 +356,6 @@ local function window_FastTravelDebug() exportConfig[#exportConfig + 1] = "- " .. math.round(mapFixedTargetPosition.y) exportConfig[#exportConfig + 1] = "- " .. math.round(mapFixedTargetPosition.z) exportConfig[#exportConfig + 1] = "RequireCollisionDisable: " .. tostring(config.disableCollisions) - exportConfig[#exportConfig + 1] = "UseGroupInheritance: " .. tostring(config.useGroupInheritance) exportConfig[#exportConfig + 1] = "UseGroupDrawMode: " .. tostring(config.useGroupDrawMode) exportConfig[#exportConfig + 1] = "DistanceModeRange: " .. math.round(config.distanceModeRange) ac.setClipboardText(table.concat(exportConfig, "\n")) @@ -440,7 +426,6 @@ function script.drawUI(dt) map_opacity = 0 end - --c1xtz: tpdrawing: if config.useGroupDrawMode is true, only draws the first point of each unique type per group, otherwise only draw the first icon of each type based on config.distanceModeRange distance. hoverMark = -1 local selected = {} local displayedPoints = {} @@ -453,6 +438,7 @@ function script.drawUI(dt) local picked = false if mapZoom > 2 then + --c1xtz: if config.useGroupDrawMode is true, only draws the first point of each unique type per group, otherwise only draw the first icon of each type based on config.distanceModeRange distance. if config.useGroupDrawMode then local group = teleport[2] displayedPoints[group] = displayedPoints[group] or {} @@ -488,13 +474,13 @@ function script.drawUI(dt) end end - --c1xtz: draw order stuff, making sure POINT_1 would be drawn ABOVE POINT_2 + --c1xtz: draw order fixing, making sure POINT_1 would be drawn ABOVE POINT_2 for i = #selected, 1, -1 do local point = selected[i] ui.drawImage(baseUrl .. 'mapicon_' .. point.teleport[1] .. '.png', point.screenPos - vec2(40, 40), point.screenPos + vec2(40, 40)) end - --c1xtz: draw order stuff 2, making sure that when hovering over a teleport icon while zooming in the mouse keeps sticking to the hovered point + --c1xtz: more draw order fixing, making sure that when hovering over a teleport icon while zooming in the mouse keeps sticking to the hovered point for i = 1, #selected do local point = selected[i] if mp > point.screenPos - vec2(30, 30) and mp < point.screenPos + vec2(30, 30) then From 5fda515a585eb4810059654f9ae971446ebb0901 Mon Sep 17 00:00:00 2001 From: C1XTZ Date: Thu, 5 Mar 2026 08:01:31 +0100 Subject: [PATCH 2/3] added HideUntypedPoints --- FastTravelPlugin/FastTravelConfiguration.cs | 3 +++ FastTravelPlugin/FastTravelModule.cs | 1 + FastTravelPlugin/FastTravelPlugin.cs | 1 + FastTravelPlugin/lua/fasttravel.lua | 7 +++++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/FastTravelPlugin/FastTravelConfiguration.cs b/FastTravelPlugin/FastTravelConfiguration.cs index fee55d0c..2eea77a7 100644 --- a/FastTravelPlugin/FastTravelConfiguration.cs +++ b/FastTravelPlugin/FastTravelConfiguration.cs @@ -22,6 +22,9 @@ public class FastTravelConfiguration : IValidateConfiguration MapFixedTargetPosition = [-2100, 0, 3200]; + [YamlMember(Description = "If true, points without a _TYPE assigned are ignored and not displayed. If false, they will default to SP.")] + public bool HideUntypedPoints { get; set; } = false; + [YamlMember(Description = "How teleport icons should cluster when zoomed out.\nTrue (Group mode): Displays only the first point of each type within a group.\nFalse (Distance mode): Displays one point of each type based on proximity, ignoring group names.")] public bool UseGroupDrawMode { get; set; } = true; diff --git a/FastTravelPlugin/FastTravelModule.cs b/FastTravelPlugin/FastTravelModule.cs index 481d7252..eb943c60 100644 --- a/FastTravelPlugin/FastTravelModule.cs +++ b/FastTravelPlugin/FastTravelModule.cs @@ -18,6 +18,7 @@ protected override void Load(ContainerBuilder builder) MapMoveSpeeds = [1, 2, 3, 0], ShowMapImage = false, MapFixedTargetPosition = [0, 0, 0], + HideUntypedPoints = false, UseGroupDrawMode = true, DistanceModeRange = 100 }; diff --git a/FastTravelPlugin/FastTravelPlugin.cs b/FastTravelPlugin/FastTravelPlugin.cs index ea4e1f46..e0311a7f 100644 --- a/FastTravelPlugin/FastTravelPlugin.cs +++ b/FastTravelPlugin/FastTravelPlugin.cs @@ -49,6 +49,7 @@ public FastTravelPlugin(FastTravelConfiguration configuration, ["mapMoveSpeeds"] = $"\"{JsonSerializer.Serialize(configuration.MapMoveSpeeds)}\"", ["showMapImg"] = configuration.ShowMapImage ? "true" : "false", ["disableCollisions"] = configuration.DisableCollisions ? "true" : "false", + ["hideUntypedPoints"] = configuration.HideUntypedPoints ? "true" : "false", ["useGroupDrawMode"] = configuration.UseGroupDrawMode ? "true" : "false", ["distanceModeRange"] = configuration.DistanceModeRange }); diff --git a/FastTravelPlugin/lua/fasttravel.lua b/FastTravelPlugin/lua/fasttravel.lua index 8570a79e..2fa0d6c5 100644 --- a/FastTravelPlugin/lua/fasttravel.lua +++ b/FastTravelPlugin/lua/fasttravel.lua @@ -11,6 +11,7 @@ local config = ac.configValues({ mapZoomValues = "", -- { 100, 1000, 4000, 15000 }, mapMoveSpeeds = "", -- { 1, 5, 20, 0 }, showMapImg = true, + hideUntypedPoints = false, useGroupDrawMode = true, distanceModeRange = 100 }) @@ -46,8 +47,10 @@ local function getTeleports() local position = extraOptions:get('TELEPORT_DESTINATIONS', points, vec3()) local heading = tonumber(extraOptions:get('TELEPORT_DESTINATIONS', points:gsub('_POS$', '_HEADING'), 0)) local typeName = extraOptions:get('TELEPORT_DESTINATIONS', points:gsub('_POS$', '_TYPE'), ''):lower() - if typeName == '' then typeName = defaultType end - table.insert(onlineTeleports, { typeName, groupName, position, heading, pointName }) + if typeName == '' and not config.hideUntypedPoints then typeName = defaultType end + if typeName ~= '' then + table.insert(onlineTeleports, { typeName, groupName, position, heading, pointName }) + end end end end From 305b6b32b87eaa35431121970a977f35d7d3e03a Mon Sep 17 00:00:00 2001 From: C1XTZ Date: Thu, 5 Mar 2026 08:27:00 +0100 Subject: [PATCH 3/3] dont forget the debug --- FastTravelPlugin/lua/fasttravel.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/FastTravelPlugin/lua/fasttravel.lua b/FastTravelPlugin/lua/fasttravel.lua index 2fa0d6c5..31c9b18e 100644 --- a/FastTravelPlugin/lua/fasttravel.lua +++ b/FastTravelPlugin/lua/fasttravel.lua @@ -118,6 +118,7 @@ local debugSpeed, debugOrigSpeed = table.clone(mapMoveSpeed), table.clone(mapMov local debugUseGroupDrawMode, debugOrigUseGroupDrawMode = config.useGroupDrawMode, config.useGroupDrawMode local debugDistanceModeRange, debugOrigDistanceModeRange = config.distanceModeRange, config.distanceModeRange +local debugHideUntypedPoints, debugOrigHideUntypedPoints = config.hideUntypedPoints, config.hideUntypedPoints local debugOnlineExtra = nil local debugWindowOpen = false @@ -321,6 +322,12 @@ local function window_FastTravelDebug() ui.tabItem("Point Display Settings", function() + if ui.checkbox("Hide Untyped Points", debugHideUntypedPoints) then + debugHideUntypedPoints = not debugHideUntypedPoints + config.hideUntypedPoints = debugHideUntypedPoints + getTeleports() + end + if ui.checkbox("Use Group Draw Mode", debugUseGroupDrawMode) then debugUseGroupDrawMode = not debugUseGroupDrawMode config.useGroupDrawMode = debugUseGroupDrawMode @@ -336,10 +343,9 @@ local function window_FastTravelDebug() ui.separator() if ui.button("Reset") then - debugUseGroupDrawMode = debugOrigUseGroupDrawMode - config.useGroupDrawMode = debugOrigUseGroupDrawMode - debugDistanceModeRange = debugOrigDistanceModeRange - config.distanceModeRange = debugOrigDistanceModeRange + debugHideUntypedPoints, config.hideUntypedPoints = debugOrigHideUntypedPoints, debugOrigHideUntypedPoints + debugUseGroupDrawMode, config.useGroupDrawMode = debugOrigUseGroupDrawMode, debugOrigUseGroupDrawMode + debugDistanceModeRange, config.distanceModeRange = debugOrigDistanceModeRange, debugOrigDistanceModeRange end end)