Class: Configs::Window

Inherits:
Object show all
Defined in:
scripts/00800 Studio/00000 Configs/00005 Window.rb

Overview

Configuration of window

Every window builder should be Array of integer like this

ConstName = [middle_tile_x, middle_tile_y, middle_tile_width, middle_tile_height,
             contents_offset_left, contents_offset_top, contents_offset_right, contents_offset_bottom]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWindow

Returns a new instance of Window.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'scripts/00800 Studio/00000 Configs/00005 Window.rb', line 16

def initialize
  @message_frames = {
    message: 'X/Y',
    m_1: 'Gold',
    m_2: 'Silver',
    m_3: 'Red',
    m_4: 'Blue',
    m_5: 'Green',
    m_6: 'Orange',
    m_7: 'Purple',
    m_8: 'Heart Gold',
    m_9: 'Soul Silver',
    m_10: 'Rocket',
    m_11: 'Blue Indus',
    m_12: 'Red Indus',
    m_13: 'Swamp',
    m_14: 'Safari',
    m_15: 'Brick',
    m_16: 'Sea',
    m_17: 'River',
    m_18: 'B/W'
  }

  @builders = {
    generic: [16, 16, 8, 8, 16, 8],
    message_box: [14, 7, 8, 8, 16, 8]
  }
end

Instance Attribute Details

#buildersHash<Symbol => Array>

All the window builder

Returns:

  • (Hash<Symbol => Array>)


14
15
16
# File 'scripts/00800 Studio/00000 Configs/00005 Window.rb', line 14

def builders
  @builders
end

#message_framesHash<Symbol => String>

All message frames with their names

Returns:



10
11
12
# File 'scripts/00800 Studio/00000 Configs/00005 Window.rb', line 10

def message_frames
  @message_frames
end

Instance Method Details

#message_frame_filenamesArray<String>

Get all the message frame filenames

Returns:



47
48
49
# File 'scripts/00800 Studio/00000 Configs/00005 Window.rb', line 47

def message_frame_filenames
  @message_frame_filenames ||= @message_frames.keys.map(&:to_s)
end

#message_frame_namesArray<String>

Get all the message frame names

Returns:



53
54
55
# File 'scripts/00800 Studio/00000 Configs/00005 Window.rb', line 53

def message_frame_names
  @message_frame_names ||= @message_frames.values.map { |s| s.is_a?(String) ? s : text_get(*s) }
end

#to_json



57
58
59
60
61
62
63
# File 'scripts/00800 Studio/00000 Configs/00005 Window.rb', line 57

def to_json(*)
  {
    klass: self.class.to_s,
    message_frames: @message_frames,
    builders: @builders
  }.to_json
end