Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-41: Fix critical bug in building upgrade #43

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions gui/frames/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,19 @@ def bakery_upgrade(self) -> None:
def storehouse_upgrade(self) -> None:
self.upgrade_building("storehouse")

def show_feedback(self, feedback: str) -> None:
self.feedbackLabel = labels.InputLabel(
self, feedback
)
self.feedbackLabel.place(x=300, y=350)


def upgrade_building(self, building_type: str) -> None:
self.parent.backend.upgrade_building(building_type)
self.upgradeResponse = self.parent.backend.upgrade_building(building_type, '1')

self.parent.change_frame(
ConstructionFrame(self.parent)
) # TODO instead of initialising a new frame, update the current frame
frame = ConstructionFrame(self.parent)
self.parent.change_frame(frame) # TODO instead of initialising a new frame, update the current frame
frame.show_feedback(self.upgradeResponse["detail"])

def render(self):
self.label.grid(row=0, column=0)
Expand Down
Loading