Message 1 of 19
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I built a UI and gathered the necessary code, but I need help to put it together.
Macroscript that activates walkThrough + it needs to open the UI:
(
on execute do
(
if walkThroughOps.isActive == false then
(
walkThroughOps.start()
)
else
(
walkThroughOps.stop()
)
)
On isChecked return (walkThroughOps.IsActive)
)
the UI:
rollout WalkThrough_Rollout "WalkThrough" width:600 height:267
(
slider 'slider_rotSens' "Rotation Sensitivity" pos:[25,35] width:315 height:44 range:[1,100,40] ticks:1 align:#left
slider 'slider_stepSize' "Step Size" pos:[25,95] width:315 height:44 range:[1,1000,50] ticks:1 align:#left
button 'btn_LockHorizRot' "Lock Horizontal Rotation" pos:[360,180] width:55 height:55 align:#left
button 'btn_LockVertRot' "Lock Vertical Rotation" pos:[435,180] width:55 height:55 align:#left
button 'btn_InvertVertRot' "Invert Vertical Rotation" pos:[510,180] width:55 height:55 align:#left
button 'btn_LevelView' "Level View" pos:[155,180] width:55 height:55 align:#left
button 'btn_camUp' "Up" pos:[435,35] width:55 height:55 align:#left
button 'btn_camDown' "Down" pos:[435,106] width:55 height:55 align:#left
button 'btn_camLeft' "Left" pos:[360,64] width:55 height:55 align:#left
button 'btn_camRight' "Right" pos:[510,65] width:55 height:55 align:#left
button 'btn_accelToggle' "Accelleration Toggle" pos:[35,179] width:74 height:55 align:#left
on slider_rotSens changed val do
(
-- it works like this, eg walkThroughOps.sensitivity=1
-- so we need the value from the slider to be reflected
)
on slider_stepSize changed val do
(
-- it works like this, eg walkThroughOps.stepSize=1000
-- so we need the value from the slider to be reflected
)
on btn_LockHorizRot pressed do
actionMan.executeAction 1127307088 "50" -- WalkThrough: Lock Horizontal Rotation
on btn_LockVertRot pressed do
actionMan.executeAction 1127307088 "48" -- WalkThrough: Lock Vertical Rotation
on btn_InvertVertRot pressed do
actionMan.executeAction 1127307088 "53" -- WalkThrough: Invert Vertical Rotation Toggle
on btn_LevelView pressed do
actionMan.executeAction 1127307088 "47" -- WalkThrough: Level
on btn_camUp pressed do
actionMan.executeAction 1127307088 "51" -- WalkThrough: Up
on btn_camDown pressed do
actionMan.executeAction 1127307088 "52" -- WalkThrough: Down
on btn_camLeft pressed do
actionMan.executeAction 1127307088 "19" -- WalkThrough: Left
on btn_camRight pressed do
actionMan.executeAction 1127307088 "21" -- WalkThrough: Right
on btn_accelToggle pressed do
-- not sure if you can have a on execute and on isChecked.
-- But we need this one to be pressed if this mode is on. Or a color
-- change on the button or somethign indicating it is on.
--on execute do
(
if walkThroughOps.accelerate == true then
(
walkThroughOps.accelerate=false
format "Accellerate Off "
)
else
(
walkThroughOps.accelerate=true
format "Accellerate On "
)
)
--On isChecked return (walkThroughOps.accelerate)
)
Would be even better if it would be dockable (I might redo the design once I see it in action)
Solved! Go to Solution.