Skip to content

Commit

Permalink
Bugfix for target monitor new call arg in x4 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bvbohnen committed Mar 15, 2022
1 parent 09a4396 commit 0a11754
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Support/steam_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sn_station_kill_helper": "1.1",
"sn_interact_collection": "1.1",
"sn_extra_game_options": "1.13",
"sn_better_target_monitor": "2.0",
"sn_better_target_monitor": "2.1",
"sn_mod_support_apis": "1.88",
"sn_remove_dock_glow": "1.2",
"sn_quiet_target_range_clicks": "1.1",
Expand Down
4 changes: 3 additions & 1 deletion extensions/sn_better_target_monitor/change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ Change Log
- Russian translation, by aladinaleks
- Fixed content.xml text nodes.
* 2.0
- Japanese translation by Arkblade.
- Japanese translation by Arkblade.
* 2.1
- Update for x4 5.0.
2 changes: 1 addition & 1 deletion extensions/sn_better_target_monitor/content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name="Better Target Monitor"
description=" "
author="SirNukes"
version="200"
version="201"
date="2020-3-7"
save="false"
sync="false">
Expand Down
16 changes: 8 additions & 8 deletions extensions/sn_better_target_monitor/lua/Target_Monitor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Specific details on what text is displayed are handled in targetmonitor.lua.
The GetTargetMonitorDetails function handles selection of which text
to show on which rows. By wrappint it, text can be modified.
to show on which rows. By wrapping it, text can be modified.
Note: the display only has room for 7 rows, so some things may need
to be pruned or otherwise mucked with. There is a lot of vertical
Expand Down Expand Up @@ -1315,6 +1315,11 @@ function L.Patch_GetTargetMonitorDetails()
-- Get the standard table data.
local full_spec = ego_GetTargetMonitorDetails(component, templateConnectionName)

-- Quick exit when disabled or something went wrong.
if (not L.settings.enabled) or (full_spec == nil) then
return full_spec
end

-- To look up speed in GetLiveData, might need to save some info
-- from the GetTargetMonitorDetails call (unless there is another
-- way to rebuild it).
Expand All @@ -1331,11 +1336,6 @@ function L.Patch_GetTargetMonitorDetails()
L.targetdata.has_speed = false
L.targetdata.distance_error = false

-- Quick exit when disabled or something went wrong.
if (not L.settings.enabled) or (full_spec == nil) then
return full_spec
end

-- Hand off to helper functions based on object type.
local orig = L.Categorize_Original_Rows(full_spec.text)
local new_rows = L.Get_New_Rows(L.targetdata, orig, L.specs.rows, L.specs.cols)
Expand Down Expand Up @@ -1388,7 +1388,7 @@ end
function L.Patch_GetLiveData()
-- Wrap the live keyword replacement function.
local ego_GetLiveData = GetLiveData
GetLiveData = function(placeholder, component)
GetLiveData = function(placeholder, component, templateConnectionName)

local targetdata = L.targetdata

Expand Down Expand Up @@ -1432,7 +1432,7 @@ function L.Patch_GetLiveData()
end
end

return ego_GetLiveData(placeholder, component)
return ego_GetLiveData(placeholder, component, templateConnectionName)
end
end

Expand Down

0 comments on commit 0a11754

Please sign in to comment.