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

Indicators #7

Open
BlueSky-fur opened this issue Jul 2, 2021 · 2 comments
Open

Indicators #7

BlueSky-fur opened this issue Jul 2, 2021 · 2 comments

Comments

@BlueSky-fur
Copy link

BlueSky-fur commented Jul 2, 2021

we added code-bits to the script.js

we try to achieve that stuff disappears when full like the armor bar does.

we made it work with the health bar

// Hide Health if 100
  if (data.hp == 100) {
    $("#HealthIndicator").fadeOut();
  } else if (data.hp > 0) {
    $("#HealthIndicator").fadeIn();
  }

we have the same for food/thirst here

// Hide hunger if 100
if (data.hunger == 100) {
  $("#HungerIndicator").fadeOut();
} else if (data.hunger > 0) {
  $("#HungerIndicator").fadeIn();
}

// Hide thirst if 100
if (data.thirst == 100) {
  $("#ThirstIndicator").fadeOut();
} else if (data.thirst > 0) {
  $("#ThirstIndicator").fadeIn();
}

but for Hunger/Thirst it doesnt work for some reason. any idea why?

@BlueSky-fur
Copy link
Author

Is this even an Active Project?

@jaxonfromkh
Copy link

jaxonfromkh commented Jul 15, 2021

use this

// Flash if thirst is low
if (data.thirst < 25) {
$("#ThirstIcon").toggleClass("flash");
} else if (data.thirst > 99) {
$("#ThirstIndicator").fadeOut(1000);
} else if (data.thirst < 99) {
$("#ThirstIndicator").fadeIn(1000);
}

// Flash if hunger is low
if (data.hunger < 25) {
$("#HungerIcon").toggleClass("flash");
} else if (data.hunger > 99) {
$("#HungerIndicator").fadeOut(1000);
} else if (data.hunger < 99) {
$("#HungerIndicator").fadeIn(1000);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants