Merge the new shipbrowser into master *Nom*
2
eos
@@ -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, "icons/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")
|
||||
|
||||
1606
gui/shipBrowser.py
BIN
icons/faccept_small.png
Normal file
|
After Width: | Height: | Size: 781 B |
BIN
icons/fforward_small.png
Normal file
|
After Width: | Height: | Size: 607 B |
BIN
icons/fit_add_small.png
Normal file
|
After Width: | Height: | Size: 733 B |
BIN
icons/fit_delete_small.png
Normal file
|
After Width: | Height: | Size: 715 B |
BIN
icons/fit_rename_small.png
Normal file
|
After Width: | Height: | Size: 512 B |
BIN
icons/freset_small.png
Normal file
|
After Width: | Height: | Size: 604 B |
BIN
icons/frewind_small.png
Normal file
|
After Width: | Height: | Size: 614 B |
BIN
icons/fsearch_small.png
Normal file
|
After Width: | Height: | Size: 615 B |
BIN
icons/fshipbk_big.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
@@ -53,10 +53,10 @@ class Fit(object):
|
||||
fit = eos.db.getFit(fitID)
|
||||
return fit.modules[pos]
|
||||
|
||||
def newFit(self, shipID, name):
|
||||
def newFit(self, shipID, name=None):
|
||||
fit = eos.types.Fit()
|
||||
fit.ship = eos.types.Ship(eos.db.getItem(shipID))
|
||||
fit.name = name
|
||||
fit.name = name if name is not None else "New %s" % fit.ship.item.name
|
||||
fit.damagePattern = DamagePattern.getInstance().getDamagePattern("Uniform")
|
||||
eos.db.save(fit)
|
||||
fit.calculateModifiedAttributes()
|
||||
@@ -95,6 +95,14 @@ class Fit(object):
|
||||
fit.calculateModifiedAttributes()
|
||||
return fit
|
||||
|
||||
def searchFits(self, name):
|
||||
results = eos.db.searchFits(name)
|
||||
fits = []
|
||||
for fit in results:
|
||||
fits.append((fit.ID, fit.name, fit.ship.item.ID, fit.ship.item.name))
|
||||
|
||||
return fits
|
||||
|
||||
def addImplant(self, fitID, itemID):
|
||||
if fitID is None:
|
||||
return False
|
||||
|
||||
@@ -165,14 +165,6 @@ class Market():
|
||||
def searchItems(self, name, callback):
|
||||
self.searchWorkerThread.scheduleSearch(name, callback)
|
||||
|
||||
def searchFits(self, name):
|
||||
results = eos.db.searchFits(name)
|
||||
fits = []
|
||||
for fit in results:
|
||||
fits.append((fit.ID, fit.name, fit.ship.item.name))
|
||||
|
||||
return fits
|
||||
|
||||
def getImplantTree(self):
|
||||
return self.getChildren(27)
|
||||
|
||||
|
||||