Merge remote-tracking branch 'origin/master'
This commit is contained in:
@ -9,13 +9,15 @@ public class HorizontalProgressBar extends ObjectGl {
|
||||
private float max;
|
||||
private float current;
|
||||
private int leftToRight;
|
||||
private boolean useHeight;
|
||||
|
||||
public HorizontalProgressBar(float z, float w, float h, float size, float current, float max, boolean leftToRight) {
|
||||
super(z, w, h, size, null, new Vector3f(0f, 1f, 0f));
|
||||
this.max = max;
|
||||
this.current = current;
|
||||
this.leftToRight = leftToRight ? 1 : 0;
|
||||
this.setShader("shaders/StylishShaders/BasicNoTexVert.glsl", "shaders/StylishShaders/HorizontalProgressBar.glsl");
|
||||
this.useHeight = false;
|
||||
this.setShader("shaders/StylishShaders/BasicNoTexVert.glsl", "shaders/StylishShaders/HorizontalProgressBarFrag.glsl");
|
||||
}
|
||||
|
||||
public void setCurrent(float newCurrent) {
|
||||
@ -26,6 +28,10 @@ public class HorizontalProgressBar extends ObjectGl {
|
||||
this.max = newMax;
|
||||
}
|
||||
|
||||
public void setUseHeight(boolean b){
|
||||
this.useHeight = b;
|
||||
}
|
||||
|
||||
protected void uniformInjection() {
|
||||
if (this.useTime) this.shader.setUniform1f("time", (float) glfwGetTime());
|
||||
|
||||
@ -35,6 +41,10 @@ public class HorizontalProgressBar extends ObjectGl {
|
||||
this.shader.setUniform1f("fill", Math.abs(((this.current / this.max) * this.getWidth()) - this.getWidth()));
|
||||
}
|
||||
|
||||
if (this.useHeight) {
|
||||
this.shader.setUniform1f("height", this.height);
|
||||
}
|
||||
|
||||
this.shader.setUniform1i("leftToRight", this.leftToRight);
|
||||
|
||||
this.shader.setUniformMat4f("projection", projection);
|
||||
|
@ -190,7 +190,8 @@ public class match {
|
||||
engine.add_uiElement(coordP2);
|
||||
// Barre de vie
|
||||
healthBarP1Obj = new HorizontalProgressBar(80f, 8.5f, 0.4f, 100f, p1.getCurrentHP(), p1.getMaxHP(), false);
|
||||
healthBarP1Obj.setColorVerticalGradient(new Vector3f(39f/255f, 201f/255f, 30f/255f), new Vector3f(19f/255f, 89f/255f, 15f/255f));
|
||||
healthBarP1Obj.setShader("shaders/StylishShaders/BasicNoTexVert.glsl", "shaders/StylishShaders/HorizontalProgressBarGradientSquareFrag.glsl");
|
||||
healthBarP1Obj.setUseHeight(true);
|
||||
healthBarP1 = new UIElement(healthBarP1Obj, 0.0138f, 0.980f, engine);
|
||||
healthBarP2Obj = new HorizontalProgressBar(80f, 8.5f, 0.4f, 100f, p2.getCurrentHP(), p2.getMaxHP(), true);
|
||||
healthBarP2Obj.setColorVerticalGradient(new Vector3f(39f/255f, 201f/255f, 30f/255f), new Vector3f(19f/255f, 89f/255f, 15f/255f));
|
||||
@ -249,7 +250,7 @@ public class match {
|
||||
//end round
|
||||
case 11:
|
||||
endRound();
|
||||
if(roundsWonP1 >= 2||roundsWonP2 >= 2) { endMatch();} //TODO : will probably need to specify more
|
||||
if(roundsWonP1 >= 2 || roundsWonP2 >= 2) { endMatch();} //TODO : will probably need to specify more
|
||||
else{acCode = 0;}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user