GUI
: all by default
This commit is contained in:
@@ -107,25 +107,24 @@ class FameStat:
|
||||
self.fame_per_hour = fame_per_hour
|
||||
|
||||
|
||||
def zone_stats(with_damage=False):
|
||||
return get_stats(StatType.Zone, with_damage)
|
||||
def zone_stats():
|
||||
return get_stats(StatType.Zone)
|
||||
|
||||
|
||||
def overall_stats(with_damage=False):
|
||||
return get_stats(StatType.Overall, with_damage)
|
||||
def overall_stats():
|
||||
return get_stats(StatType.Overall)
|
||||
|
||||
|
||||
def last_fight_stats(with_damage=False):
|
||||
return get_stats(StatType.LastFight, with_damage)
|
||||
def last_fight_stats():
|
||||
return get_stats(StatType.LastFight)
|
||||
|
||||
|
||||
def get_stats(stat_type: StatType, with_damage: bool):
|
||||
def get_stats(stat_type: StatType):
|
||||
fame = game_stats.fame_stats(stat_type)
|
||||
time = game_stats.time_stats(stat_type)['seconds_in_game']
|
||||
fame = FameStat(Number(fame['fame']), Number(
|
||||
fame['fame'] / time if time > 0.0 else 0.0))
|
||||
players = list(filter(lambda p: p.value !=
|
||||
0.0 if with_damage else True, game_stats.damage_stats(stat_type)))
|
||||
players = game_stats.damage_stats(stat_type)
|
||||
|
||||
return players, fame, time
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ class ViewTypeWidget(QComboBox):
|
||||
def __init__(self):
|
||||
QComboBox.__init__(self)
|
||||
self.addItem(ViewType.DMG)
|
||||
self.addItem(ViewType.DMG_ALL)
|
||||
|
||||
def get_view_type(self):
|
||||
return self.currentText()
|
||||
@@ -130,14 +129,9 @@ class MainWidget(QWidget):
|
||||
def damage_stats(self):
|
||||
stats = {
|
||||
ViewType.DMG: {
|
||||
StatsType.ZONE: functools.partial(engine.zone_stats, with_damage=True),
|
||||
StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats, with_damage=True),
|
||||
StatsType.OVERALL: functools.partial(engine.overall_stats, with_damage=True),
|
||||
},
|
||||
ViewType.DMG_ALL: {
|
||||
StatsType.ZONE: functools.partial(engine.zone_stats, with_damage=False),
|
||||
StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats, with_damage=False),
|
||||
StatsType.OVERALL: functools.partial(engine.overall_stats, with_damage=False),
|
||||
StatsType.ZONE: functools.partial(engine.zone_stats),
|
||||
StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats),
|
||||
StatsType.OVERALL: functools.partial(engine.overall_stats),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
class ViewType:
|
||||
DMG = 'Stats (damage)'
|
||||
DMG_ALL = 'Stats (damage all)'
|
||||
Reference in New Issue
Block a user