Added icons to the main menu, looks much better!

This commit is contained in:
Yair Morgenstern 2020-04-21 14:18:38 +03:00
parent 4c3b9e0c14
commit 5aae57d848
10 changed files with 1301 additions and 1265 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 885 KiB

After

Width:  |  Height:  |  Size: 873 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 KiB

After

Width:  |  Height:  |  Size: 454 KiB

View File

@ -19,10 +19,11 @@ import com.unciv.ui.utils.*
class MenuScreen: CameraStageBaseScreen() {
val autosave = "Autosave"
private fun getTableBlock(text: String, function: () -> Unit): Table {
val table = Table()
private fun getTableBlock(text: String, icon: String, function: () -> Unit): Table {
val table = Table().pad(30f)
table.background = ImageGetter.getBackground(colorFromRGB(11, 135, 133))
table.add(text.toLabel().setFontSize(30).apply { setAlignment(Align.center) }).pad(40f).width(200f)
table.add(ImageGetter.getImage(icon)).size(50f).padRight(30f)
table.add(text.toLabel().setFontSize(30).apply { /* setAlignment(Align.center) */ }).width(200f)
table.touchable= Touchable.enabled
table.onClick(function)
table.pack()
@ -33,25 +34,25 @@ class MenuScreen: CameraStageBaseScreen() {
val table = Table().apply { defaults().pad(10f) }
val autosaveGame = GameSaver.getSave(autosave, false)
if (autosaveGame.exists()) {
val resumeTable = getTableBlock("Resume") { autoLoadGame() }
val resumeTable = getTableBlock("Resume","OtherIcons/Resume") { autoLoadGame() }
table.add(resumeTable).row()
}
val quickstartTable = getTableBlock("Quickstart") { startNewGame() }
val quickstartTable = getTableBlock("Quickstart","OtherIcons/Quickstart") { startNewGame() }
table.add(quickstartTable).row()
val newGameButton = getTableBlock("Start new game") { game.setScreen(NewGameScreen(this)) }
val newGameButton = getTableBlock("Start new game","OtherIcons/New") { game.setScreen(NewGameScreen(this)) }
table.add(newGameButton).row()
if (GameSaver.getSaves(false).any()) {
val loadGameTable = getTableBlock("Load game") { game.setScreen(LoadGameScreen(this)) }
val loadGameTable = getTableBlock("Load game","OtherIcons/Load") { game.setScreen(LoadGameScreen(this)) }
table.add(loadGameTable).row()
}
val multiplayerTable = getTableBlock("Multiplayer") { game.setScreen(MultiplayerScreen(this)) }
val multiplayerTable = getTableBlock("Multiplayer","OtherIcons/Multiplayer") { game.setScreen(MultiplayerScreen(this)) }
table.add(multiplayerTable).row()
val mapEditorScreenTable = getTableBlock("Map editor") { openMapEditorPopup() }
val mapEditorScreenTable = getTableBlock("Map editor","OtherIcons/MapEditor") { openMapEditorPopup() }
table.add(mapEditorScreenTable)