Pure Awesomeness/2

This commit is contained in:
HomeWorld
2010-10-26 17:16:14 +03:00
parent afde289652
commit 1b1f45b3d2
3 changed files with 23 additions and 6 deletions

View File

@@ -26,7 +26,8 @@ def getStaticBitmap(name, parent, location):
static.SetBitmap(getBitmap(name,location))
return static
locationMap = {"pack": os.path.join(config.staticPath, "icons")}
locationMap = {"pack": os.path.join(config.staticPath, "icons"),
"ships": os.path.join(config.staticPath, "ships")}
def getBitmap(name,location):
icon = getImage(name, location)
@@ -35,8 +36,13 @@ def getBitmap(name,location):
def getImage(name, location):
if location in locationMap:
location = locationMap[location]
path = os.path.join(location, "icon%s.png" % name)
if location == "pack":
location = locationMap[location]
path = os.path.join(location, "icon%s.png" % name)
else:
location = locationMap[location]
path = os.path.join(location, "%s.png" % name)
else:
location = os.path.join(config.path, location)
path = os.path.join(location, name + ".png")

View File

@@ -359,10 +359,14 @@ class ShipItem(wx.Window):
self._itemData = itemData
self.shipID = shipID
self.shipBmp = wx.EmptyBitmap(32, 32)
if shipID:
self.shipBmp = bitmapLoader.getBitmap(str(shipID),"ships")
else:
self.shipBmp = wx.EmptyBitmap(32, 32)
self.shipFittingInfo = shipFittingInfo
self.shipName, dummy = shipFittingInfo
self.newBmp = bitmapLoader.getBitmap("fit_add_small", "icons")
self.shipEffBk = bitmapLoader.getBitmap("fshipbk_big","icons")
self.shipBrowser = self.Parent.Parent
@@ -498,7 +502,7 @@ class ShipItem(wx.Window):
mdc.Clear()
mdc.SetFont(wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, False))
# mdc.DrawBitmap(self.effBmp,5+(rect.height-40)/2,(rect.height-40)/2,0)
mdc.DrawBitmap(self.shipEffBk,5+(rect.height - self.shipEffBk.GetWidth())/2,(rect.height - self.shipEffBk.GetHeight())/2,0)
mdc.DrawBitmap(self.shipBmp, 5 + (rect.height - 32) / 2, (rect.height - 32) / 2, 0)
@@ -535,12 +539,18 @@ class FitItem(wx.Window):
self.fitID = fitID
self.shipID = shipID
self.shipBrowser = self.Parent.Parent
self.shipBmp = wx.EmptyBitmap(32, 32)
if shipID:
self.shipBmp = bitmapLoader.getBitmap(str(shipID),"ships")
else:
self.shipBmp = wx.EmptyBitmap(32, 32)
self.shipFittingInfo = shipFittingInfo
self.shipName, self.fitName= shipFittingInfo
self.copyBmp = bitmapLoader.getBitmap("fit_add_small", "icons")
self.renameBmp = bitmapLoader.getBitmap("fit_rename_small", "icons")
self.deleteBmp = bitmapLoader.getBitmap("fit_delete_small","icons")
self.shipEffBk = bitmapLoader.getBitmap("fshipbk_big","icons")
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.renamePosX = 0
@@ -726,6 +736,7 @@ class FitItem(wx.Window):
mdc.Clear()
mdc.SetFont(wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, False))
# mdc.DrawBitmap(self.effBmp,5+(rect.height-40)/2,(rect.height-40)/2,0)
mdc.DrawBitmap(self.shipEffBk,5+(rect.height - self.shipEffBk.GetWidth())/2,(rect.height - self.shipEffBk.GetHeight())/2,0)
mdc.DrawBitmap(self.shipBmp, 5 + (rect.height - 32) / 2, (rect.height - 32) / 2, 0)

BIN
icons/fshipbk_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB