- Joined
- Nov 7, 2014
- Messages
- 571
Instead of requiring Table why don't you require that a unit's GetUnitUserData() be in the range [1, 8190] and not bother with hashtables and static ifs? (I think that should be a thing!)
In my opinion it would be easier to use if the interface worked something like this:
add a scale of X in T-up seconds, after T-up seconds wait Dur seconds, then scale back of -X in T-down seconds, although letting T-up = T-down is probably a good idea
The speed parameter seems weird to me...
Edit: Currently there doesn't seem to be a way to destroy the instance instantly (e.g: dispelling bloodlust, instantly "resets" back the scale).
In order to apply a scale_delta of same 0.5 with a scaling_duration of 1.0 and a staying_scaled_duration of 2.0 one has to write this:
which is not great, so that's what I meant when I said that the interface can be simplified.
Also imagine that an item when equipped/dropped increased/decreased the scale of the hero, we can't simply store a Scale instance and apply it/unapply it because it will get destroyed the first time the item gets dropped, so the item has to store (2 + 1) fields, 2 for creating the Scale instance and 1 for the Scale instance itself.
And "Scale" doesn't seem like a good name because other widgets have scale as well, not just units.
In my opinion it would be easier to use if the interface worked something like this:
add a scale of X in T-up seconds, after T-up seconds wait Dur seconds, then scale back of -X in T-down seconds, although letting T-up = T-down is probably a good idea
The speed parameter seems weird to me...
Edit: Currently there doesn't seem to be a way to destroy the instance instantly (e.g: dispelling bloodlust, instantly "resets" back the scale).
In order to apply a scale_delta of same 0.5 with a scaling_duration of 1.0 and a staying_scaled_duration of 2.0 one has to write this:
JASS:
set scale_delta = 0.5
set scaling_duration = 1.0
set staying_scaled_duration = 2.0
set sc = Scale.create(u, scale_delta)
set sc.speed = scale_delta / scaling_duration
set sc.duration = staying_scaled_duration + scaling_duration
which is not great, so that's what I meant when I said that the interface can be simplified.
Also imagine that an item when equipped/dropped increased/decreased the scale of the hero, we can't simply store a Scale instance and apply it/unapply it because it will get destroyed the first time the item gets dropped, so the item has to store (2 + 1) fields, 2 for creating the Scale instance and 1 for the Scale instance itself.
And "Scale" doesn't seem like a good name because other widgets have scale as well, not just units.
Last edited: