[FL-2083] Bring Passport back (#868)

* [FL-2083] Bring Passport back
* Move Passport to Settings
* Hide icounter editing

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Albert Kharisov
2021-12-07 17:13:07 +04:00
committed by GitHub
parent 185647a09a
commit 604d80aed4
19 changed files with 573 additions and 367 deletions

View File

@@ -102,6 +102,18 @@ uint8_t dolphin_get_level(uint32_t icounter) {
}
}
uint32_t dolphin_state_xp_above_last_levelup(uint32_t icounter) {
uint32_t threshold = 0;
if(icounter <= LEVEL2_THRESHOLD) {
threshold = 0;
} else if(icounter <= LEVEL3_THRESHOLD) {
threshold = LEVEL2_THRESHOLD + 1;
} else {
threshold = LEVEL3_THRESHOLD + 1;
}
return icounter - threshold;
}
uint32_t dolphin_state_xp_to_levelup(uint32_t icounter) {
uint32_t threshold = 0;
if(icounter <= LEVEL2_THRESHOLD) {

View File

@@ -42,6 +42,8 @@ void dolphin_state_butthurted(DolphinState* dolphin_state);
uint32_t dolphin_state_xp_to_levelup(uint32_t icounter);
uint32_t dolphin_state_xp_above_last_levelup(uint32_t icounter);
bool dolphin_state_is_levelup(uint32_t icounter);
void dolphin_state_increase_level(DolphinState* dolphin_state);