use of de.gg.game.session.GameSession in project ProjektGG by eskalon.
the class GameMapScreen method setUIValues.
@Override
protected void setUIValues() {
GameSession session = application.getClient().getSession();
World world = session.getWorld();
Player player = application.getClient().getLocalPlayer();
if (pushParams != null) {
// Is a new game
gameRenderer.resetCamera();
selectionInputController.setWorld(world);
gameSpeedInputProcessor.setClientActionHandler(application.getClient().getActionHandler());
iconButton.getStyle().imageUp = skin.getDrawable(player.getIcon().getShieldDrawableName());
}
selectionInputController.resetSelection();
movementInputController.resetInput();
dateLabel.setText(Lang.get("screen.map.time", GameClock.getSeason(session.getCurrentRound()), GameClock.getYear(session.getCurrentRound())));
}
use of de.gg.game.session.GameSession in project ProjektGG by eskalon.
the class GameLoadingScreen method onFinishedLoading.
@Override
protected void onFinishedLoading() {
GameSession session = ((ProjektGGApplication) application).getClient().getSession();
World world = session.getWorld();
// Create the ModelInstances
for (BuildingSlot s : world.getBuildingSlots()) {
if (s.isBuiltOn()) {
s.getBuilding().setRenderData(new SelectableRenderData(application.getAssetManager().get(s.getBuilding().getType().getModelPath(), Model.class)));
// FIXME siehe AuthoritativeSession#init(...)
s.getBuilding().getRenderData().transform.translate(s.getPosX(), 0, s.getPosZ());
s.getBuilding().getRenderData().transform.rotate(Y_AXIS, s.getRotationToStreet());
// TODO Use _one_ scene for all models?
// new SelectableRenderData(scene,
// building1.getType().getNodeName(), true);
}
}
Model skyboxModel = application.getAssetManager().get(session.getSessionSetup().getMap().getSkyboxPath(), Model.class);
for (Material m : skyboxModel.materials) {
// fixes a bug related to changes in gdx 1.9.9, see
// https://github.com/libgdx/libgdx/issues/5529
m.remove(ColorAttribute.Emissive);
}
world.setSkybox(new ModelInstance(skyboxModel));
Log.info("Client", "Game assets loaded");
if (((ProjektGGApplication) application).isHost()) {
((ProjektGGApplication) application).getServer().startMatch();
Log.info("Server", "Game started!");
}
application.getScreenManager().pushScreen("round_end", "simple_zoom", 1);
}
Aggregations