Skip to content

Commit 0d81122

Browse files
committed
Update types and trigger names to match the latest decompiler output
1 parent 4aee64b commit 0d81122

File tree

6 files changed

+40
-31
lines changed

6 files changed

+40
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Add breadcrumbs and sticky lines support
66
- Add support for IntelliJ 2025.
77
- Add support for optional boolean argument in cc_create
8+
- Update types and trigger names to match the latest decompiler output
89

910
## [1.7.1] - 2025-01-12
1011

src/main/kotlin/io/runescript/plugin/ide/config/RsConfig.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ object RsConfig {
5656
"player_uid",
5757
"stringvector",
5858
"stylesheet",
59-
"shiftopnpc",
60-
"shiftoploc",
61-
"shiftopobj",
62-
"shiftopplayer",
63-
"shiftoptile",
59+
"bugtemplate",
60+
"clientopnpc",
61+
"clientoploc",
62+
"clientopobj",
63+
"clientopplayer",
64+
"clientoptile",
6465
// Types only for the .op file
6566
"hook",
6667
"varphook",

src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsDynamicExpressionReference.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ class RsDynamicExpressionReference(element: RsDynamicExpression) :
8888

8989
private fun getScriptTriggerForType(type: RsType): RsTriggerType? {
9090
return when (type) {
91-
RsPrimitiveType.SHIFTOPNPC -> RsTriggerType.SHIFTOPNPC
92-
RsPrimitiveType.SHIFTOPLOC -> RsTriggerType.SHIFTOPLOC
93-
RsPrimitiveType.SHIFTOPOBJ -> RsTriggerType.SHIFTOPOBJ
94-
RsPrimitiveType.SHIFTOPPLAYER -> RsTriggerType.SHIFTOPPLAYER
95-
RsPrimitiveType.SHIFTOPTILE -> RsTriggerType.SHIFTOPTILE
91+
RsPrimitiveType.CLIENTOPNPC -> RsTriggerType.CLIENTOPNPC
92+
RsPrimitiveType.CLIENTOPLOC -> RsTriggerType.CLIENTOPLOC
93+
RsPrimitiveType.CLIENTOPOBJ -> RsTriggerType.CLIENTOPOBJ
94+
RsPrimitiveType.CLIENTOPPLAYER -> RsTriggerType.CLIENTOPPLAYER
95+
RsPrimitiveType.CLIENTOPTILE -> RsTriggerType.CLIENTOPTILE
9696
else -> null
9797
}
9898
}

src/main/kotlin/io/runescript/plugin/lang/psi/type/RsPrimitiveType.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ enum class RsPrimitiveType(val literal: String, val referencable: Boolean = true
4545
PLAYER_UID("player_uid"),
4646
STRINGVECTOR("stringvector"),
4747
STYLESHEET("stylesheet"),
48-
SHIFTOPNPC("shiftopnpc"),
49-
SHIFTOPLOC("shiftoploc"),
50-
SHIFTOPOBJ("shiftopobj"),
51-
SHIFTOPPLAYER("shiftopplayer"),
52-
SHIFTOPTILE("shiftoptile"),
48+
BUGTEMPLATE("bugtemplate"),
49+
CLIENTOPNPC("clientopnpc"),
50+
CLIENTOPLOC("clientoploc"),
51+
CLIENTOPOBJ("clientopobj"),
52+
CLIENTOPPLAYER("clientopplayer"),
53+
CLIENTOPTILE("clientoptile"),
5354
// Non-Referencable types
5455
PARAM("param", referencable = false),
5556
FLO("flo", referencable = false),

src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/RsTypeInferenceVisitor.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,9 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV
494494
?: emptyList()
495495
o.type = RsTupleType(returnTypes.flatten())
496496
} else {
497-
check(type == RsPrimitiveType.SHIFTOPNPC || type == RsPrimitiveType.SHIFTOPLOC
498-
|| type == RsPrimitiveType.SHIFTOPOBJ || type == RsPrimitiveType.SHIFTOPPLAYER
499-
|| type == RsPrimitiveType.SHIFTOPTILE) {
497+
check(type == RsPrimitiveType.CLIENTOPNPC || type == RsPrimitiveType.CLIENTOPLOC
498+
|| type == RsPrimitiveType.CLIENTOPOBJ || type == RsPrimitiveType.CLIENTOPPLAYER
499+
|| type == RsPrimitiveType.CLIENTOPTILE) {
500500
"Invalid type for dynamic expression: ${type.representation}"
501501
}
502502
o.type = type

src/main/kotlin/io/runescript/plugin/lang/psi/type/trigger/RsTriggerType.kt

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,45 @@ enum class RsTriggerType(
2020
"worldmapelementmouseover",
2121
subjectType = MAPELEMENT,
2222
allowParameters = true,
23-
arrayOf(INT, INT)
23+
arrayOf(INT, INT),
2424
),
2525
WORLDMAPELEMENTMOUSELEAVE(
2626
"worldmapelementmouseleave",
2727
subjectType = MAPELEMENT,
2828
allowParameters = true,
29-
arrayOf(INT, INT)
29+
arrayOf(INT, INT),
3030
),
3131
WORLDMAPELEMENTMOUSEREPEAT(
3232
"worldmapelementmouserepeat",
3333
subjectType = MAPELEMENT,
3434
allowParameters = true,
35-
arrayOf(INT, INT)
35+
arrayOf(INT, INT),
3636
),
37+
CLIENTOPNPC("clientopnpc"),
38+
CLIENTOPLOC("clientoploc"),
39+
CLIENTOPOBJ("clientopobj"),
40+
CLIENTOPPLAYER("clientopplayer"),
41+
CLIENTOPTILE("clientoptile"),
3742
LOADNPC("loadnpc", subjectType = NPC),
43+
UNLOADNPC("unloadnpc", subjectType = NPC),
3844
LOADLOC("loadloc", subjectType = LOC),
45+
UNLOADLOC("unloadloc", subjectType = LOC),
46+
LOADOBJ("loadobj", subjectType = NAMEDOBJ),
47+
UNLOADOBJ("unloadobj", subjectType = NAMEDOBJ),
48+
LOADPLAYER("loadplayer"),
49+
UNLOADPLAYER("unloadplayer"),
3950
UPDATEOBJSTACK("updateobjstack"),
4051
UPDATEOBJCOUNT("updateobjcount", subjectType = NAMEDOBJ),
41-
TRIGGER_47("trigger_47"),
42-
TRIGGER_48("trigger_48"),
43-
TRIGGER_49("trigger_49"),
44-
CLIENTSCRIPT("clientscript", allowParameters = true),
52+
PLAYER_DESTINATION("player_destination"),
53+
PLAYER_HOVER("player_hover"),
54+
PLAYER_MOVE("player_move"),
4555
PROC("proc", allowParameters = true, allowReturns = true),
56+
CLIENTSCRIPT("clientscript", allowParameters = true),
4657
ONCLICKLOC("onclickloc"),
4758
ONCLICKOBJ("onclickobj"),
4859
ONCLICKNPC("onclicknpc"),
4960
ONCLICKPLAYER("onclickplayer"),
50-
TRIGGER82("trigger_82"),
51-
SHIFTOPNPC("shiftopnpc"),
52-
SHIFTOPLOC("shiftoploc"),
53-
SHIFTOPOBJ("shiftopobj"),
54-
SHIFTOPPLAYER("shiftopplayer"),
55-
SHIFTOPTILE("shiftoptile"),
61+
MINIMENU_OPENED("minimenu_opened"),
5662
;
5763

5864
companion object {

0 commit comments

Comments
 (0)