Class: PFM::Options

Inherits:
Object show all
Defined in:
scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb

Overview

The options data

The options are stored in $options and PFM.game_state.options

Author:

  • Nuri Yuri

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(starting_language, game_state = PFM.game_state) ⇒ Options

Create a new Option object with a language

Parameters:

  • starting_language (String)

    the lang id the game will start

  • game_state (PFM::GameState) (defaults to: PFM.game_state)

    variable responsive of containing the whole game state for easier access



41
42
43
44
45
46
47
48
49
50
51
52
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 41

def initialize(starting_language, game_state = PFM.game_state)
  @music_volume = 100
  @sfx_volume = 100
  @message_speed = 3
  @battle_mode = true
  @show_animation = true
  @catch_rename = true
  @language = starting_language
  @screen_scale = Graphics.window.settings[3]
  @game_state = game_state
  self.message_frame = Configs.window.message_frame_filenames.first
end

Instance Attribute Details

#battle_modeBoolean

If the battle ask to switch pokemon or not

Returns:

  • (Boolean)


18
19
20
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 18

def battle_mode
  @battle_mode
end

#catch_renameBoolean

If the battle ask to rename Pokémon at capture

Returns:

  • (Boolean)


24
25
26
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 24

def catch_rename
  @catch_rename
end

#game_statePFM::GameState

Get the game state responsive of the whole game state

Returns:



36
37
38
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 36

def game_state
  @game_state
end

#languageString

The lang id of the Studio::Text loads

Returns:



27
28
29
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 27

def language
  @language
end

#message_frameString

The message frame

Returns:



30
31
32
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 30

def message_frame
  @message_frame
end

#message_speedInteger

The speed of the message display

Returns:



15
16
17
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 15

def message_speed
  @message_speed
end

#music_volumeInteger Also known as: master_volume

The volume of the BGM and ME

Returns:



9
10
11
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 9

def music_volume
  @music_volume
end

#screen_scaleInteger

The display resolution

Returns:



33
34
35
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 33

def screen_scale
  @screen_scale
end

#sfx_volumeInteger

The volume of the BGS and SE

Returns:



12
13
14
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 12

def sfx_volume
  @sfx_volume
end

#show_animationBoolean

If the battle show move animations

Returns:

  • (Boolean)


21
22
23
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 21

def show_animation
  @show_animation
end

Instance Method Details

#master_volume=(value)

Change both music & sfx volume at the same time

Parameters:

  • value (Integer)

    the new volume



72
73
74
75
# File 'scripts/01450 Systems/00105 Options/00001 PFM/00500 Options.rb', line 72

def master_volume=(value)
  self.music_volume = value
  self.sfx_volume = value
end