Skip to content

Commit

Permalink
Grade Result : modify gauge graph
Browse files Browse the repository at this point in the history
  • Loading branch information
exch-bms2 committed Dec 3, 2016
1 parent 138164e commit bca6da0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/bms/player/beatoraja/result/GradeResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import bms.player.beatoraja.play.gauge.GrooveGauge;
import bms.player.beatoraja.select.MusicSelector;
import bms.player.beatoraja.skin.SkinLoader;
import com.badlogic.gdx.graphics.glutils.FloatFrameBuffer;
import com.badlogic.gdx.math.Rectangle;
import java.util.logging.Logger;

Expand Down Expand Up @@ -66,6 +67,14 @@ public void create() {
SkinLoader sl = new SkinLoader(RESOLUTION[resource.getConfig().getResolution()]);
setSkin(sl.loadResultSkin(Paths.get("skin/default/graderesult.json")));

for(int i = resource.getCourseGauge().size();i < resource.getCourseBMSModels().length;i++) {
List<Float> list = new ArrayList<Float>();
for(int l = 0;l < (resource.getCourseBMSModels()[i].getLastNoteTime() + 500) / 500;l++) {
list.add(0f);
}
resource.getCourseGauge().add(list);
}

updateScoreDatabase();

if (resource.getAutoplay() == 0
Expand All @@ -91,19 +100,6 @@ public void render() {

final MainController main = getMainController();
final PlayerResource resource = getMainController().getPlayerResource();
IRScoreData score = resource.getCourseScoreData();

if (score != null) {
if (score.getClear() > GrooveGauge.CLEARTYPE_FAILED) {
Gdx.gl.glClearColor(0, 0, 0.4f, 1);
} else {
Gdx.gl.glClearColor(0.4f, 0, 0, 1);
}
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

final float w = 1280;
final float h = 720;
}

if (getTimer()[TIMER_FADEOUT] != Long.MIN_VALUE) {
if (time > getTimer()[TIMER_FADEOUT] + getSkin().getFadeout()) {
Expand Down
6 changes: 6 additions & 0 deletions src/bms/player/beatoraja/result/SkinGaugeGraphObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ public void draw(SpriteBatch sprite, long time, MainState state) {
sprite.end();
PlayerResource resource = state.getMainController().getPlayerResource();
List<Float> gauge = resource.getGauge();
List<Integer> section = new ArrayList<Integer>();
if(state instanceof GradeResult) {
gauge = new ArrayList<Float>();
for(List<Float> l : resource.getCourseGauge()) {
gauge.addAll(l);
section.add((section.size() > 0 ? section.get(section.size() - 1) : 0) + l.size());
}
}
// ゲージグラフ描画
Expand Down Expand Up @@ -80,6 +82,10 @@ public void draw(SpriteBatch sprite, long time, MainState state) {

Float f1 = null;
for (int i = 0; i < gauge.size(); i++) {
if(section.contains(i)) {
shape.setColor(Color.valueOf("ffffff"));
shape.line(graph.x + graph.width * (i - 1) / gauge.size(), graph.y, graph.x + graph.width * (i - 1) / gauge.size(), graph.y + graph.height);
}
Float f2 = gauge.get(i);
if (f1 != null) {
if(f1 < border) {
Expand Down

0 comments on commit bca6da0

Please sign in to comment.