Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Window_SystemOptions < Window_Command
- def ok_enabled?
- return true if [:to_title, :shutdown, :keySettings].include?(current_symbol)
- return true if [:fitToScreen].include?(current_symbol)
- return false
- end
- def draw_resolution
- rect = item_rect(1)
- contents.clear_rect(rect)
- name = Mewgles_SystemOptionsEdit::RESOLUTION_NAME
- draw_text(0, rect.y, contents.width/2, line_height, name, 1)
- dx = contents.width / 2
- enabled = true
- #~ if Mewgles_SystemOptionsEdit::toggle_state == false
- change_color(normal_color, enabled)
- #~ else
- #~ change_color(normal_color, !enabled)
- #~ end
- indx = Mewgles_SystemOptionsEdit::resolution_index
- option = Mewgles_SystemOptionsEdit::RESOLUTIONS[indx][0]
- draw_text(dx, rect.y, contents.width/4, line_height, option, 1)
- end
- def draw_fit_to_screen
- rect = item_rect(2)
- contents.clear_rect(rect)
- #~ if Mewgles_SystemOptionsEdit::toggle_state == false
- change_color(normal_color, true)
- #~ else
- #~ change_color(normal_color, false)
- #~ end
- name = Mewgles_SystemOptionsEdit::FIT_TO_SCREEN_NAME
- draw_text(contents.width/4, rect.y, contents.width/2, line_height, name, 1)
- end
- def change_screen_toggle(direction)
- value = direction == :left ? false : true
- ext = current_ext
- #~ if Mewgles_SystemOptionsEdit::toggle_state == false
- Mewgles_SystemOptionsEdit::fit_state = true
- Mewgles_SystemOptionsEdit::toggle_state = !Mewgles_SystemOptionsEdit::toggle_state
- #~ Mewgles_SystemOptionsEdit::resolution_index = 0
- draw_fit_to_screen
- draw_resolution
- #~ else
- #~ Mewgles_SystemOptionsEdit::toggle_state = false
- #~ Mewgles_SystemOptionsEdit::resolution_index = 0
- #~ draw_fit_to_screen
- #~ draw_resolution
- #~ end
- Graphics.toggle_fullscreen
- Window_Resize.f
- Sound.play_cursor
- draw_item(index)
- end
- def change_resolution(direction)
- value = direction == :left ? false : true
- ext = current_ext
- #~ if Mewgles_SystemOptionsEdit::toggle_state == false
- maxlength = Mewgles_SystemOptionsEdit::RESOLUTIONS.length() - 2
- if direction == :left && Mewgles_SystemOptionsEdit::resolution_index >= 0
- Mewgles_SystemOptionsEdit::resolution_index -= 1
- elsif direction == :left && Mewgles_SystemOptionsEdit::resolution_index < 0
- Mewgles_SystemOptionsEdit::resolution_index = maxlength
- end
- if direction == :right && Mewgles_SystemOptionsEdit::resolution_index <= maxlength
- Mewgles_SystemOptionsEdit::resolution_index += 1
- elsif direction == :right && Mewgles_SystemOptionsEdit::resolution_index > maxlength
- Mewgles_SystemOptionsEdit::resolution_index = 0
- end
- index = Mewgles_SystemOptionsEdit::resolution_index
- Mewgles_SystemOptionsEdit::fit_state = false
- x = Mewgles_SystemOptionsEdit::RESOLUTIONS[index][1]
- y = Mewgles_SystemOptionsEdit::RESOLUTIONS[index][2]
- Window_Resize.r(x, y)
- Sound.play_cursor
- draw_resolution
- #~ else
- #~ Sound.play_buzzer
- #~ end
- end
- end
- class Scene_System < Scene_MenuBase
- def command_fit_to_screen
- #~ if !Mewgles_SystemOptionsEdit::toggle_state
- if !Mewgles_SystemOptionsEdit::fit_state
- Window_Resize.f
- Mewgles_SystemOptionsEdit::fit_state = true
- else
- index = Mewgles_SystemOptionsEdit::resolution_index
- x = Mewgles_SystemOptionsEdit::RESOLUTIONS[index][1]
- y = Mewgles_SystemOptionsEdit::RESOLUTIONS[index][2]
- Window_Resize.r(x, y)
- Mewgles_SystemOptionsEdit::fit_state = false
- end
- @command_window.activate
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement