Commit Graph
1883 Commits
Author SHA1 Message Date
bigguy345 bd9d0a3889 Merge branch 'dev' into syntax-highlighter-unified 2026-02-04 05:22:19 +02:00
Kam c80dd448cb Fix GUI Tabs 2026-02-03 16:24:47 -05:00
Kam 769109d046 Fix Windup Ticks 0 not starting Abilities 2026-02-03 15:52:46 -05:00
bigguy345 7f4bc87d7a Extract overload selection to OverloadSelector helper with scoring algorithm
Problem:
- schedule("TpGainAction", function(act){...}) resolved to wrong overload
- TypeInfo.getBestMethodOverload rejected candidates when argType == null
- Fell back to arbitrary overloads.get(0) based on reflection order
- Result: selected 1-arg varargs overload instead of 2-arg fixed-arity

Solution:
- Created OverloadSelector helper class implementing scoring algorithm
- Scoring tiers (lower is better):
  * Arity mismatch: +10000 + distance penalty (hard disqualifier)
  * Varargs: +1000 penalty (fixed-arity strongly preferred)
  * Unknown arg type (null): +10 (penalty but doesn't disqualify)
  * Compatible type: +5 (modest preference for matching)
  * Exact match: +0 (best case)
- Closest arity fallback when no arity-applicable overload exists
- TypeInfo.getBestMethodOverload now delegates (4 lines vs 220)

Impact:
- Deterministic overload selection (no reflection-order dependence)
- schedule("TpGainAction", function(act){...}) now resolves correctly
- Unknown arg types no longer cause fallback to unrelated overloads
- Fixed-arity methods preferred over varargs when both viable
- Removed 220 lines of complex nested logic from TypeInfo

Testing:
- OverloadResolutionTest with 6 test cases (all passing)
- Verifies fixed-arity preference, unknown arg handling, arity fallback
2026-02-03 22:13:15 +02:00
bigguy345 6fc0bf4d6b Fix expression typing gate to route JS function/lambda expressions into ExpressionParser
Problem:
- function(act){...} expressions not reaching ExpressionParser
- resolveExpressionType only checked containsOperators() or startsWith("(")
- Function expressions went through simple resolver and returned null type

Solution:
- Added looksLikeFunctionOrLambda helper (lines 4766-4773) to detect:
  * JS functions: function(...)
  * Arrow functions: =>
  * Java lambdas: ->
- Updated gate condition at line 4144 to route these into ExpressionParser
- Function expressions now reach ExpressionTypeResolver.resolveJSFunctionType

Impact:
- SAM typing now works in pass-2 when expected type is known
- Fixes schedule("TpGainAction", function(act){...}) argument typing
- Enables proper overload resolution for function/lambda parameters
2026-02-03 22:12:43 +02:00
Kam a49df51ad9 Fixes to Ability Load, Reference Handling 2026-02-03 15:09:20 -05:00
bigguy345 ba7e4cc3b2 Merge remote-tracking branch 'origin/dev' into syntax-highlighter-unified
# Conflicts:
#	src/api
#	src/main/java/kamkeel/npcs/util/BukkitUtil.java
#	src/main/java/kamkeel/npcs/util/VaultUtil.java
#	src/main/java/noppes/npcs/CustomNpcsPermissions.java
2026-02-03 18:26:30 +02:00
Vidal 2d47aa00d8 - Added standalone min max methods to FieldDef
- Increased lightning density and radius minmax on all energy abilities
- Made AbilityOrbBarrage interruptible during active state
- Renamed AbilityEnergyBeam to AbilityBeam
- Updated imports
2026-02-03 12:32:30 -03:00
Vidal c5822023a0 Added modifyVisibility to FieldDef
AbilityGuard tweaks
2026-02-03 07:45:02 -03:00
Kam fd85215592 Fix Ability Def Handler 2026-02-03 05:07:54 -05:00
Kam 8aa6e926f6 Some Ability Helpers 2026-02-03 04:27:54 -05:00
bigguy345 9db8a0b2e7 Forgotten Merge resolution for 'Add Tooltips.' commit 2026-02-03 07:20:24 +02:00
bigguy345 074c780d50 Add inner callable scope locals and expression type resolution
ScriptDocument now tracks locals inside lambdas/function expressions and resolves identifiers by consulting the innermost callable scope before falling back to method/global scope.

Adds expression resolver nodes/type resolver and wires position-aware resolution for lambda bodies, plus basic lambda operator marking and return type validation against expected functional interface SAM.
2026-02-03 07:03:33 +02:00
bigguy345 4e78ffb024 Fix autocomplete trigger after dot 2026-02-03 06:54:09 +02:00
Kam 2c6ec0ce34 Better GUI handling for Ability Making System 2026-02-02 21:51:21 -05:00
bigguy345 98351bbc3c dev merge 2026-02-03 04:25:16 +02:00
Kam d3167df1b9 Fix to Type Tab 2026-02-02 20:40:17 -05:00
Kam 0cbc30f8cb Better GUI Handling for Abilities 2026-02-02 18:53:36 -05:00
Kam 911f185400 Fields Builder for Ability GUIs 2026-02-02 18:26:52 -05:00
KamandClaude Opus 4.5 0ff501bb16 Declarative ability GUI: replace 18 SubGui classes with FieldDef system
All ability GUI tabs (General, Target, Effects, Type, Visual) are now
fully declarative via FieldDef definitions. Deleted 18 SubGuiAbility*
classes (~3100 lines) and rewrote SubGuiAbilityConfig to use
GuiScrollWindow for every tab with a unified field renderer.

- Add FieldDef, FieldType, TabTarget, ColumnHint, TabDef gui framework
- Add getFieldDefinitions() to all 18 ability subclasses
- Add getBaseFieldDefinitions() to Ability.java for shared tabs
- Merge COLOR/EFFECTS into SUB_GUI with convenience factories
- Net reduction: ~3100 lines removed

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-02-02 16:17:37 -05:00
Kam 3651643f26 Fix GL Issues? 2026-02-02 14:59:55 -05:00
Vidal c168702970 WIP Animations Register 2026-02-01 20:09:12 -03:00
Vidal c39ce6b6d1 Fixed sync windup animation not being an ability property and getting overridden on gui init 2026-02-01 17:08:24 -03:00
Vidal f4db57875a Changed dual ability names 2026-02-01 06:45:29 -03:00
Vidal 44f7161c9f Added charge to animation and fixed some access modifiers 2026-02-01 01:50:28 -03:00
Vidal 71065fc520 Added Dual Disc Ability 2026-01-31 22:36:12 -03:00
Vidal e9f22dab2a Added Dual Orb Ability 2026-01-31 21:56:14 -03:00
Vidal 245e8f8162 Added Dual Beam Ability 2026-01-31 21:55:39 -03:00
Vidal 2cac2e4add Changed Special Key from C to B 2026-01-30 12:37:57 -03:00
Kam 1b8ad4dd90 Player Abilities 2026-01-30 05:01:54 -05:00
Kam 55658a7956 Ability Preview GUI 2026-01-28 20:43:32 -05:00
Vidal 216a3dbbf8 Added alpha to all abilities except beam 2026-01-28 20:49:16 -03:00
Kam 67237e794f Fix Defaults / Syncing 2026-01-28 17:16:59 -05:00
Kam c339e5edbc Fix Built In Animation 2026-01-28 16:57:49 -05:00
Kam e73054a529 Built In Animation System + Fixes to Defaults for Energy Projectile Abilities 2026-01-28 16:31:26 -05:00
Kam 7d2bba7b95 Better Lock Movement handling 2026-01-28 15:16:28 -05:00
Kam 83ccd25b33 Merge Conflicts + Scripting for Abilities 2026-01-28 14:44:19 -05:00
bigguy345 62d87c0c66 Added comment/multi-line handling for Autocomplete findReceiverExpression 2026-01-28 20:30:41 +02:00
bigguy345 9e04a1184c Lambda impl Phase 1: Track inner callables as nested scopes so parameters and locals resolve correctly inside the callable body, 2026-01-28 06:59:58 +02:00
bigguy345 6c5a269966 Fixed Autocomplete suggestions not working when whitespaces exist between it and receiver like "player. get <- doesnt work due to WS" 2026-01-28 06:06:01 +02:00
bigguy345 969d82dff8 Fixed visual hover info bugs for generics 2026-01-28 04:55:32 +02:00
bigguy345 125a799df4 Optimised and refined type generics parsing. Removed bloat and added edge case handling 2026-01-28 04:37:17 +02:00
Kam aeb0093b4d Add Tooltips 2026-01-27 18:04:46 -05:00
Kam c6810c05ea More Ability Fixes. 2026-01-27 16:43:47 -05:00
bigguy345 5795cc984b Completely parsed type generics.
List<IPlayer> list;
list.get(0) NOW returns IPlayer, instead of T or Object.

Nested generics are also handled and functional:
Map<String, List<IPlayer>>

Implemented TokenHoverInfo/Autocomplete rendering and handling for generics as well.
2026-01-27 17:10:31 +02:00
Kam 747aae8337 Recovery -> Dazed. Better cooldown logic handling 2026-01-27 04:07:02 -05:00
Vidal 93486d306b Made animation fetching methods return Animation instead of IDs 2026-01-27 04:36:12 -03:00
Kam 0f44a3c6c6 Ability Anchor Points + Orb / Disc Summoning 2026-01-26 23:55:07 -05:00
Kam 563b6f7a26 Ability Effects 2026-01-26 22:02:51 -05:00
Kam 6c7c72b0f9 Lightning, Orb and Beam Improvements. Outer Glow Configurations for Abilities 2026-01-26 18:38:43 -05:00