#==============================================================================
# ** Disable Fullscreen
#------------------------------------------------------------------------------
# Draycos Goldaryn
# Version 2.00
# 9/1/07
# SDK Version : 2.0 - Parts 1, 2, 3
#==============================================================================
#----------------------------------------------------------------------------
# SDK detection
#----------------------------------------------------------------------------
begin
SDK_AUTO_DETECT = SDK::Version
rescue
SDK_AUTO_DETECT = nil
end
#----------------------------------------------------------------------------
# Begin SDK Emulation
#----------------------------------------------------------------------------
unless SDK_AUTO_DETECT !=nil
module SDK
def self.enabled?(script)
return true if script == 'Disable Fullscreen'
end
end
#----------------------------------------------------------------------------
# End SDK Emulation
#----------------------------------------------------------------------------
else
SDK.log('Disable Fullscreen','Draycos Goldaryn', 2.00, '9-1-07')
SDK.check_requirements(2.0, [2, 3])
end
#----------------------------------------------------------------------------
# Begin SDK Enabled Check
#----------------------------------------------------------------------------
if SDK.enabled?('Disable Fullscreen')
#----------------------------------------------------------------------------
# Disable Fullscreen
# - will return to windowed mode if it detects fullscreen mode.
#----------------------------------------------------------------------------
module Disable_Fullscreen
GSM = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')
KBE = Win32API.new('user32','keybd_event','%w(l,l,l,l)','')
def self.resolution
width = GSM.call(0)
height = GSM.call(1)
return width, height
end
def self.alt_enter
KBE.call(18,0,0,0)
KBE.call(13,0,0,0)
KBE.call(18,0,2,0)
KBE.call(13,0,2,0)
end
def self.update
if resolution[0] == 640
alt_enter
Graphics.update
sleep(1)
Graphics.update
sleep(1)
Graphics.update
sleep(1)
end
end
end
unless SDK_AUTO_DETECT == nil
#----------------------------------------------------------------------------
# SDK::Scene_Base
# - adds methods to all scenes
#----------------------------------------------------------------------------
class SDK::Scene_Base
alias_method(:draycos_disablefullscreen_scenebase_update, :update)
def update
Disable_Fullscreen.update
draycos_disablefullscreen_scenebase_update
end
end
else
#----------------------------------------------------------------------------
# module Input
# - is updated in every scene
#----------------------------------------------------------------------------
module Input
class << self
alias_method(:draycos_disablefullscreen_input_update,:update)
def update
draycos_disablefullscreen_input_update
Disable_Fullscreen.update
end
end
end
end
#----------------------------------------------------------------------------
# End SDK Enabled Test
#----------------------------------------------------------------------------
end