Skip to content

Commit

Permalink
Fixed 2022.3 Beta Project Startup. (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Unthrottled authored Nov 4, 2022
1 parent 8635bd8 commit f9e9651
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# AMII Changelog

## [1.1.4]

### Fixed

- Not being able to open any project from the Welcome Screen on the 2022.3 Beta build.

## [1.1.3]

### Fixed
Expand Down
13 changes: 1 addition & 12 deletions docs/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
### Added

- Custom Content, please <a href="https://github.com/ani-memes/AMII/tree/main#custom-assets">
documentation</a> for more details!
- 2022.3 Build Support

### Fixed

- `Show Previous Meme` not replaying sound for assets that have sound.
- Reactions when debugging Flutter tests on Windows.
- Issue
preventing [Apex unit tests](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm)
reactions from showing up
when [using the Illuminated Cloud 2](https://plugins.jetbrains.com/plugin/10253-illuminated-cloud-2) plugin.
- Not being able to open any project from the Welcome Screen on the 2022.3 Beta build.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pluginGroup = io.unthrottled
pluginName_ = Anime Memes
pluginVersion = 1.1.3
pluginVersion = 1.1.4
pluginSinceBuild = 203.7148.57
pluginUntilBuild = 223.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
Expand All @@ -15,10 +15,10 @@ platformVersion = 2022.2.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 = io.acari.DDLCTheme:88.1-1.4.0,NodeJS,Dart:222.3739.24,io.flutter:70.0.5
platformPlugins = io.acari.DDLCTheme:88.1-1.5.4,NodeJS,Dart:222.3739.24,io.flutter:70.0.5

idePath=
#idePath=/Users/alexsimons/Library/Application Support/JetBrains/Toolbox/apps/WebStorm/ch-0
#idePath=/Users/alexsimons/Library/Application Support/JetBrains/Toolbox/apps/WebStorm/ch-0/223.7401.14/WebStorm 2022.3 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

Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/icons/AMIIIcons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ object AMIIIcons {
val E1F612 = IconLoader.getIcon("/icons/emojis/1f612.svg", javaClass)
val E1F620 = IconLoader.getIcon("/icons/emojis/1f620.svg", javaClass)
val E1F632 = IconLoader.getIcon("/icons/emojis/1f632.svg", javaClass)
@JvmField
val E1F634 = IconLoader.getIcon("/icons/emojis/1f634.svg", javaClass)
val E1F642 = IconLoader.getIcon("/icons/emojis/1f642.svg", javaClass)
val E1F973 = IconLoader.getIcon("/icons/emojis/1f973.svg", javaClass)
Expand Down
26 changes: 26 additions & 0 deletions src/main/kotlin/io/unthrottled/amii/actions/FireIdleAction.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.unthrottled.amii.actions

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.DumbAware
import io.unthrottled.amii.events.EVENT_TOPIC
import io.unthrottled.amii.events.UserEvent
import io.unthrottled.amii.events.UserEventCategory
import io.unthrottled.amii.events.UserEvents
import io.unthrottled.amii.tools.PluginMessageBundle

class FireIdleAction : AnAction(), DumbAware {
override fun actionPerformed(e: AnActionEvent) {
val project = e.project
project?.messageBus
?.syncPublisher(EVENT_TOPIC)
?.onDispatch(
UserEvent(
UserEvents.IDLE,
UserEventCategory.NEUTRAL,
PluginMessageBundle.message("user.event.idle.name"),
project
)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import java.util.concurrent.TimeUnit
class IdleEventListener(private val project: Project) : Runnable, Disposable, AWTEventListener {
private val messageBus = ApplicationManager.getApplication().messageBus.connect()
private val log = Logger.getInstance(this::class.java)
private val rootPane = BalloonTools.getIDEFrame(project).component
private val rootPane = lazy {
BalloonTools.getIDEFrame(project).component
}
private var idleTimeout =
TimeUnit.MILLISECONDS.convert(
getCurrentTimoutInMinutes(),
Expand Down Expand Up @@ -81,14 +83,14 @@ class IdleEventListener(private val project: Project) : Runnable, Disposable, AW
idleAlarm.addRequest(this, idleTimeout)
}

private val allowedMouseEvents = setOf(
MouseEvent.MOUSE_PRESSED,
MouseEvent.MOUSE_CLICKED,
)
private val allowedMouseEvents =
MouseEvent.MOUSE_PRESSED or
MouseEvent.MOUSE_CLICKED

override fun eventDispatched(e: AWTEvent) {
if (e !is InputEvent || !UIUtil.isDescendingFrom(e.component, rootPane)) return
if (e !is InputEvent || !UIUtil.isDescendingFrom(e.component, rootPane.value)) return

if (e is MouseEvent && allowedMouseEvents.contains(e.id).not()) return
if (e is MouseEvent && (allowedMouseEvents and e.id) != e.id) return

idleAlarm.cancelAllRequests()
idleAlarm.addRequest(this, idleTimeout)
Expand Down
13 changes: 6 additions & 7 deletions src/main/kotlin/io/unthrottled/amii/memes/MemePanel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ class MemePanel(
private const val WHITE_HEX = 0x00FFFFFF
private const val TENTH_OF_A_SECOND_MULTIPLICAND = 100

private val ALLOWED_KEYS = setOf(
KeyEvent.VK_SHIFT,
KeyEvent.VK_CONTROL,
KeyEvent.VK_ALT,
KeyEvent.VK_META,
)
private const val NON_FOCUS_LOSS_KEYS =
KeyEvent.VK_SHIFT or
KeyEvent.VK_CONTROL or
KeyEvent.VK_ALT or
KeyEvent.VK_META
}

private var alpha = 0.0f
Expand Down Expand Up @@ -199,7 +198,7 @@ class MemePanel(
) {
if (
isFocusLoss &&
ALLOWED_KEYS.contains(event.keyCode).not()
(NON_FOCUS_LOSS_KEYS and event.keyCode) != event.keyCode
) {
dismissMeme()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ private fun buildUpdateMessage(updateAsset: String): String =
"""
What's New?<br>
<ul>
<li>Added Custom Content Support.</li>
<li>Replay Previous Meme Replays Sound Now.</li>
<li>Fixed Apex Unit Test Reactions</li>
<li>Fixed Flutter Unit Test Reactions</li>
<li>2022.3 Build Support</li>
<li>Fixed startup in 2022.3 build</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
6 changes: 6 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
description="Action calms down MIKU">
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt R"/>
</action>
<action id="amii.idle"
class="io.unthrottled.amii.actions.FireIdleAction"
text="Dispatch Idle Event"
icon="AMIIIcons.E1F634"
description="Tells MIKU to start an Idle event">
</action>
<action id="amii.clear"
class="io.unthrottled.amii.actions.ClearAction"
text="Clear Memes"
Expand Down

0 comments on commit f9e9651

Please sign in to comment.