Added a repeating baclground to the menu screen

This commit is contained in:
Yair Morgenstern
2020-04-21 23:53:33 +03:00
parent 0321aed309
commit 688b780b14
9 changed files with 3002 additions and 2964 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 873 KiB

After

Width:  |  Height:  |  Size: 889 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

After

Width:  |  Height:  |  Size: 474 KiB

View File

@ -1,3 +1,23 @@
## 3.8.0
Game starts and defaults to a new Main Menu - should help solve errors as well as allow for cleaner disambiguation of problems
Map height normalized to feasable amounts of mountains
Resolved #1936 - can sign Declarations of Friendship in Multiplayer
Resolved #2360 - can now change the current user ID for multiplayer when changing devices
Much more turn-efficient exploration!
City tiles are always contiguous, otherwise loads of wierd bugs happen
Fixed the auto-unassigning extra specialists
Allow scandinavian lowercase vowels (capitalized are very rare) - By SomeTroglodyte
Translation updates
## 3.7.6
Can specify a mod as a 'base ruleset' -

View File

@ -1,8 +1,11 @@
package com.unciv
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.scenes.scene2d.Touchable
import com.badlogic.gdx.scenes.scene2d.ui.Image
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable
import com.badlogic.gdx.utils.Align
import com.unciv.logic.GameSaver
import com.unciv.logic.GameStarter
@ -31,6 +34,15 @@ class MenuScreen: CameraStageBaseScreen() {
}
init {
val backgroundWhite = ImageGetter.getWhiteDot()
backgroundWhite.setFillParent(true)
stage.addActor(backgroundWhite)
val drawable = ImageGetter.getDrawable("OtherIcons/RepeatingBackground")
val tiledDrawable = TiledDrawable(drawable)
val backgroundImage = Image(tiledDrawable).apply { color = Color.WHITE.cpy().apply { a=0.5f } }
backgroundImage.setFillParent(true)
stage.addActor(backgroundImage)
val table = Table().apply { defaults().pad(10f) }
val autosaveGame = GameSaver.getSave(autosave, false)
if (autosaveGame.exists()) {

View File

@ -684,6 +684,7 @@ class MapUnit {
if (health <= 0) {
civInfo.addNotification("An enemy [Citadel] has destroyed our [$name]", currentTile.position, Color.RED)
// todo - add notification for attacking civ
destroy()
} else {
civInfo.addNotification("An enemy [Citadel] has attacked our [$name]", currentTile.position, Color.RED)

View File

@ -257,12 +257,10 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
// The .toList() here is because we have a sequence that's running on the units in the tile,
// then if we move one of the units we'll get a ConcurrentModificationException, se we save them all to a list
for (payload in origin.getUnits().filter { it.isTransported }.toList()) { // bring along the payloads
if (unit.canTransport(payload)) {
payload.removeFromTile()
payload.putInTile(destination)
payload.isTransported = true // restore the flag to not leave the payload in the city
}
for (payload in origin.getUnits().filter { it.isTransported && unit.canTransport(it) }.toList()) { // bring along the payloads
payload.removeFromTile()
payload.putInTile(destination)
payload.isTransported = true // restore the flag to not leave the payload in the cit
}
// Unit maintenance changed

View File

@ -77,7 +77,7 @@ object ImageGetter {
return Image(getDrawable(fileName))
}
private fun getDrawable(fileName: String): TextureRegionDrawable {
fun getDrawable(fileName: String): TextureRegionDrawable {
if(textureRegionDrawables.containsKey(fileName)) return textureRegionDrawables[fileName]!!
else return textureRegionDrawables[whiteDotLocation]!!
}