-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create the navigation system with the previous screens
- Loading branch information
1 parent
b3119b4
commit 4948344
Showing
21 changed files
with
187 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#:kivy 2.2.1 | ||
#:import PATH_IMAGES tools.path.PATH_IMAGES | ||
#:import PATH_TITLE_FONT tools.path.PATH_TITLE_FONT | ||
#:import TITLE_FONT_SIZE tools.constants.TITLE_FONT_SIZE | ||
#:import TITLE_OUTLINE_WIDTH tools.constants.TITLE_OUTLINE_WIDTH | ||
#:import TITLE_OUTLINE_COLOR tools.constants.TITLE_OUTLINE_COLOR | ||
#:import PATH_TEXT_FONT tools.path.PATH_TEXT_FONT | ||
#:import TEXT_FONT_COLOR tools.constants.TEXT_FONT_COLOR | ||
#:import BOTTOM_BAR_HEIGHT tools.constants.BOTTOM_BAR_HEIGHT | ||
|
||
|
||
<QuestsScreen>: | ||
Label: | ||
text: "Quests" | ||
font_name: PATH_TITLE_FONT | ||
font_size: TITLE_FONT_SIZE * root.font_ratio | ||
pos_hint: {"center_x":0.5, "center_y":0.9} | ||
outline_width: TITLE_OUTLINE_WIDTH | ||
outline_color: TITLE_OUTLINE_COLOR | ||
color: TEXT_FONT_COLOR | ||
|
||
BottomBar: | ||
size_hint: (1, BOTTOM_BAR_HEIGHT) | ||
pos_hint: {"bottom":0,"left":0} | ||
selected: "none" | ||
|
||
RoundedButtonImage: | ||
image_path: PATH_IMAGES + "left_arrow.png" | ||
pos_hint: POS_HINT_BACK_ARROW | ||
size_hint: (0.1, None) | ||
height: self.width | ||
colors: root.primary_color | ||
on_release: root.go_backwards() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
""" | ||
Module to create the profile screen. | ||
""" | ||
|
||
############### | ||
### Imports ### | ||
############### | ||
|
||
### Kivy imports ### | ||
|
||
from kivy.properties import ( | ||
StringProperty, | ||
ColorProperty | ||
) | ||
|
||
### Local imports ### | ||
|
||
from tools.path import ( | ||
PATH_BACKGROUNDS, | ||
PATH_BADGES | ||
) | ||
from tools.constants import ( | ||
USER_DATA, | ||
THEMES_DICT | ||
) | ||
from tools.kivy_tools import ( | ||
ImprovedScreen | ||
) | ||
|
||
|
||
############# | ||
### Class ### | ||
############# | ||
|
||
|
||
class QuestsScreen(ImprovedScreen): | ||
""" | ||
Class to manage the screen that contains the profile information. | ||
""" | ||
|
||
primary_color = ColorProperty((0, 0, 0, 1)) | ||
secondary_color = ColorProperty((0, 0, 0, 1)) | ||
|
||
def __init__(self, **kwargs) -> None: | ||
current_theme_image = USER_DATA.settings["current_theme_image"] | ||
super().__init__( | ||
back_image_path=PATH_BACKGROUNDS + | ||
THEMES_DICT[current_theme_image]["image"], | ||
**kwargs) | ||
self.current_act_id: str | ||
self.current_level_id: str | None | ||
|
||
def reload_kwargs(self, dict_kwargs): | ||
self.current_act_id = dict_kwargs["current_act_id"] | ||
self.current_level_id = dict_kwargs["current_level_id"] | ||
|
||
def on_enter(self, *args): | ||
current_theme_image = USER_DATA.settings["current_theme_image"] | ||
current_theme_colors = USER_DATA.settings["current_theme_colors"] | ||
self.primary_color = THEMES_DICT[current_theme_colors]["primary"] | ||
self.secondary_color = THEMES_DICT[current_theme_colors]["secondary"] | ||
self.set_back_image_path( | ||
PATH_BACKGROUNDS + THEMES_DICT[current_theme_image]["image"]) | ||
return super().on_enter(*args) | ||
|
||
def go_backwards(self): | ||
self.manager.go_to_previous_screen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters