Skip to content

Commit

Permalink
#308: Code updated with correct argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
DjThunder committed Mar 20, 2022
1 parent 991a729 commit 565e4e3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lionheart-game/src/main/java/com/b3dgs/lionheart/Cheats.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.b3dgs.lionengine.helper.EntityChecker;
import com.b3dgs.lionengine.io.DeviceController;
import com.b3dgs.lionengine.io.DevicePointer;
import com.b3dgs.lionengine.network.Network;
import com.b3dgs.lionheart.constant.Folder;
import com.b3dgs.lionheart.extro.Extro;
import com.b3dgs.lionheart.menu.Menu;
Expand Down Expand Up @@ -255,7 +256,7 @@ private void updateQuit()
{
if (paused)
{
sequencer.end(Menu.class);
sequencer.end(Menu.class, services.get(Network.class));
}
paused = !paused;
hud.setExit(paused);
Expand Down Expand Up @@ -296,6 +297,7 @@ private void onInvincibility()
private void onStage(String stages, int index)
{
sequencer.end(SceneBlack.class,
services.get(Network.class),
Util.getInitConfig(Util.getStage(stages, difficulty, index + 1),
player,
difficulty,
Expand Down Expand Up @@ -441,6 +443,7 @@ private void updateStages()
if (stage.exists())
{
sequencer.end(SceneBlack.class,
services.get(Network.class),
Util.getInitConfig(stage, player, difficulty, cheats, Optional.empty()));
}
}
Expand Down
2 changes: 2 additions & 0 deletions lionheart-game/src/main/java/com/b3dgs/lionheart/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -994,12 +994,14 @@ public void loadNextStage(String next, int delayMs, Optional<Coord> spawn)
tick.addAction(() ->
{
sequencer.end(SceneBlack.class,
services.get(Network.class),
Util.getInitConfig(Medias.create(next), player, difficulty, cheats.isEnabled(), spawn));
}, source.getRate(), delayMs);
}
else
{
sequencer.end(SceneBlack.class,
services.get(Network.class),
Util.getInitConfig(Medias.create(next), player, difficulty, cheats.isEnabled(), spawn));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.b3dgs.lionengine.helper.DeviceControllerConfig;
import com.b3dgs.lionengine.io.DeviceController;
import com.b3dgs.lionengine.io.DevicePointer;
import com.b3dgs.lionengine.network.Network;
import com.b3dgs.lionheart.AppInfo;
import com.b3dgs.lionheart.Constant;
import com.b3dgs.lionheart.DeviceMapping;
Expand Down Expand Up @@ -124,6 +125,7 @@ public class Continue extends Sequence
private final DeviceController deviceCursor;
private final Cursor cursor;
private final DevicePointer pointer;
private final Network network;

/** Screen mask alpha current value. */
private double alpha = 255.0;
Expand All @@ -136,13 +138,15 @@ public class Continue extends Sequence
* Constructor.
*
* @param context The context reference.
* @param network The network reference.
* @param stage The current stage.
* @param init The init config.
*/
public Continue(Context context, Media stage, InitConfig init)
public Continue(Context context, Network network, Media stage, InitConfig init)
{
super(context, Util.getResolution(Constant.RESOLUTION.get2x(), context), Util.getLoop());

this.network = network;
this.stage = stage;
this.init = init;

Expand Down Expand Up @@ -269,6 +273,7 @@ private void updateFadeOut(double extrp)
if (choice == 0)
{
end(Scene.class,
network,
new InitConfig(stage,
init.getHealthMax(),
0,
Expand All @@ -282,7 +287,7 @@ private void updateFadeOut(double extrp)
}
else
{
end(Menu.class);
end(Menu.class, network);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void enter()
if (stats.getCredits() > 0)
{
sequencer.end(Continue.class,
model.getServices().get(Network.class),
new InitConfig(model.getServices().get(Media.class),
stats.getHealthMax(),
stats.getTalisment(),
Expand All @@ -83,7 +84,7 @@ public void enter()
}
else
{
sequencer.end(Menu.class);
sequencer.end(Menu.class, model.getServices().get(Network.class));
}
}
else
Expand Down

0 comments on commit 565e4e3

Please sign in to comment.