Class: Modsvaskr::Games::SkyrimSe

Inherits:
Modsvaskr::Game show all
Defined in:
lib/modsvaskr/games/skyrim_se.rb

Overview

Handle a Skyrim installation

Instance Method Summary collapse

Methods inherited from Modsvaskr::Game

#clean_plugins, #decode_form_id, #initialize, #kill, #launch, #launch_exe, #load_order, #name, #path, #running?, #tests_poll_secs, #timeout_frozen_tests_secs, #timeout_interrupt_tests_secs, #xedit

Methods included from Logger

#log, #out, #wait_for_user_enter

Methods included from RunCmd

#run_cmd

Constructor Details

This class inherits a constructor from Modsvaskr::Game

Instance Method Details

#complete_game_menu(menu) ⇒ Object

Complete the game menu

API
  • This method is optional

Parameters
  • menu (CursesMenu): Menu to complete



23
24
25
26
27
28
29
# File 'lib/modsvaskr/games/skyrim_se.rb', line 23

def complete_game_menu(menu)
  menu.item 'Install SKSE64' do
    install_skse64
    out 'Press Enter to continue...'
    wait_for_user_enter
  end
end

#game_espsObject

Ordered list of default esps present in the game (the ones in the Data folder when 0 mod is being used). The list is ordered according to the game’s load order.

API
  • This method is mandatory

Result
  • Array<String>: List of esp/esm/esl base file names.



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/modsvaskr/games/skyrim_se.rb', line 46

def game_esps
  %w[
    skyrim.esm
    update.esm
    dawnguard.esm
    hearthfires.esm
    dragonborn.esm
    ccbgssse001-fish.esm
    ccqdrsse001-survivalmode.esl
    ccbgssse037-curios.esl
    ccbgssse025-advdsgs.esm
  ]
end

#initObject

Initialize the game

API
  • This method is optional



14
15
16
# File 'lib/modsvaskr/games/skyrim_se.rb', line 14

def init
  @tmp_dir = "#{Dir.tmpdir}/modsvaskr"
end

#read_load_orderObject

Read the load order.

API
  • This method is mandatory

Result
  • Array<String>: List of all active plugins, including masters



65
66
67
68
69
70
# File 'lib/modsvaskr/games/skyrim_se.rb', line 65

def read_load_order
  game_esps +
    File.read("#{ENV.fetch('USERPROFILE')}/AppData/Local/Skyrim Special Edition/plugins.txt").split("\n").map do |line|
      line =~ /^\*(.+)$/ ? Regexp.last_match(1).downcase : nil
    end.compact
end

#running_exeObject

Get the game running executable name (that can be found in a tasks manager)

API
  • This method is mandatory

Result
  • String: The running exe name



36
37
38
# File 'lib/modsvaskr/games/skyrim_se.rb', line 36

def running_exe
  'SkyrimSE.exe'
end