Add tool tips to build items

This commit is contained in:
Stone_Red
2022-04-07 14:06:01 +02:00
parent 2a107f029e
commit e68366d4a5
2 changed files with 6 additions and 2 deletions
@@ -28,7 +28,7 @@ public class GameManager {
try { try {
EntityRegistry.register(new RegistryEntry("test", "test machine", TestMachine.class)); EntityRegistry.register(new RegistryEntry("test", "test machine", TestMachine.class));
EntityRegistry.register(new RegistryEntry("test2", "test machine", TestMachine2.class)); EntityRegistry.register(new RegistryEntry("test2", "test machine2", TestMachine2.class));
} catch (AlreadyExistsException e) { } catch (AlreadyExistsException e) {
e.printStackTrace(); e.printStackTrace();
} }
+5 -1
View File
@@ -4,6 +4,7 @@ import com.yes.yes.utils.EntityRegistry;
import com.yes.yes.world.Chunk; import com.yes.yes.world.Chunk;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.Tooltip;
import java.util.function.Consumer; import java.util.function.Consumer;
@@ -27,8 +28,11 @@ public class BuildItem extends javafx.scene.layout.StackPane {
ex.printStackTrace(); ex.printStackTrace();
} }
Button button = new Button(); Tooltip tooltip = new Tooltip();
tooltip.setText(display_name);
Button button = new Button();
button.setTooltip(tooltip);
button.setStyle("-fx-background-color: null; -fx-border-color: null"); button.setStyle("-fx-background-color: null; -fx-border-color: null");
button.setPrefSize(Chunk.ENTITY_SIZE, Chunk.ENTITY_SIZE); button.setPrefSize(Chunk.ENTITY_SIZE, Chunk.ENTITY_SIZE);
button.setMinSize(Chunk.ENTITY_SIZE, Chunk.ENTITY_SIZE); button.setMinSize(Chunk.ENTITY_SIZE, Chunk.ENTITY_SIZE);