Grags_1977
Ultra Cool Member
- Reaction score
- 32
As the title says, I want to stop the camera from moving when the player presses an arrow key.
I did a little search and found someone had the same problem, but their answer was replied in Jass.
If someone can explain to me step by step what the above is doing, I’m absolutely certain I can reproduce it using GUI. I've tried and tried to use different add-ons like NEWGEN, EGUI etc, and failed every time. I outright refuse to put myself through the agony of trying ever again. So please don’t turn this into a topic on how to install NEWGEN I really don’t want to know.
I did a little search and found someone had the same problem, but their answer was replied in Jass.
library Camera initializer init
globals
private trigger press = CreateTrigger()
private trigger release = CreateTrigger()
private player p
private boolean b = false
endglobals
private function onPress takes nothing returns nothing
local real x = GetCameraTargetPositionX()
local real y = GetCameraTargetPositionY()
loop
call PanCameraTo( x, y )
exitwhen b
endloop
set b = false
endfunction
private function onRelease takes nothing returns nothing
set b = true
endfunction
private function init takes nothing returns nothing
set p = GetLocalPlayer()
call TriggerRegisterPlayerEvent(press, p, EVENT_PLAYER_ARROW_LEFT_DOWN)
call TriggerRegisterPlayerEvent(press, p, EVENT_PLAYER_ARROW_RIGHT_DOWN)
call TriggerRegisterPlayerEvent(press, p, EVENT_PLAYER_ARROW_DOWN_DOWN)
call TriggerRegisterPlayerEvent(press, p, EVENT_PLAYER_ARROW_UP_DOWN)
call TriggerRegisterPlayerEvent(release, p, EVENT_PLAYER_ARROW_LEFT_DOWN)
call TriggerRegisterPlayerEvent(release, p, EVENT_PLAYER_ARROW_RIGHT_DOWN)
call TriggerRegisterPlayerEvent(release, p, EVENT_PLAYER_ARROW_DOWN_DOWN)
call TriggerRegisterPlayerEvent(release, p, EVENT_PLAYER_ARROW_UP_DOWN)
call TriggerAddAction( press, function onPress )
call TriggerAddAction( release, function onRelease )
endfunction
endlibrary
If someone can explain to me step by step what the above is doing, I’m absolutely certain I can reproduce it using GUI. I've tried and tried to use different add-ons like NEWGEN, EGUI etc, and failed every time. I outright refuse to put myself through the agony of trying ever again. So please don’t turn this into a topic on how to install NEWGEN I really don’t want to know.