feat: Added Financial Income to GroundObjectMenu building window

This commit is contained in:
Ignacio Muñoz Fernandez
2020-11-20 11:32:18 +01:00
committed by Dan Albert
parent 7c22f6e83b
commit 976ee51bf5
2 changed files with 31 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import os
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import QGroupBox, QHBoxLayout, QVBoxLayout, QLabel
from game.db import REWARDS
class QBuildingInfo(QGroupBox):
@@ -28,6 +28,14 @@ class QBuildingInfo(QGroupBox):
layout = QVBoxLayout()
layout.addWidget(self.header)
layout.addWidget(self.name)
if self.building.category in REWARDS.keys():
income_label_text = 'Value: ' + str(REWARDS[self.building.category]) + "M"
if self.building.is_dead:
income_label_text = '<s>' + income_label_text + '</s>'
self.reward = QLabel(income_label_text)
layout.addWidget(self.reward)
footer = QHBoxLayout()
self.setLayout(layout)