Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OriolCS2 committed May 14, 2019
1 parent 1a9deaf commit f1dc56e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<property name="attack_power_ability3" type="int" value="100"/>
<property name="cost_mana_special_attack" type="int" value="20"/>
<property name="cost_mana_special_attack3" type="int" value="25"/>
<property name="max_lives" type="int" value="40"/>
<property name="max_lives" type="int" value="400"/>
<property name="max_mana" type="int" value="200"/>
</properties>
<image source="../sprites/Warrior.png" width="336" height="341"/>
Expand Down
3 changes: 3 additions & 0 deletions Final_Fantasy_Mystery_World/m1Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,19 @@ bool m1Map::ChangeMap(Maps type)
case Maps::TUTORIAL:
quest_rooms = DBG_NEW RoomManager("tutorial");
actual_map = Maps::TUTORIAL;
App->menu_manager->EnableHUD(true);
return true;
break;
case Maps::QUEST2:
quest_rooms = DBG_NEW RoomManager("quest2");
actual_map = Maps::QUEST2;
App->menu_manager->EnableHUD(true);
return true;
break;
case Maps::FINAL_QUEST:
quest_rooms = DBG_NEW RoomManager("final_quest");
actual_map = Maps::FINAL_QUEST;
App->menu_manager->EnableHUD(true);
return true;
break;
case Maps::DEBUG:
Expand Down
51 changes: 27 additions & 24 deletions Final_Fantasy_Mystery_World/m1MenuManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,37 +777,40 @@ void m1MenuManager::CreateShopMenu()
}

void m1MenuManager::EnableHUD(bool show_or_hide) {
if ((show_or_hide && App->map->actual_map != Maps::LOBBY && App->map->actual_map != Maps::HOME && App->map->actual_map != Maps::SHOP) || !show_or_hide && hud.bg_hud != nullptr) {
hud.bg_hud->drawable = show_or_hide;
hud.player_hud_image->drawable = show_or_hide;
hud.player_hp_bar->drawable = show_or_hide;
hud.player_mana_bar->drawable = show_or_hide;
hud.diagonal_compass->drawable = show_or_hide;
hud.vertical_compass->drawable = show_or_hide;
hud.player_hp_bar->bar_numbers_label->drawable = show_or_hide;
hud.player_mana_bar->bar_numbers_label->drawable = show_or_hide;
hud.player_exp_bar->drawable = show_or_hide;

// It is ugly but for now works
if (show_or_hide == true)
{
hud.player_exp_bar->empty_bar->drawable = true;
if (hud.bg_hud != nullptr) {
if ((show_or_hide && App->map->actual_map != Maps::LOBBY && App->map->actual_map != Maps::HOME && App->map->actual_map != Maps::SHOP) || !show_or_hide && hud.bg_hud != nullptr) {
hud.bg_hud->drawable = show_or_hide;
hud.player_hud_image->drawable = show_or_hide;
hud.player_hp_bar->drawable = show_or_hide;
hud.player_mana_bar->drawable = show_or_hide;
hud.diagonal_compass->drawable = show_or_hide;
hud.vertical_compass->drawable = show_or_hide;
hud.player_hp_bar->bar_numbers_label->drawable = show_or_hide;
hud.player_mana_bar->bar_numbers_label->drawable = show_or_hide;
hud.player_exp_bar->drawable = show_or_hide;

// It is ugly but for now works
if (show_or_hide == true)
{
hud.player_exp_bar->empty_bar->drawable = true;

if (hud.player_exp_bar->got_xp)
hud.player_exp_bar->filled_bar->drawable = true;

else
hud.player_exp_bar->filled_bar->drawable = false;
}

if (hud.player_exp_bar->got_xp)
hud.player_exp_bar->filled_bar->drawable = true;

else
{
hud.player_exp_bar->empty_bar->drawable = false;
hud.player_exp_bar->filled_bar->drawable = false;
}
}


else
{
hud.player_exp_bar->empty_bar->drawable = false;
hud.player_exp_bar->filled_bar->drawable = false;
}

}

}

void m1MenuManager::DestroyShopMenu()
Expand Down
1 change: 1 addition & 0 deletions Final_Fantasy_Mystery_World/m1Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ bool m1Scene::Update(float dt)

if (App->input->GetKey(SDL_SCANCODE_6) == KEY_DOWN) {
App->fade_to_black->FadeToBlack(Maps::LOBBY);
App->menu_manager->EnableHUD(false);
}

if (App->input->GetKey(SDL_SCANCODE_7) == KEY_DOWN) {
Expand Down

0 comments on commit f1dc56e

Please sign in to comment.