@@ -475,14 +475,38 @@ local function checkForDataMigration(old_data_version, new_data_version)
475
475
end
476
476
end
477
477
478
+ local function updateIndicators (old_draw_terminal_indicator , new_draw_terminal_indicator )
479
+ if global .terminal_belts then
480
+ if old_draw_terminal_indicator ~= new_draw_terminal_indicator then
481
+ if new_draw_terminal_indicator then
482
+ -- add indicators to existing termbelts
483
+ for y ,row in pairs (global .terminal_belts ) do
484
+ for x ,belt in pairs (row ) do
485
+ belt .indicator = create_indicator (belt .entity )
486
+ end
487
+ end
488
+ else
489
+ -- remove existing indicators
490
+ for y ,row in pairs (global .terminal_belts ) do
491
+ for x ,belt in pairs (row ) do
492
+ belt .indicator = nil
493
+ end
494
+ end
495
+ end
496
+ end
497
+ end
498
+ end
499
+
478
500
local function onLoad ()
479
501
-- The only reason to have version/data_version is to trigger migrations, so do that here.
480
502
checkForMigration (global .version , mod_version )
481
503
checkForDataMigration (global .data_version , mod_data_version )
504
+ updateIndicators (global .draw_terminal_indicator , draw_terminal_indicator )
482
505
483
506
-- After these lines, we can no longer check for migration.
484
507
global .version = mod_version
485
508
global .data_version = mod_data_version
509
+ global .draw_terminal_indicator = draw_terminal_indicator
486
510
487
511
if global .terminal_belts == nil then
488
512
refreshData ()
0 commit comments