mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 12:54:06 -04:00
Add more music triggers (#7407)
* Add noted unimplemented music triggers * Prototype try-civ-specific-then-try-general music function * Undo previous commit and rename Built to Wonder * Move music triggers to alert popup
This commit is contained in:
parent
28ff3da9cf
commit
7d7a36acc9
@ -7,6 +7,9 @@ object MusicMood {
|
|||||||
const val Defeat = "Defeat"
|
const val Defeat = "Defeat"
|
||||||
const val Menu = "Menu"
|
const val Menu = "Menu"
|
||||||
const val Ambient = "Ambient"
|
const val Ambient = "Ambient"
|
||||||
|
const val Golden = "Golden"
|
||||||
|
const val Wonder = "Wonder"
|
||||||
|
const val Researched = "Researched"
|
||||||
|
|
||||||
val themeOrPeace = listOf(Theme, Peace)
|
val themeOrPeace = listOf(Theme, Peace)
|
||||||
fun peaceOrWar(isAtWar: Boolean) = if (isAtWar) War else Peace
|
fun peaceOrWar(isAtWar: Boolean) = if (isAtWar) War else Peace
|
||||||
|
@ -16,6 +16,8 @@ import com.unciv.models.ruleset.tile.TileImprovement
|
|||||||
import com.unciv.models.ruleset.tile.TileResource
|
import com.unciv.models.ruleset.tile.TileResource
|
||||||
import com.unciv.models.ruleset.unique.UniqueType
|
import com.unciv.models.ruleset.unique.UniqueType
|
||||||
import com.unciv.models.translations.tr
|
import com.unciv.models.translations.tr
|
||||||
|
import com.unciv.ui.audio.MusicMood
|
||||||
|
import com.unciv.ui.audio.MusicTrackChooserFlags
|
||||||
import com.unciv.ui.civilopedia.FormattedLine
|
import com.unciv.ui.civilopedia.FormattedLine
|
||||||
import com.unciv.ui.civilopedia.MarkupRenderer
|
import com.unciv.ui.civilopedia.MarkupRenderer
|
||||||
import com.unciv.ui.images.ImageGetter
|
import com.unciv.ui.images.ImageGetter
|
||||||
@ -277,6 +279,7 @@ class MapEditorEditStartsTab(
|
|||||||
getNations(),
|
getNations(),
|
||||||
iconDisplay = FormattedLine.IconDisplay.NoLink
|
iconDisplay = FormattedLine.IconDisplay.NoLink
|
||||||
) {
|
) {
|
||||||
|
UncivGame.Current.musicController.chooseTrack(it, MusicMood.Theme, MusicTrackChooserFlags.setSpecific)
|
||||||
editTab.setBrush(BrushHandlerType.Direct, it, "Nation/$it") { tile ->
|
editTab.setBrush(BrushHandlerType.Direct, it, "Nation/$it") { tile ->
|
||||||
// toggle the starting location here, note this allows
|
// toggle the starting location here, note this allows
|
||||||
// both multiple locations per nation and multiple nations per tile
|
// both multiple locations per nation and multiple nations per tile
|
||||||
|
@ -216,6 +216,7 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
|
|||||||
.toLabel().apply { wrap = true }).width(worldScreen.stage.width / 3).pad(10f)
|
.toLabel().apply { wrap = true }).width(worldScreen.stage.width / 3).pad(10f)
|
||||||
add(centerTable).row()
|
add(centerTable).row()
|
||||||
add(getCloseButton(Constants.close))
|
add(getCloseButton(Constants.close))
|
||||||
|
UncivGame.Current.musicController.chooseTrack(wonder.name, MusicMood.Wonder, MusicTrackChooserFlags.setSpecific)
|
||||||
}
|
}
|
||||||
AlertType.TechResearched -> {
|
AlertType.TechResearched -> {
|
||||||
val gameBasics = worldScreen.gameInfo.ruleSet
|
val gameBasics = worldScreen.gameInfo.ruleSet
|
||||||
@ -229,12 +230,14 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
|
|||||||
centerTable.add(descriptionScroll).width(worldScreen.stage.width / 3).maxHeight(worldScreen.stage.height / 2)
|
centerTable.add(descriptionScroll).width(worldScreen.stage.width / 3).maxHeight(worldScreen.stage.height / 2)
|
||||||
add(centerTable).row()
|
add(centerTable).row()
|
||||||
add(getCloseButton(Constants.close))
|
add(getCloseButton(Constants.close))
|
||||||
|
UncivGame.Current.musicController.chooseTrack(tech.name, MusicMood.Researched, MusicTrackChooserFlags.setSpecific)
|
||||||
}
|
}
|
||||||
AlertType.GoldenAge -> {
|
AlertType.GoldenAge -> {
|
||||||
addGoodSizedLabel("GOLDEN AGE")
|
addGoodSizedLabel("GOLDEN AGE")
|
||||||
addSeparator()
|
addSeparator()
|
||||||
addGoodSizedLabel("Your citizens have been happy with your rule for so long that the empire enters a Golden Age!").row()
|
addGoodSizedLabel("Your citizens have been happy with your rule for so long that the empire enters a Golden Age!").row()
|
||||||
add(getCloseButton(Constants.close))
|
add(getCloseButton(Constants.close))
|
||||||
|
UncivGame.Current.musicController.chooseTrack(worldScreen.viewingCiv.civName, MusicMood.Golden, MusicTrackChooserFlags.setSpecific)
|
||||||
}
|
}
|
||||||
AlertType.DeclarationOfFriendship -> {
|
AlertType.DeclarationOfFriendship -> {
|
||||||
val otherciv = worldScreen.gameInfo.getCivilization(popupAlert.value)
|
val otherciv = worldScreen.gameInfo.getCivilization(popupAlert.value)
|
||||||
|
@ -84,12 +84,12 @@ The current list of triggers is as follows:
|
|||||||
| First contact[^4] | (civ name) | [^M] | Theme or Peace | [^X] | |
|
| First contact[^4] | (civ name) | [^M] | Theme or Peace | [^X] | |
|
||||||
| War declaration[^5] | (civ name) | [^M] | War | [^X] | |
|
| War declaration[^5] | (civ name) | [^M] | War | [^X] | |
|
||||||
| Civ defeated | (civ name) | | Defeat | [^X] | |
|
| Civ defeated | (civ name) | | Defeat | [^X] | |
|
||||||
| Golden Age | (civ name) | [^M] | Golden | [^X] | [^N] |
|
| Golden Age | (civ name) | [^M] | Golden | [^X] | |
|
||||||
| Wonder built | (wonder name) | [^M] | Built | [^X] | [^N] |
|
| Wonder built | (wonder name) | [^M] | Wonder | [^X] | |
|
||||||
| Tech researched | (tech name) | [^M] | Researched | [^X] | [^N] |
|
| Tech researched | (tech name) | [^M] | Researched | [^X] | |
|
||||||
| Map editor: Select nation start location | (nation name) | [^M] | Theme | | [^S] [^N] |
|
| Map editor: Select nation start location | (nation name) | [^M] | Theme | | [^S] |
|
||||||
| Options: Volume slider or Default track downloaded | | | | | [^D] |
|
| Options: Volume slider or Default track downloaded | | | | | [^D] |
|
||||||
| Options: Click currently playing label[^6] | | [^M] | Ambient | | [^S] |
|
| Options: Click currently playing label[^6] | | [^M] | Ambient | | [^S] |
|
||||||
|
|
||||||
Legend:
|
Legend:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user