#==============================================================================
# ** Window_Flags < Window_Base
# version 0.2 BETA
# by shadowball
#------------------------------------------------------------------------------
# This class shows the user flags according to the lists of town's allegiences.
#==============================================================================
class Window_Flags < Window_Base
FLAG =
{
# Allegiance => National Flags
Allegiance::Ally => 'flaggecko',
Allegiance::Neutral => 'flaggecko',
Allegiance::Enemy => 'flaggecko',
Allegiance::Unknown => 'flaggecko'
}
COUNTRY =
{
# Empires, Kingdoms, Republics, Tyrannies, Unknown
Allegiance::Ally => 'New Geckoshire',
Allegiance::Neutral => 'Republic of Mystic Valley',
Allegiance::Enemy => 'Tyranny of Gelbenfels',
Allegiance::Unknown => '?????'
}
def initialize(x, y, allegiance)
# Gather the towns of the same allegiance.
@towns = $game_towns.get_towns(allegiance)
# Create the window.
@allegiance = allegiance
x = 512
y = 0
super(x, y, 224, 192)
opacity = 255
self.contents = Bitmap.new(width - 32, height - 32)
bitmap = RPG::Cache.picture(FLAG[@allegiance])
px = 512
py = 0
self.contents.blt(px, py + 4, bitmap, Rect.new(0, 0, 192, 128), opacity)
self.opacity = 128
refresh
end
def refresh
self.contents.clear
x = 0
y = 128
nation = COUNTRY[@allegiance]
self.contents.draw_text(x, y, 224, 32, nation, 0)
end
end