Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

# AMII Changelog

## [1.5.0]

### Added

- Lowest supported version is now 2024.3
- Compiles to the 2024.3 build

## [1.4.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fun properties(key: String) = project.findProperty(key).toString()

plugins {
// Kotlin support
kotlin("jvm") version "1.8.10"
kotlin("jvm") version "2.0.0"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "1.13.3"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
Expand Down
2 changes: 1 addition & 1 deletion docs/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### Added

- 2024.2 Build Support
- 2024. Build Support
11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@
pluginGroup = io.unthrottled
pluginName_ = Anime Memes
pluginVersion = 1.4.0
pluginSinceBuild = 241
pluginUntilBuild = 242.*
pluginSinceBuild = 243
pluginUntilBuild = 243.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions
pluginVerifierIdeVersions = 2024.1,2024.2
pluginVerifierIdeVersions = 2024.3

platformType = IU
platformVersion = 2024.1
platformDownloadSources = true
# Plugin Dependencies -> https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
# Example: platformPlugins = com.intellij.java,com.jetbrains.php:203.4449.22
platformPlugins = NodeJS,Dart:241.15845,io.flutter:79.0.3
#platformPlugins = NodeJS,Dart:243.22562.3,io.flutter:82.2.4

idePath=
#idePath=/Users/alexsimons/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/231.8109.48/Rider EAP.app/Contents
#idePath=/home/alex/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7321754
#idePath=/home/alex/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/211.6085.15
#idePath=/Users/alexsimons/Applications/WebStorm.app/Contents

# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/io/unthrottled/amii/assets/AssetAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object AssetAPI {
"https://amii.api.unthrottled.io/public/"
)

fun <T> getAsset(
fun <T : Any> getAsset(
path: String,
bodyExtractor: (InputStream) -> T
): Optional<T> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object RestClient : Logging {
object RestTools {
private val log = Logger.getInstance(this::class.java)

fun <T> performRequest(
fun <T : Any> performRequest(
url: String,
bodyExtractor: (InputStream) -> T
): Optional<T> {
Expand Down
16 changes: 9 additions & 7 deletions src/main/kotlin/io/unthrottled/amii/memes/MemePanel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,15 @@ class MemePanel(
*/
private fun runAnimation(runForwards: Boolean = true) {
val self = this
val animator = object : Animator(
"Meme Machine",
TOTAL_FRAMES,
CYCLE_DURATION,
false,
runForwards
) {
val animator = object :
Animator(
"Meme Machine",
TOTAL_FRAMES,
CYCLE_DURATION,
false,
runForwards
),
Disposable {
override fun paintNow(frame: Int, totalFrames: Int, cycle: Int) {
alpha = frame.toFloat() / totalFrames
paintImmediately(0, 0, width, height)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private fun buildUpdateMessage(updateAsset: String): String =
"""
What's New?<br>
<ul>
<li>Added 2024.1 build support</li>
<li>Added 2024.3 build support</li>
</ul>
<br>See the <a href="https://github.com/ani-memes/AMII#documentation">documentation</a> for features, usages, and configurations.
<br>The <a href="https://github.com/ani-memes/AMII/blob/master/CHANGELOG.md">changelog</a> is available for more details.
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/io/unthrottled/amii/tools/ProbabilityTools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ProbabilityTools(
).orElseGet { weightedEmotions.first().first }
}

fun <T> pickFromWeightedList(weightedList: List<Pair<T, Long>>): Optional<T> {
fun <T : Any> pickFromWeightedList(weightedList: List<Pair<T, Long>>): Optional<T> {
val totalWeight = weightedList.sumOf { it.second }
return pickFromWeightedList(
random.nextLong(1, if (totalWeight <= 1) 2 else totalWeight),
Expand All @@ -53,7 +53,7 @@ class ProbabilityTools(
.shuffled<Pair<Mood, Long>>()
}

private fun <T> pickFromWeightedList(
private fun <T : Any> pickFromWeightedList(
weightChosen: Long,
weightedEmotions: List<Pair<T, Long>>
): Optional<T> {
Expand Down
Loading