mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-24 12:31:32 +00:00
Minor semantic changes, nothing earth-shattering here
This commit is contained in:
parent
cfad4e4bdc
commit
5da472806d
@ -32,7 +32,7 @@ public class PropertyHelper {
|
||||
return new JavaBeanStringPropertyBuilder().bean(t).name(fieldName).build();
|
||||
}
|
||||
|
||||
static private Map<Property, Property> boundProperties = new HashMap<>();
|
||||
private static final Map<Property, Property> boundProperties = new HashMap<>();
|
||||
|
||||
static public void bind(Property formProp, Property sourceProp) {
|
||||
if (boundProperties.containsKey(formProp)) {
|
||||
|
@ -10,7 +10,6 @@ import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.scene.control.ListCell;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.cell.ComboBoxListCell;
|
||||
import org.badvision.outlaweditor.data.PropertyHelper;
|
||||
@ -33,21 +32,7 @@ public abstract class EntitySelectorCell<T> extends ComboBoxListCell<T> {
|
||||
|
||||
@Override
|
||||
public void updateSelected(boolean sel) {
|
||||
// if (sel) {
|
||||
// Object o = lastSelected.get(nameField);
|
||||
// if (o != null && !o.equals(getItem())) {
|
||||
// ((ListCell) o).updateSelected(false);
|
||||
// }
|
||||
// textProperty().unbind();
|
||||
// if (categoryField != null) {
|
||||
// textProperty().bind(Bindings.concat(categoryField.textProperty(), "/", nameField.textProperty()));
|
||||
// } else {
|
||||
// textProperty().bind(Bindings.concat(nameField.textProperty()));
|
||||
// }
|
||||
// lastSelected.put(nameField, this);
|
||||
// } else {
|
||||
updateItem(getItem(), false);
|
||||
// }
|
||||
updateItem(getItem(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,8 +44,8 @@ public abstract class EntitySelectorCell<T> extends ComboBoxListCell<T> {
|
||||
if (categoryField != null) {
|
||||
textProperty().bind(
|
||||
Bindings.concat(
|
||||
PropertyHelper.stringProp(item, "category"),
|
||||
"/",
|
||||
PropertyHelper.stringProp(item, "category"),
|
||||
"/",
|
||||
PropertyHelper.stringProp(item, "name")
|
||||
)
|
||||
);
|
||||
|
@ -4,12 +4,10 @@ import java.util.List;
|
||||
import org.badvision.outlaweditor.ui.EntitySelectorCell;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.control.cell.ComboBoxListCell;
|
||||
import javafx.util.StringConverter;
|
||||
import org.badvision.outlaweditor.Application;
|
||||
import org.badvision.outlaweditor.Editor;
|
||||
|
@ -20,6 +20,7 @@ import static org.badvision.outlaweditor.data.PropertyHelper.stringProp;
|
||||
import org.badvision.outlaweditor.data.TileUtils;
|
||||
import org.badvision.outlaweditor.data.xml.Map;
|
||||
import org.badvision.outlaweditor.data.xml.Script;
|
||||
import org.badvision.outlaweditor.data.xml.Tile;
|
||||
import org.badvision.outlaweditor.ui.EntitySelectorCell;
|
||||
import org.badvision.outlaweditor.ui.MapEditorTabController;
|
||||
import org.badvision.outlaweditor.ui.ToolType;
|
||||
@ -278,12 +279,12 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
||||
@Override
|
||||
public void rebuildTileSelectors() {
|
||||
mapSelectTile.getItems().clear();
|
||||
Application.gameData.getTile().stream().map((t) -> {
|
||||
Application.gameData.getTile().stream().map((Tile t) -> {
|
||||
WritableImage img = TileUtils.getImage(t, currentPlatform);
|
||||
ImageView iv = new ImageView(img);
|
||||
MenuItem mapSelectItem = new MenuItem(String.valueOf(t.getCategory())+"/"+String.valueOf(t.getName()), iv);
|
||||
mapSelectItem.setGraphic(new ImageView(TileUtils.getImage(t, currentPlatform)));
|
||||
mapSelectItem.setOnAction((ActionEvent event) -> {
|
||||
mapSelectItem.setOnAction((event) -> {
|
||||
if (getCurrentEditor() != null) {
|
||||
getCurrentEditor().setCurrentTile(t);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user