factorix 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f93238fc1b419e6adf7ec45ac04331f84aba675b94cf4d4e57fd7c8555687678
4
- data.tar.gz: 2e7d4ed3b5c0b4be85fd5f1012eb4a73b84b160d5f31c1ed326a5830cba41c42
3
+ metadata.gz: ff57824d3ac0e73ae53844437c03f98bd10537f724a0285986b473b5136559f7
4
+ data.tar.gz: ed520b42e6f293f4e8021a71515f58348882093b634285d96c6d04164550d633
5
5
  SHA512:
6
- metadata.gz: 254733ebd3ad1b896a84c341d35a49a2d8943114d4fe0f90d0b83efae5399d9f862aedaeb0f7a68d42cdfedad9ab0dae9a4d77625646540de111e77567b74ab6
7
- data.tar.gz: 733b7da2d624bbf225e9bcbd586a0aa394c593d79743456c2a9b1a8ef06daf05603f1f4091da657038f7bacfdb766061a48026084a1d72290cc3350df2e8e694
6
+ metadata.gz: 36b43e73b76ec6e769ffaa7ec98dbcef83329490a01d6980518786fbb5699661db5e804fc3a0475455196aa0a1f50db2fd42ae233616a17dfef94b4578f71a31
7
+ data.tar.gz: d4f869b4cf329d391d59af1db92082e7acd18c0b6603334949f6fd7ffa22e11cc4536f16f3d0fdfefc1c3eeefa0653a8d0b207dd9eedaac201ad20ffca763fc6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.11.1] - 2026-03-03
4
+
5
+ ### Fixed
6
+
7
+ - Fix `mod sync` incorrectly saving `mod-list.json` and `mod-settings.dat` when nothing changed (#74)
8
+ - Include startup settings changes in the `mod sync` plan and confirmation flow (#74)
9
+
3
10
  ## [0.11.0] - 2026-03-03
4
11
 
5
12
  ### Added
@@ -61,12 +61,17 @@ module Factorix
61
61
  conflict_mods = find_conflict_mods(mod_list, save_data.mods, graph)
62
62
  changes = plan_mod_list_changes(mod_list, save_data.mods)
63
63
  unlisted_mods = keep_unlisted ? [] : find_unlisted_mods(mod_list, save_data.mods, conflict_mods)
64
+ mod_list_changed = needs_confirmation?(install_targets, conflict_mods, changes, unlisted_mods)
65
+ settings_changed = startup_settings_changed?(save_data.startup_settings)
64
66
 
65
67
  # Show combined plan and ask once
66
- show_sync_plan(install_targets, conflict_mods, changes, unlisted_mods)
68
+ unless mod_list_changed || settings_changed
69
+ say "Nothing to change", prefix: :info
70
+ return
71
+ end
67
72
 
68
- return if needs_confirmation?(install_targets, conflict_mods, changes, unlisted_mods) &&
69
- !confirm?("Do you want to apply these changes?")
73
+ show_sync_plan(install_targets, conflict_mods, changes, unlisted_mods, settings_changed)
74
+ return unless confirm?("Do you want to apply these changes?")
70
75
 
71
76
  # Execute phase
72
77
  if install_targets.any?
@@ -74,13 +79,17 @@ module Factorix
74
79
  say "Installed #{install_targets.size} MOD(s)", prefix: :success
75
80
  end
76
81
 
77
- apply_mod_list_changes(mod_list, conflict_mods, changes, unlisted_mods)
78
- backup_if_exists(runtime.mod_list_path)
79
- mod_list.save
80
- say "Updated mod-list.json", prefix: :success
82
+ if mod_list_changed
83
+ apply_mod_list_changes(mod_list, conflict_mods, changes, unlisted_mods)
84
+ backup_if_exists(runtime.mod_list_path)
85
+ mod_list.save
86
+ say "Updated mod-list.json", prefix: :success
87
+ end
81
88
 
82
- update_mod_settings(save_data.startup_settings, save_data.version)
83
- say "Updated mod-settings.dat", prefix: :success
89
+ if settings_changed
90
+ update_mod_settings(save_data.startup_settings, save_data.version)
91
+ say "Updated mod-settings.dat", prefix: :success
92
+ end
84
93
 
85
94
  say "Sync completed successfully", prefix: :success
86
95
  end
@@ -289,13 +298,9 @@ module Factorix
289
298
  # @param conflict_mods [Array<Hash>] MODs to disable due to conflicts
290
299
  # @param changes [Array<Hash>] MOD list changes from save file
291
300
  # @param unlisted_mods [Array<MOD>] MODs to disable as unlisted
301
+ # @param settings_changed [Boolean] Whether startup settings will be updated
292
302
  # @return [void]
293
- private def show_sync_plan(install_targets, conflict_mods, changes, unlisted_mods)
294
- unless needs_confirmation?(install_targets, conflict_mods, changes, unlisted_mods)
295
- say "Nothing to change", prefix: :info
296
- return
297
- end
298
-
303
+ private def show_sync_plan(install_targets, conflict_mods, changes, unlisted_mods, settings_changed)
299
304
  say "Planning to sync MOD(s):", prefix: :info
300
305
 
301
306
  if install_targets.any?
@@ -319,10 +324,12 @@ module Factorix
319
324
  end
320
325
 
321
326
  update_changes = changes.select {|c| c[:action] == :update }
322
- return if update_changes.none?
327
+ if update_changes.any?
328
+ say " Update:"
329
+ update_changes.each {|c| say " - #{c[:mod]} (#{c[:from_version]} \u2192 #{c[:to_version]})" }
330
+ end
323
331
 
324
- say " Update:"
325
- update_changes.each {|c| say " - #{c[:mod]} (#{c[:from_version]} \u2192 #{c[:to_version]})" }
332
+ say " Update startup settings" if settings_changed
326
333
  end
327
334
 
328
335
  # Apply all mod-list.json changes
@@ -427,6 +434,20 @@ module Factorix
427
434
  changes.any? {|c| c[:action] != :add || c[:to_enabled] } ||
428
435
  unlisted_mods.any?
429
436
  end
437
+
438
+ # Check whether startup settings from the save file differ from the current mod-settings.dat
439
+ #
440
+ # @param startup_settings [MODSettings::Section] Startup settings from save file
441
+ # @return [Boolean]
442
+ private def startup_settings_changed?(startup_settings)
443
+ return true unless runtime.mod_settings_path.exist?
444
+
445
+ mod_settings = MODSettings.load(runtime.mod_settings_path)
446
+ startup_section = mod_settings["startup"]
447
+ startup_settings.any? do |key, value|
448
+ startup_section[key] != value
449
+ end
450
+ end
430
451
  end
431
452
  end
432
453
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Factorix
4
- VERSION = "0.11.0"
4
+ VERSION = "0.11.1"
5
5
  public_constant :VERSION
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factorix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OZAWA Sakuro