modsvaskr 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d247b6d5b73f10426d5769b031213c408bc6ac8c390baea5e9f6a1b0af7495d
4
- data.tar.gz: 97d98a1e6d93088e7a63f9a07ac31b01c3ed8e0aba4e4159a842fff9af8efaae
3
+ metadata.gz: 49c9d23f41a3e7e6b7f60f4961e402e28e2136074f6e01e62da3d9a36ec41fce
4
+ data.tar.gz: 276d691af40d723b2412951654299e7a4d745ac83de2e4c76bd2df1baba4c3a6
5
5
  SHA512:
6
- metadata.gz: d17a2422af5a5428266c5586887ab5210e0ad7026c8c07fced929b2731aafb07c97bad7c4c8be5886cac8d19ae7e51e1f3f386da6d00d64536e0032bde004e76
7
- data.tar.gz: 775b864997420ad4e78af51e4511d0ad579a236781cbc30c1f1c577992ae3f486d3ab40f701acf4937d51b2bf4397d02fb54c409d37965a03596e0acc57ad799
6
+ metadata.gz: 15c41045b26d2c8d05ab3ec94aa06420745a121402f08a5a0fb3aec1d7ab0bab0a459cb69a9083d34cdcb5b06574ea45a7cedd982be8a9503c791cfe82bff9df
7
+ data.tar.gz: 9c6370ad8b2f54728beb175a10887227193ad27817237db090d9a99e5a8f1d5eb5c0adac790c5596bb5cfbbd566f6750be665a60ab5e1ef06396a5dec72e0cbf
@@ -24,19 +24,34 @@ module Modsvaskr
24
24
  def discover_tests
25
25
  tests = {}
26
26
  @game.xedit.run_script('DumpInfo', only_once: true)
27
+ # Keep track of masters, per plugin
28
+ # Hash<String, Array<String> >
29
+ masters = {}
30
+ # Keep track of NPCs
31
+ # Array< [String, Integer, String] >
32
+ # Array< [Plugin, FormID, NPC ] >
33
+ npcs = []
27
34
  @game.xedit.parse_csv('Modsvaskr_ExportedDumpInfo') do |row|
28
- if row[1].downcase == 'npc_'
29
- # Know from which mod this ID comes from
30
- plugin, base_form_id = @game.decode_form_id(row[2])
31
- test_name = "#{plugin}/#{base_form_id}"
32
- if tests.key?(test_name)
33
- # Add the name of the mod to the description, so that we know which mod modifies which NPC.
34
- tests[test_name][:name] << "/#{row[0].downcase}"
35
- else
36
- tests[test_name] = {
37
- name: "Take screenshot of #{row[3]} - #{row[0].downcase}"
38
- }
39
- end
35
+ case row[1].downcase
36
+ when 'npc_'
37
+ npcs << [row[0].downcase, row[2].to_i(16), row[3]]
38
+ when 'tes4'
39
+ masters[row[0].downcase] = row[3..-1].map(&:downcase)
40
+ end
41
+ end
42
+ npcs.each do |(esp, form_id, npc_name)|
43
+ raise "Esp #{esp} declares NPC FormID #{form_id} (#{npc_name}) but its masters could not be parsed" unless masters.key?(esp)
44
+ # Know from which mod this ID comes from
45
+ mod_idx = form_id / 16_777_216
46
+ raise "NPC FormID #{form_id} (#{npc_name}) from #{esp} references an unknown master (known masters: #{masters[esp].join(', ')})" if mod_idx > masters[esp].size
47
+ test_name = "#{mod_idx == masters[esp].size ? esp : masters[esp][mod_idx]}/#{form_id % 16_777_216}"
48
+ if tests.key?(test_name)
49
+ # Add the name of the mod to the description, so that we know which mod modifies which NPC.
50
+ tests[test_name][:name] << "/#{esp}"
51
+ else
52
+ tests[test_name] = {
53
+ name: "Take screenshot of #{npc_name} - #{esp}"
54
+ }
40
55
  end
41
56
  end
42
57
  tests
@@ -1,12 +1,10 @@
1
- require 'modsvaskr/in_game_tests_suite'
1
+ require 'modsvaskr/tests_suites/npc'
2
2
 
3
3
  module Modsvaskr
4
4
 
5
5
  module TestsSuites
6
6
 
7
- class NpcHead < TestsSuite
8
-
9
- include InGameTestsSuite
7
+ class NpcHead < TestsSuites::Npc
10
8
 
11
9
  # Return the in-game tests suite to which we forward the tests to be run
12
10
  #
@@ -22,22 +20,9 @@ module Modsvaskr
22
20
  # Result::
23
21
  # * Hash< String, Hash<Symbol,Object> >: Ordered hash of test information, per test name
24
22
  def discover_tests
25
- tests = {}
26
- @game.xedit.run_script('DumpInfo', only_once: true)
27
- @game.xedit.parse_csv('Modsvaskr_ExportedDumpInfo') do |row|
28
- if row[1].downcase == 'npc_'
29
- # Know from which mod this ID comes from
30
- plugin, base_form_id = @game.decode_form_id(row[2])
31
- test_name = "#{plugin}/#{base_form_id}"
32
- if tests.key?(test_name)
33
- # Add the name of the mod to the description, so that we know which mod modifies which NPC.
34
- tests[test_name][:name] << "/#{row[0].downcase}"
35
- else
36
- tests[test_name] = {
37
- name: "Take head screenshot of #{row[3]} - #{row[0].downcase}"
38
- }
39
- end
40
- end
23
+ tests = super
24
+ tests.values.each do |test_info|
25
+ test_info[:name].gsub!('Take screenshot', 'Take head screenshot')
41
26
  end
42
27
  tests
43
28
  end
@@ -1,5 +1,5 @@
1
1
  module Modsvaskr
2
2
 
3
- VERSION = '0.1.10'
3
+ VERSION = '0.1.11'
4
4
 
5
5
  end
@@ -20,6 +20,9 @@ end;
20
20
  function Process(e: IInterface): integer;
21
21
  var
22
22
  worldElement : IwbContainer;
23
+ modFile : IwbFile;
24
+ idxMaster : integer;
25
+ masters : string;
23
26
  begin
24
27
  // AddMessage('Processing: ' + FullPath(e));
25
28
  if Signature(e) = 'CELL' then begin
@@ -55,6 +58,16 @@ begin
55
58
  IntToHex(FixedFormID(e), 8) + ',' +
56
59
  GetElementEditValues(e, 'FULL')
57
60
  );
61
+ end else if (Signature(e) = 'TES4') then begin
62
+ modFile := GetFile(e);
63
+ masters := '';
64
+ for idxMaster := 0 to MasterCount(modFile) - 1 do
65
+ masters := masters + ',' + GetFileName(MasterByIndex(modFile, idxMaster));
66
+ slCsv.Add(
67
+ '"' + GetFileName(GetFile(e)) + '",' +
68
+ Signature(e) + ',' +
69
+ masters
70
+ );
58
71
  end;
59
72
  Result := 0;
60
73
  end;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modsvaskr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-23 00:00:00.000000000 Z
11
+ date: 2021-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses_menu