diff --git a/client/src/main/java/ru/trader/Main.java b/client/src/main/java/ru/trader/Main.java index b144600..b7acdce 100644 --- a/client/src/main/java/ru/trader/Main.java +++ b/client/src/main/java/ru/trader/Main.java @@ -82,7 +82,7 @@ public class Main extends Application { private static void loadMainScene() throws IOException { primaryStage.setTitle(Localization.getString("main.title")); - primaryStage.setMinHeight(590); + primaryStage.setMinHeight(500); primaryStage.setScene(new Scene(Screeners.newScreeners(Main.class.getResource("/view/main.fxml"), getUrl("style.css").toExternalForm()))); primaryStage.setOnCloseRequest((we) -> { try { diff --git a/client/src/main/java/ru/trader/controllers/LoginController.java b/client/src/main/java/ru/trader/controllers/LoginController.java index ec38ac7..e6af89d 100644 --- a/client/src/main/java/ru/trader/controllers/LoginController.java +++ b/client/src/main/java/ru/trader/controllers/LoginController.java @@ -34,6 +34,7 @@ public class LoginController { dialog.getDialogPane().getButtonTypes().addAll(loginButtonType, ButtonType.CANCEL); Node loginButton = dialog.getDialogPane().lookupButton(loginButtonType); loginButton.setDisable(true); + email.setText(Main.SETTINGS.edce().getEmail()); email.textProperty().addListener((observable, oldValue, newValue) -> { loginButton.setDisable(newValue.trim().isEmpty()); Main.SETTINGS.edce().setEmail(newValue); @@ -54,7 +55,7 @@ public class LoginController { if (dialog == null){ createDialog(parent, content); } - Platform.runLater(email::requestFocus); + Platform.runLater(password::requestFocus); Optional> result = dialog.showAndWait(); clear(); return result; diff --git a/client/src/main/java/ru/trader/controllers/MainController.java b/client/src/main/java/ru/trader/controllers/MainController.java index 18d5bda..2e2b504 100644 --- a/client/src/main/java/ru/trader/controllers/MainController.java +++ b/client/src/main/java/ru/trader/controllers/MainController.java @@ -3,9 +3,7 @@ package ru.trader.controllers; import javafx.event.ActionEvent; import javafx.fxml.FXML; -import javafx.scene.control.Menu; -import javafx.scene.control.RadioMenuItem; -import javafx.scene.control.ToggleGroup; +import javafx.scene.control.*; import javafx.scene.layout.BorderPane; import javafx.stage.FileChooser; import org.controlsfx.control.action.Action; @@ -51,6 +49,10 @@ public class MainController { private ItemsController itemsController; @FXML private RouterController routerController; + @FXML + private TabPane tabs; + @FXML + private Tab track; @FXML private void initialize() { @@ -75,7 +77,7 @@ public class MainController { } } catch (IOException e) { LOG.error("Error on change locale to {}", n.getUserData()); - LOG.error("",e); + LOG.error("", e); } }); } @@ -318,4 +320,8 @@ public class MainController { market = world; Screeners.reinitAll(); } + + public void showTrack(){ + tabs.getSelectionModel().select(track); + } } diff --git a/client/src/main/java/ru/trader/controllers/MissionsController.java b/client/src/main/java/ru/trader/controllers/MissionsController.java index 64df6ab..085b89a 100644 --- a/client/src/main/java/ru/trader/controllers/MissionsController.java +++ b/client/src/main/java/ru/trader/controllers/MissionsController.java @@ -1,12 +1,12 @@ package ru.trader.controllers; -import javafx.beans.binding.Bindings; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; -import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.control.TextField; +import javafx.scene.control.ToggleButton; +import javafx.scene.control.ToggleGroup; import ru.trader.model.*; import ru.trader.view.support.NumberField; import ru.trader.view.support.autocomplete.AutoCompletion; @@ -17,109 +17,116 @@ import ru.trader.view.support.autocomplete.StationsProvider; public class MissionsController { @FXML - private TextField receiverText; - private AutoCompletion receiver; + private TextField starportText; + private AutoCompletion starport; @FXML - private NumberField courierProfit; + private ComboBox cargo; @FXML - private Button addCourierBtn; + private NumberField quantity; + @FXML + private NumberField reward; + @FXML + private ToggleButton courierBtn; + @FXML + private ToggleButton deliveryBtn; + @FXML + private ToggleButton supplyBtn; - @FXML - private TextField buyerText; - private AutoCompletion buyer; - @FXML - private NumberField deliveryCount; - @FXML - private NumberField deliveryProfit; - @FXML - private Button addDeliveryBtn; - - @FXML - private ComboBox item; - @FXML - private NumberField supplyCount; - @FXML - private NumberField supplyProfit; - @FXML - private Button addSupplyBtn; + private enum MISSION_TYPE {COURIER, DELIVERY, SUPPLY} + private final ToggleGroup missionTypeGroup; private final ObservableList missions; private StationModel station; + private MISSION_TYPE missionType; public MissionsController() { + missionTypeGroup = new ToggleGroup(); missions = FXCollections.observableArrayList(); } @FXML private void initialize(){ + missionTypeGroup.selectedToggleProperty().addListener((ov, o, n) ->{ + if (courierBtn.equals(n)){ + missionType = MISSION_TYPE.COURIER; + starportText.setDisable(false); + cargo.setDisable(true); + quantity.setDisable(true); + reward.setDisable(false); + } else + if (deliveryBtn.equals(n)){ + missionType = MISSION_TYPE.DELIVERY; + starportText.setDisable(false); + cargo.setDisable(true); + quantity.setDisable(false); + reward.setDisable(false); + } else + if (supplyBtn.equals(n)){ + missionType = MISSION_TYPE.SUPPLY; + if (station != null) { + starport.setValue(station); + } + starportText.setDisable(false); + cargo.setDisable(false); + quantity.setDisable(false); + reward.setDisable(false); + } else { + missionType = null; + starportText.setDisable(true); + cargo.setDisable(true); + quantity.setDisable(true); + reward.setDisable(true); + } + }); + courierBtn.setToggleGroup(missionTypeGroup); + deliveryBtn.setToggleGroup(missionTypeGroup); + supplyBtn.setToggleGroup(missionTypeGroup); init(); - addCourierBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> receiver.getValue() == null, receiver.valueProperty()) - .or(courierProfit.wrongProperty()) - ); - addDeliveryBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> buyer.getValue() == null, buyer.valueProperty()) - .or(deliveryCount.wrongProperty()) - .or(deliveryProfit.wrongProperty()) - ); - addSupplyBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> item.getValue() == null, item.valueProperty()) - .or(supplyCount.wrongProperty()) - .or(supplyProfit.wrongProperty()) - ); } void init(){ MarketModel world = MainController.getWorld(); - item.setItems(world.itemsProperty()); + cargo.setItems(world.itemsProperty()); StationsProvider provider = new StationsProvider(world); - if (receiver == null){ - receiver = new AutoCompletion<>(receiverText, new CachedSuggestionProvider<>(provider), ModelFabric.NONE_STATION, provider.getConverter()); + if (starport == null){ + starport = new AutoCompletion<>(starportText, new CachedSuggestionProvider<>(provider), ModelFabric.NONE_STATION, provider.getConverter()); } else { - receiver.setSuggestions(provider.getPossibleSuggestions()); - receiver.setConverter(provider.getConverter()); - } - if (buyer == null){ - buyer = new AutoCompletion<>(buyerText, new CachedSuggestionProvider<>(provider), ModelFabric.NONE_STATION, provider.getConverter()); - } else { - buyer.setSuggestions(provider.getPossibleSuggestions()); - buyer.setConverter(provider.getConverter()); + starport.setSuggestions(provider.getPossibleSuggestions()); + starport.setConverter(provider.getConverter()); } } void setStations(ObservableList stationNames) { - receiver.setSuggestions(stationNames); - buyer.setSuggestions(stationNames); + starport.setSuggestions(stationNames); } void setItems(ObservableList items){ - item.setItems(items); + cargo.setItems(items); } - @FXML - private void addCourier(){ - StationModel station = receiver.getValue(); - double profit = courierProfit.getValue().doubleValue(); + public void add(){ + StationModel station = starport.getValue(); + ItemModel item = cargo.getValue(); + long count = quantity.getValue().longValue(); + double profit = reward.getValue().doubleValue(); if (station != null && profit > 0){ - missions.add(new MissionModel(station, profit)); + switch (missionType){ + case COURIER: missions.add(new MissionModel(station, profit)); + break; + case DELIVERY: if (count > 0) missions.add(new MissionModel(station, count, profit)); + break; + case SUPPLY: if (item != null && count > 0) missions.add(new MissionModel(station, item, count, profit)); + break; + } } } - @FXML - private void addDelivery(){ - StationModel station = buyer.getValue(); - long count = deliveryCount.getValue().longValue(); - double profit = deliveryProfit.getValue().doubleValue(); - if (station != null && profit > 0){ - missions.add(new MissionModel(station, count, profit)); - } + public void remove(int index){ + missions.remove(index); } - @FXML - private void addSupply(){ - ItemModel item = this.item.getValue(); - long count = supplyCount.getValue().longValue(); - double profit = supplyProfit.getValue().doubleValue(); - if (station != null && item != null && profit > 0){ - missions.add(new MissionModel(station, item, count, profit)); - } + public void clear(){ + missions.clear(); } public ObservableList getMissions() { diff --git a/client/src/main/java/ru/trader/controllers/OffersController.java b/client/src/main/java/ru/trader/controllers/OffersController.java index 5c4cd7b..b52f96b 100644 --- a/client/src/main/java/ru/trader/controllers/OffersController.java +++ b/client/src/main/java/ru/trader/controllers/OffersController.java @@ -3,10 +3,8 @@ package ru.trader.controllers; import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.fxml.FXML; -import javafx.geometry.Insets; import javafx.scene.control.*; import javafx.scene.input.MouseButton; -import org.controlsfx.control.SegmentedButton; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ru.trader.core.SERVICE_TYPE; @@ -28,13 +26,11 @@ public class OffersController { private StationModel station; - @FXML - private Insets stationsMargin; @FXML private TextField systemText; private AutoCompletion system; @FXML - private SegmentedButton stationsBar; + private ListView stationsList; @FXML private TableView tblSell; @FXML @@ -63,12 +59,12 @@ public class OffersController { private CheckBox cbMediumLandpad; @FXML private CheckBox cbLargeLandpad; + @FXML + private TitledPane stationPane; private final List sells = FXCollections.observableArrayList(); private final List buys = FXCollections.observableArrayList(); - private final static ToggleGroup stationsGrp = new ToggleGroup(); - // инициализируем форму данными @FXML private void initialize() { @@ -77,14 +73,13 @@ public class OffersController { LOG.info("Change system to {}", newValue); fillDetails(newValue); }); - stationsGrp.selectedToggleProperty().addListener((v, o, n) -> { - if (n != null){ - fillTables((StationModel) n.getUserData()); + stationsList.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> { + if (n != null) { + fillTables(n); } else { fillTables(ModelFabric.NONE_STATION); } }); - stationsBar.setToggleGroup(stationsGrp); tblSell.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> { if (n != null) Screeners.changeItemDesc(n.getItem()); @@ -122,27 +117,21 @@ public class OffersController { private void fillDetails(SystemModel system){ if (ModelFabric.isFake(system)) return; - stationsBar.getButtons().clear(); List stations = system.getStations(); - stations.forEach(s -> stationsBar.getButtons().add(buildStationNode(s))); + stationsList.setItems(FXCollections.observableList(stations)); if (!stations.isEmpty()){ - stationsBar.getButtons().get(0).setSelected(true); + stationsList.getSelectionModel().selectFirst(); } else { fillTables(ModelFabric.NONE_STATION); } } - private ToggleButton buildStationNode(StationModel station){ - ToggleButton stationBtn = new ToggleButton(station.getName()); - stationBtn.setUserData(station); - return stationBtn; - } - private void fillTables(StationModel station){ LOG.info("Change station to {}", station); this.station = station; sells.clear(); buys.clear(); + stationPane.setText(station.getName()); distance.setText(""); government.setText(""); faction.setText(""); @@ -253,7 +242,9 @@ public class OffersController { @Override public void add(StationModel station) { ViewUtils.doFX(() -> { - stationsBar.getButtons().add(buildStationNode(station)); + if (station.getSystem().equals(system.getValue())) { + stationsList.getItems().add(station); + } refresh(); sort(); }); @@ -269,8 +260,9 @@ public class OffersController { @Override public void remove(StationModel station) { ViewUtils.doFX(() -> { - stationsBar.getToggleGroup().getSelectedToggle().setSelected(false); - stationsBar.getButtons().removeIf(b -> b.getUserData().equals(station)); + if (station.getSystem().equals(system.getValue())) { + stationsList.getItems().remove(station); + } refresh(); sort(); }); diff --git a/client/src/main/java/ru/trader/controllers/RouteSearchController.java b/client/src/main/java/ru/trader/controllers/RouteSearchController.java index 92e20ab..6c10a3c 100644 --- a/client/src/main/java/ru/trader/controllers/RouteSearchController.java +++ b/client/src/main/java/ru/trader/controllers/RouteSearchController.java @@ -67,15 +67,15 @@ public class RouteSearchController { fromStation.setItems(n.getStationNamesList()); fromStation.getSelectionModel().selectFirst(); }); - fromStation.valueProperty().addListener((ov, o , n) -> { + fromStation.valueProperty().addListener((ov, o, n) -> { SystemModel system = fromSystem.getValue(); - if (system == null || n == null){ + if (system == null || n == null) { missionsController.setStation(ModelFabric.NONE_STATION); } else { missionsController.setStation(system.get(n)); } }); - toSystem.valueProperty().addListener((ov, o , n) -> { + toSystem.valueProperty().addListener((ov, o, n) -> { toStation.setItems(n.getStationNamesList()); toStation.getSelectionModel().selectFirst(); }); @@ -105,20 +105,44 @@ public class RouteSearchController { missionsList.getItems().forEach(m -> m.toSpecification(specificator)); market.getRoutes(f, fS, t, tS, profile.getBalance(), specificator, routes -> { Optional path = Screeners.showRouters(routes); - if (path.isPresent()){ + if (path.isPresent()) { RouteModel route = path.get(); route.addAll(0, missionsList.getItems()); profile.setRoute(route); + Screeners.showTrackTab(); } }); } + @FXML + private void searchTop(){ + market.getTopRoutes(profile.getBalance(), routes -> { + Optional path = Screeners.showRouters(routes); + if (path.isPresent()) { + RouteModel route = path.get(); + profile.setRoute(route); + Screeners.showTrackTab(); + } + }); + } + + + @FXML + private void addMission(){ + missionsController.add(); + } + @FXML private void removeMission(){ int index = missionsList.getSelectionModel().getSelectedIndex(); if (index >= 0){ - missionsList.getItems().remove(index); + missionsController.remove(index); } + } + + @FXML + private void clearMissions(){ + missionsController.clear(); } } diff --git a/client/src/main/java/ru/trader/controllers/RouteTrackController.java b/client/src/main/java/ru/trader/controllers/RouteTrackController.java index a82ebe5..cf37b05 100644 --- a/client/src/main/java/ru/trader/controllers/RouteTrackController.java +++ b/client/src/main/java/ru/trader/controllers/RouteTrackController.java @@ -6,7 +6,8 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.Node; -import javafx.scene.control.*; +import javafx.scene.control.Label; +import javafx.scene.control.ListView; import javafx.scene.layout.Pane; import ru.trader.model.*; import ru.trader.model.support.BindingsHelper; @@ -52,11 +53,21 @@ public class RouteTrackController { @FXML private void initialize(){ - MainController.getProfile().routeProperty().addListener(routeListener); addMissionsList.setItems(missionsController.getMissions()); buyOrders.setCellFactory(new OrderListCell(false)); sellOrders.setCellFactory(new OrderListCell(true)); editGroup.setVisible(false); + init(); + } + + void init(){ + ProfileModel profile = MainController.getProfile(); + profile.routeProperty().addListener(routeListener); + setRoute(profile.getRoute()); + } + + void unbind(){ + MainController.getProfile().routeProperty().removeListener(routeListener); } public void setRoute(RouteModel route){ @@ -65,38 +76,64 @@ public class RouteTrackController { } this.route = route; fillTrack(); - setIndex(route.getCurrentEntry()); - this.route.currentEntryProperty().addListener(currentEntryListener); + if (route != null) { + setIndex(route.getCurrentEntry()); + this.route.currentEntryProperty().addListener(currentEntryListener); + } else { + setIndex(-1); + } } public void setIndex(int index){ - trackNode.setActive(index); + if (index != -1) { + trackNode.setActive(index); + } else { + update(); + } } private void fillTrack(){ if (trackNode != null) trackNode.activeProperty().removeListener(activeEntryListener); - trackNode = new Track(route); - track.getChildren().setAll(trackNode.getNode()); - trackNode.activeProperty().addListener(activeEntryListener); + if (route != null) { + trackNode = new Track(route); + track.getChildren().setAll(trackNode.getNode()); + trackNode.activeProperty().addListener(activeEntryListener); + } else { + trackNode = null; + track.getChildren().clear(); + } } private void update(){ - int index = trackNode.getActive(); - if (index == -1) return; - RouteEntryModel entry = route.get(index); - missionsController.setStation(entry.getStation()); - ObservableList stations = BindingsHelper.observableList(route.getStations(index), StationModel::getFullName); - missionsController.setStations(stations); - ObservableList items = FXCollections.observableList(route.getSellOffers(index).stream().map(OfferModel::getItem).collect(Collectors.toList())); - missionsController.setItems(items); + int index = trackNode != null ? trackNode.getActive() : -1; + if (index != -1) { + RouteEntryModel entry = route.get(index); + missionsController.setStation(entry.getStation()); + ObservableList stations = BindingsHelper.observableList(route.getStations(index), StationModel::getFullName); + missionsController.setStations(stations); + ObservableList items = FXCollections.observableList(route.getSellOffers(index).stream().map(OfferModel::getItem).collect(Collectors.toList())); + missionsController.setItems(items); - station.setText(entry.getStation().getName()); - system.setText(entry.getStation().getSystem().getName()); - time.setText(ViewUtils.timeToString(entry.getTime())); - refuel.setText(String.valueOf(entry.getRefill())); - buyOrders.setItems(entry.orders()); - sellOrders.setItems(entry.sellOrders()); - missionsList.setItems(entry.missions()); + station.setText(entry.getStation().getName()); + system.setText(entry.getStation().getSystem().getName()); + time.setText(ViewUtils.timeToString(entry.getTime())); + refuel.setText(String.valueOf(entry.getRefill())); + buyOrders.setItems(entry.orders()); + sellOrders.setItems(entry.sellOrders()); + missionsList.setItems(entry.missions()); + } else { + missionsController.setStation(ModelFabric.NONE_STATION); + missionsController.setStations(FXCollections.emptyObservableList()); + missionsController.setItems(FXCollections.emptyObservableList()); + + station.setText(""); + system.setText(""); + time.setText(""); + refuel.setText(""); + buyOrders.setItems(FXCollections.emptyObservableList()); + sellOrders.setItems(FXCollections.emptyObservableList()); + missionsList.setItems(FXCollections.emptyObservableList()); + } } @FXML @@ -111,25 +148,33 @@ public class RouteTrackController { } @FXML - private void addMissions(){ - int startIndex = route.isLoop() ? 0 : trackNode.getActive(); - route.addAll(startIndex, missionsList.getItems()); + private void addMissionsToTrack(){ + int startIndex = trackNode.getActive(); + route.addAll(startIndex, addMissionsList.getItems()); + } + + + @FXML + private void addMission(){ + missionsController.add(); } @FXML private void removeMission(){ - int index = missionsList.getSelectionModel().getSelectedIndex(); + int index = addMissionsList.getSelectionModel().getSelectedIndex(); if (index >= 0){ - missionsList.getItems().remove(index); + missionsController.remove(index); } } + @FXML + private void clearMissions(){ + missionsController.clear(); + + } + private final ChangeListener currentEntryListener = (ov, o, n) -> ViewUtils.doFX(() -> setIndex(n.intValue())); private final InvalidationListener activeEntryListener = ov -> ViewUtils.doFX(this::update); - private final ChangeListener routeListener = (ov, o, n) -> { - if (n != null){ - ViewUtils.doFX(() -> setRoute(n)); - } - }; + private final ChangeListener routeListener = (ov, o, n) -> ViewUtils.doFX(() -> setRoute(n)); } diff --git a/client/src/main/java/ru/trader/controllers/Screeners.java b/client/src/main/java/ru/trader/controllers/Screeners.java index 65a6e42..1f8b56c 100644 --- a/client/src/main/java/ru/trader/controllers/Screeners.java +++ b/client/src/main/java/ru/trader/controllers/Screeners.java @@ -264,4 +264,8 @@ public class Screeners { filterController.init(); EMDNUpdater.setMarket(MainController.getMarket()); } + + public static void showTrackTab(){ + mainController.showTrack(); + } } diff --git a/client/src/main/java/ru/trader/controllers/SettingsController.java b/client/src/main/java/ru/trader/controllers/SettingsController.java index b7315f4..9843114 100644 --- a/client/src/main/java/ru/trader/controllers/SettingsController.java +++ b/client/src/main/java/ru/trader/controllers/SettingsController.java @@ -1,12 +1,13 @@ package ru.trader.controllers; +import javafx.collections.FXCollections; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.control.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import ru.trader.EMDNUpdater; import ru.trader.Main; +import ru.trader.core.Profile; import ru.trader.view.support.Localization; import ru.trader.view.support.NumberField; @@ -22,24 +23,60 @@ public class SettingsController { private CheckBox emdnUpdateOnly; @FXML private NumberField emdnUpdateTime; + @FXML - private NumberField segmentSize; + private NumberField jumps; @FXML - private NumberField pathsCount; + private NumberField lands; + @FXML + private NumberField routesCount; + @FXML + private NumberField fuelPrice; + @FXML + private ComboBox pathPriority; + @FXML + private NumberField jumpTime; + @FXML + private NumberField landingTime; + @FXML + private NumberField takeoffTime; + @FXML + private NumberField rechargeTime; + + @FXML + private CheckBox edceActive; + @FXML + private NumberField edceInterval; private Dialog dlg; @FXML private void initialize(){ + pathPriority.setItems(FXCollections.observableArrayList(Profile.PATH_PRIORITY.values())); init(); } private void init(){ +/* emdnSubServ.setText(Main.SETTINGS.getEMDNSub()); emdnOn.setSelected(Main.SETTINGS.getEMDNActive()); emdnUpdateOnly.setSelected(Main.SETTINGS.getEMDNUpdateOnly()); emdnUpdateTime.setValue(Main.SETTINGS.getEMDNAutoUpdate()); - pathsCount.setValue(Main.SETTINGS.getRoutesCount()); +*/ + + Profile profile =Main.SETTINGS.getProfile(); + jumps.setValue(profile.getJumps()); + lands.setValue(profile.getLands()); + routesCount.setValue(profile.getRoutesCount()); + fuelPrice.setValue(profile.getFuelPrice()); + pathPriority.setValue(profile.getPathPriority()); + jumpTime.setValue(profile.getJumpTime()); + landingTime.setValue(profile.getLandingTime()); + takeoffTime.setValue(profile.getTakeoffTime()); + rechargeTime.setValue(profile.getRechargeTime()); + + edceActive.setSelected(Main.SETTINGS.edce().isActive()); + edceInterval.setValue(Main.SETTINGS.edce().getInterval()); } private void createDialog(Parent owner, Parent content){ @@ -59,6 +96,7 @@ public class SettingsController { } private void save() { +/* Main.SETTINGS.setEMDNSub(emdnSubServ.getText()); EMDNUpdater.setSub(emdnSubServ.getText()); Main.SETTINGS.setEMDNActive(emdnOn.isSelected()); @@ -67,6 +105,21 @@ public class SettingsController { EMDNUpdater.setUpdateOnly(emdnUpdateOnly.isSelected()); Main.SETTINGS.setEMDNAutoUpdate(emdnUpdateTime.getValue().longValue()); EMDNUpdater.setInterval(emdnUpdateTime.getValue().longValue()); +*/ + + Profile profile =Main.SETTINGS.getProfile(); + profile.setJumps(jumps.getValue().intValue()); + profile.setLands(lands.getValue().intValue()); + profile.setRoutesCount(routesCount.getValue().intValue()); + profile.setFuelPrice(fuelPrice.getValue().intValue()); + profile.setPathPriority(pathPriority.getValue()); + profile.setJumpTime(jumpTime.getValue().intValue()); + profile.setLandingTime(landingTime.getValue().intValue()); + profile.setTakeoffTime(takeoffTime.getValue().intValue()); + profile.setRechargeTime(rechargeTime.getValue().intValue()); + + Main.SETTINGS.edce().setActive(edceActive.isSelected()); + Main.SETTINGS.edce().setInterval(edceInterval.getValue().intValue()); } public void showDialog(Parent parent, Parent content){ diff --git a/client/src/main/java/ru/trader/view/support/Track.java b/client/src/main/java/ru/trader/view/support/Track.java index 7b56c7b..9a1f2b9 100644 --- a/client/src/main/java/ru/trader/view/support/Track.java +++ b/client/src/main/java/ru/trader/view/support/Track.java @@ -7,12 +7,12 @@ import javafx.scene.input.MouseButton; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; +import javafx.scene.shape.Circle; import javafx.scene.text.Text; import org.controlsfx.glyphfont.Glyph; import ru.trader.model.RouteEntryModel; import ru.trader.model.RouteModel; import ru.trader.model.StationModel; -import ru.trader.view.support.cells.DistanceCell; import java.util.ArrayList; import java.util.List; @@ -29,7 +29,7 @@ public class Track { private final static String CSS_STATION_TEXT = "route-station-text"; private final RouteModel route; - private final HBox node = new HBox(); + private final VBox node = new VBox(); private final IntegerProperty active; private final List entryNodes; @@ -44,7 +44,7 @@ public class Track { private void build(){ StationModel prev = null; for (RouteEntryModel entry : route.getEntries()) { - if (prev != null){ +/* if (prev != null){ VBox track = new VBox(); VBox.setVgrow(track, Priority.ALWAYS); track.getStyleClass().add(CSS_TRACK); @@ -54,9 +54,11 @@ public class Track { track.getChildren().addAll(t, Glyph.create("FontAwesome|LONG_ARROW_RIGHT")); node.getChildren().addAll(track); - } + }*/ HBox entryNode = new HBox(); - HBox stationNode = new HBox(); + Circle circle = new Circle(5); + entryNode.getChildren().add(circle); + VBox stationNode = new VBox(); VBox icons = new VBox(); VBox.setVgrow(icons, Priority.ALWAYS); diff --git a/client/src/main/resources/images/courier_mission.jpg b/client/src/main/resources/images/courier_mission.jpg new file mode 100644 index 0000000..a8b028f Binary files /dev/null and b/client/src/main/resources/images/courier_mission.jpg differ diff --git a/client/src/main/resources/images/delivering_mission.jpg b/client/src/main/resources/images/delivering_mission.jpg new file mode 100644 index 0000000..8d95fec Binary files /dev/null and b/client/src/main/resources/images/delivering_mission.jpg differ diff --git a/client/src/main/resources/images/transport_mission.jpg b/client/src/main/resources/images/transport_mission.jpg new file mode 100644 index 0000000..7ac796b Binary files /dev/null and b/client/src/main/resources/images/transport_mission.jpg differ diff --git a/client/src/main/resources/lang/locale_en_US.properties b/client/src/main/resources/lang/locale_en_US.properties index b4fa8c4..892eadf 100644 --- a/client/src/main/resources/lang/locale_en_US.properties +++ b/client/src/main/resources/lang/locale_en_US.properties @@ -114,6 +114,8 @@ router.pane.ship.distance=Distance(LY): router.pane.route=Route parameters router.pane.route.from=From: router.pane.route.to=To: +router.pane.route.fast=Fasted +router.button.search=Find router.pane.route.jumps=Jumps: router.button.recompute=Recompute router.button.rebuild=Rebuild @@ -121,6 +123,7 @@ router.button.routes=Routes router.button.top=TOP 100 router.pane.total=Total router.pane.total.profit=Profit: +router.pane.missions=Missions # settings.fxml settings.title=Settings @@ -169,4 +172,10 @@ login.text.password=Password: #verify code dialog verify.title=Check verification code verify.header=The verification code has now been sent to the email address associated with your Elite account. Please enter the code into the box below. -verify.content=Confirmation code: \ No newline at end of file +verify.content=Confirmation code: + +# missions.fxml +missions.label.starport=Starport: +missions.label.cargo=Cargo: +missions.label.quantity=Quantity: +missions.label.reward=Reward: \ No newline at end of file diff --git a/client/src/main/resources/lang/locale_ru_RU.properties b/client/src/main/resources/lang/locale_ru_RU.properties index 54b7a0b..d95ac1a 100644 --- a/client/src/main/resources/lang/locale_ru_RU.properties +++ b/client/src/main/resources/lang/locale_ru_RU.properties @@ -114,6 +114,8 @@ router.pane.ship.distance=\u0414\u0438\u0441\u0442\u0430\u043D\u0446\u0438\u044F router.pane.route=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0430 router.pane.route.from=\u041E\u0442: router.pane.route.to=\u0414\u043E: +router.pane.route.fast=\u0411\u044B\u0441\u0442\u0440\u044B\u0439 +router.button.search=\u041D\u0430\u0439\u0442\u0438 router.pane.route.jumps=\u041F\u0440\u044B\u0436\u043A\u043E\u0432: router.button.recompute=\u041F\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044C router.button.rebuild=\u041F\u0435\u0440\u0435\u0441\u0442\u0440\u043E\u0438\u0442\u044C @@ -121,6 +123,7 @@ router.button.routes=\u041C\u0430\u0440\u0448\u0440\u0443\u0442\u044B router.button.top=TOP 100 router.pane.total=\u0418\u0442\u043E\u0433\u043E router.pane.total.profit=\u041F\u0440\u0438\u0431\u044B\u043B\u044C: +router.pane.missions=\u041C\u0438\u0441\u0441\u0438\u0438 # settings.fxml settings.title=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B @@ -170,4 +173,10 @@ login.text.password=\u041F\u0430\u0440\u043E\u043B\u044C: #verify code dialog verify.title=\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u043A\u043E\u0434\u0430 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438 verify.header=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 Frontier \u043D\u0430 \u0432\u0430\u0448\u0443 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0443\u044E \u043F\u043E\u0447\u0442\u0443 -verify.content=\u041A\u043E\u0434 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438: \ No newline at end of file +verify.content=\u041A\u043E\u0434 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438: + +# missions.fxml +missions.label.starport=\u041A\u043E\u0441\u043C\u043E\u043F\u043E\u0440\u0442: +missions.label.cargo=\u0413\u0440\u0443\u0437: +missions.label.quantity=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E: +missions.label.reward=\u041D\u0430\u0433\u0440\u0430\u0434\u0430: \ No newline at end of file diff --git a/client/src/main/resources/view/main.fxml b/client/src/main/resources/view/main.fxml index 2324703..cd95c15 100644 --- a/client/src/main/resources/view/main.fxml +++ b/client/src/main/resources/view/main.fxml @@ -1,8 +1,8 @@ - - + +
- + @@ -56,15 +56,12 @@ - + - - - - + diff --git a/client/src/main/resources/view/missions.fxml b/client/src/main/resources/view/missions.fxml index 8166cca..8b04729 100644 --- a/client/src/main/resources/view/missions.fxml +++ b/client/src/main/resources/view/missions.fxml @@ -1,71 +1,47 @@ - + - - - + - - - + + - diff --git a/client/src/main/resources/view/offers.fxml b/client/src/main/resources/view/offers.fxml index 565343b..54b5857 100644 --- a/client/src/main/resources/view/offers.fxml +++ b/client/src/main/resources/view/offers.fxml @@ -4,10 +4,10 @@ - + fx:controller="ru.trader.controllers.OffersController" + prefHeight="500"> @@ -17,14 +17,15 @@ - - - - - - - - + + + + + + + + + - + diff --git a/client/src/main/resources/view/profile.fxml b/client/src/main/resources/view/profile.fxml index 5682890..7d73811 100644 --- a/client/src/main/resources/view/profile.fxml +++ b/client/src/main/resources/view/profile.fxml @@ -11,19 +11,23 @@ diff --git a/client/src/main/resources/view/routeTrack.fxml b/client/src/main/resources/view/routeTrack.fxml index 0f68cdb..6cc4cc9 100644 --- a/client/src/main/resources/view/routeTrack.fxml +++ b/client/src/main/resources/view/routeTrack.fxml @@ -1,16 +1,13 @@ + - - - - - - + @@ -19,8 +16,12 @@ - - + + + +