mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Killed off RGSS, deleted font installer code
This commit is contained in:
@@ -17,9 +17,9 @@ class Window_DexesList < Window_CommandPokemon
|
||||
def drawItem(index,count,rect)
|
||||
super(index,count,rect)
|
||||
if index>=0 && index<@commands2.length
|
||||
pbDrawShadowText(self.contents,rect.x+254,rect.y + (mkxp? ? 6 : 0),64,rect.height,
|
||||
pbDrawShadowText(self.contents,rect.x+254,rect.y + 6,64,rect.height,
|
||||
sprintf("%d",@commands2[index][0]),self.baseColor,self.shadowColor,1)
|
||||
pbDrawShadowText(self.contents,rect.x+350,rect.y + (mkxp? ? 6 : 0),64,rect.height,
|
||||
pbDrawShadowText(self.contents,rect.x+350,rect.y + 6,64,rect.height,
|
||||
sprintf("%d",@commands2[index][1]),self.baseColor,self.shadowColor,1)
|
||||
allseen = (@commands2[index][0]>=@commands2[index][2])
|
||||
allown = (@commands2[index][1]>=@commands2[index][2])
|
||||
|
||||
@@ -45,7 +45,7 @@ class Window_Pokedex < Window_DrawableCommand
|
||||
else
|
||||
text = sprintf("%03d ----------",indexNumber)
|
||||
end
|
||||
pbDrawShadowText(self.contents,rect.x+36,rect.y+6 + (mkxp? ? 6 : 0),rect.width,rect.height,
|
||||
pbDrawShadowText(self.contents,rect.x+36,rect.y+6 + 6,rect.width,rect.height,
|
||||
text,self.baseColor,self.shadowColor)
|
||||
end
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class Window_CommandPokemonColor < Window_CommandPokemon
|
||||
base = Color.new(0,80,160)
|
||||
shadow = Color.new(128,192,240)
|
||||
end
|
||||
pbDrawShadowText(self.contents,rect.x,rect.y + (mkxp? ? 6 : 0),rect.width,rect.height,
|
||||
pbDrawShadowText(self.contents,rect.x,rect.y + 6,rect.width,rect.height,
|
||||
@commands[index],base,shadow)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -257,7 +257,6 @@ class PokemonLoadScreen
|
||||
$game_system = Game_System.new
|
||||
$PokemonSystem = PokemonSystem.new if !$PokemonSystem
|
||||
savefile = RTP.getSaveFileName("Game.rxdata")
|
||||
FontInstaller.install
|
||||
data_system = pbLoadRxData("Data/System")
|
||||
mapfile = sprintf("Data/Map%03d.rxdata",data_system.start_map_id)
|
||||
if data_system.start_map_id==0 || !pbRgssExists?(mapfile)
|
||||
@@ -480,146 +479,3 @@ class PokemonLoadScreen
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
# Font installer
|
||||
################################################################################
|
||||
module FontInstaller
|
||||
# filenames of fonts to be installed
|
||||
Filenames = [
|
||||
'pkmnem.ttf',
|
||||
'pkmnemn.ttf',
|
||||
'pkmnems.ttf',
|
||||
'pkmnrs.ttf',
|
||||
'pkmndp.ttf',
|
||||
'pkmnfl.ttf'
|
||||
]
|
||||
# names (not filenames) of fonts to be installed
|
||||
Names = [
|
||||
'Power Green',
|
||||
'Power Green Narrow',
|
||||
'Power Green Small',
|
||||
'Power Red and Blue',
|
||||
'Power Clear',
|
||||
'Power Red and Green'
|
||||
]
|
||||
# whether to notify player (via pop-up message) that fonts were installed
|
||||
Notify = true
|
||||
# location of fonts (relative to game folder)
|
||||
Source = 'Fonts/'
|
||||
|
||||
def self.getFontFolder
|
||||
fontfolder = MiniRegistry.get(MiniRegistry::HKEY_CURRENT_USER,
|
||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders","Fonts")
|
||||
return fontfolder+"\\" if fontfolder
|
||||
if ENV['SystemRoot']
|
||||
return ENV['SystemRoot'] + '\\Fonts\\'
|
||||
elsif ENV['windir']
|
||||
return ENV['windir'] + '\\Fonts\\'
|
||||
else
|
||||
return '\\Windows\\Fonts\\'
|
||||
end
|
||||
end
|
||||
|
||||
AFR = Win32API.new('gdi32', 'AddFontResource', ['P'], 'L')
|
||||
WPS = Win32API.new('kernel32', 'WriteProfileString', ['P'] * 3, 'L')
|
||||
SM = Win32API.new('user32', 'PostMessage', ['L'] * 4, 'L')
|
||||
WM_FONTCHANGE = 0x001D
|
||||
HWND_BROADCAST = 0xffff
|
||||
|
||||
def self.copy_file(src,dest)
|
||||
File.open(src,'rb') { |r|
|
||||
File.open(dest,'wb') { |w|
|
||||
while s = r.read(4096)
|
||||
w.write s
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def self.pbResolveFont(name)
|
||||
RTP.eachPathFor(Source+name) { |file|
|
||||
return file if safeExists?(file)
|
||||
}
|
||||
return Source+name
|
||||
end
|
||||
|
||||
def self.install
|
||||
success = []
|
||||
# Check if all fonts already exist
|
||||
filesExist = true
|
||||
dest = self.getFontFolder
|
||||
for i in 0...Names.size
|
||||
filesExist = false if !safeExists?(dest + Filenames[i])
|
||||
end
|
||||
return if filesExist
|
||||
# Check if all source fonts exist
|
||||
exist = true
|
||||
for i in 0...Names.size
|
||||
if !RTP.exists?(Source + Filenames[i])
|
||||
exist = false
|
||||
break
|
||||
end
|
||||
end
|
||||
return if !exist # Exit if not all source fonts exist
|
||||
pbMessage(_INTL("One or more fonts used in this game do not exist on the system.\1"))
|
||||
pbMessage(_INTL("The game can be played, but the look of the game's text will not be optimal."))
|
||||
failed = false
|
||||
for i in 0...Filenames.size
|
||||
f = Filenames[i]
|
||||
if safeExists?(dest + f) && !Font.exist?(Names[i])
|
||||
File.delete(dest + f) rescue nil
|
||||
end
|
||||
# check if already installed...
|
||||
if not safeExists?(dest + f)
|
||||
# check to ensure font is in specified location...
|
||||
if RTP.exists?(Source + f)
|
||||
# copy file to fonts folder
|
||||
succeeded = false
|
||||
begin
|
||||
copy_file(pbResolveFont(f), dest + f)
|
||||
# add font resource
|
||||
AFR.call(dest + f)
|
||||
# add entry to win.ini/registry
|
||||
WPS.call('Fonts', Names[i] + ' (TrueType)', f)
|
||||
succeeded = safeExists?(dest + f)
|
||||
rescue SystemCallError
|
||||
# failed
|
||||
succeeded = false
|
||||
end
|
||||
if succeeded
|
||||
success.push(Names[i])
|
||||
else
|
||||
failed = true
|
||||
end
|
||||
end
|
||||
else
|
||||
success.push(Names[i]) # assume success
|
||||
end
|
||||
end
|
||||
if success.length>0 # one or more fonts successfully installed
|
||||
SM.call(HWND_BROADCAST,WM_FONTCHANGE,0,0)
|
||||
if Notify
|
||||
fonts = ''
|
||||
success.each do |f|
|
||||
fonts << f << ', '
|
||||
end
|
||||
if failed
|
||||
pbMessage(_INTL("Some of the fonts were successfully installed.\1"))
|
||||
pbMessage(_INTL("To install the other fonts, copy the files in this game's Fonts folder to the Fonts folder in Control Panel.\1"))
|
||||
else
|
||||
pbMessage(_INTL("The fonts were successfully installed.\1"))
|
||||
end
|
||||
if pbConfirmMessage(_INTL("Would you like to restart the game and apply the changes?"))
|
||||
a = Thread.new { system('Game') }
|
||||
exit
|
||||
end
|
||||
end
|
||||
else
|
||||
# No fonts were installed.
|
||||
pbMessage(_INTL("To install the necessary fonts, copy the files in this game's Fonts folder to the Fonts folder in Control Panel."))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -331,7 +331,7 @@ class Window_PokemonOption < Window_DrawableCommand
|
||||
rect = drawCursor(index,rect)
|
||||
optionname = (index==@options.length) ? _INTL("Cancel") : @options[index].name
|
||||
optionwidth = rect.width*9/20
|
||||
text_y = rect.y + (mkxp? ? 6 : 0)
|
||||
text_y = rect.y + 6
|
||||
pbDrawShadowText(self.contents,rect.x,text_y,optionwidth,rect.height,optionname,
|
||||
@nameBaseColor,@nameShadowColor)
|
||||
return if index==@options.length
|
||||
|
||||
@@ -413,7 +413,7 @@ class PokemonBoxSprite < SpriteWrapper
|
||||
pbSetSystemFont(@contents)
|
||||
widthval = @contents.text_size(boxname).width
|
||||
xval = 162-(widthval/2)
|
||||
pbDrawShadowText(@contents,xval,8 + (mkxp? ? 6 : 0),widthval,32,
|
||||
pbDrawShadowText(@contents,xval,8 + 6,widthval,32,
|
||||
boxname,Color.new(248,248,248),Color.new(40,48,48))
|
||||
@refreshBox = false
|
||||
end
|
||||
@@ -537,7 +537,7 @@ class PokemonBoxPartySprite < SpriteWrapper
|
||||
def refresh
|
||||
@contents.blt(0,0,@boxbitmap.bitmap,Rect.new(0,0,172,352))
|
||||
pbDrawTextPositions(self.bitmap,[
|
||||
[_INTL("Back"),86,242 - (mkxp? ? 2 : 0),2,Color.new(248,248,248),Color.new(80,80,80),1]
|
||||
[_INTL("Back"),86,240,2,Color.new(248,248,248),Color.new(80,80,80),1]
|
||||
])
|
||||
|
||||
xvalues = [18,90,18,90,18,90]
|
||||
@@ -1385,8 +1385,8 @@ class PokemonStorageScene
|
||||
buttonbase = Color.new(248,248,248)
|
||||
buttonshadow = Color.new(80,80,80)
|
||||
pbDrawTextPositions(overlay,[
|
||||
[_INTL("Party: {1}",(@storage.party.length rescue 0)),270,328 - (mkxp? ? 2 : 0),2,buttonbase,buttonshadow,1],
|
||||
[_INTL("Exit"),446,328 - (mkxp? ? 2 : 0),2,buttonbase,buttonshadow,1],
|
||||
[_INTL("Party: {1}",(@storage.party.length rescue 0)),270,326,2,buttonbase,buttonshadow,1],
|
||||
[_INTL("Exit"),446,326,2,buttonbase,buttonshadow,1],
|
||||
])
|
||||
pokemon = nil
|
||||
if @screen.pbHeldPokemon
|
||||
|
||||
Reference in New Issue
Block a user