(version 2)
(include "sci.sh")
(exports
    0 actionBar
)
(use "Main")
(use "GloryWindow")
(use "IconI")
(use "GameControls")
(script 20)


(local
    local0

)
(instance public actionBar of GameControls
    (properties)

    (method (init)
        (self:add(iconRun iconSneak iconRest))
        (if (& global399 $0001)
            (iconRun:signal((| (iconRun:signal) $0004)))
        )
        (if (& global399 $0002)
            (iconSneak:signal((| (iconSneak:signal) $0004)))
        )
        (if (& global399 $0004)
            (iconRest:signal((| (iconRest:signal) $0004)))
        )
        (self:
            window(actWin)
            add(iconSheet iconTime iconActionHelp iconEdge)
            eachElementDo(110)
            eachElementDo(212 -1)
            eachElementDo(213 -1)
            curIcon(iconSheet)
            helpIconItem(iconActionHelp)
            state(3072)
        )
    )


    (method (show)
        (super:show())
        (self:
            dispose()
            release()
        )
        (if (local0)
            (send (ScriptID(15)):doit())
        )
        DisposeScript(20)
    )


    (method (hide)
        (super:hide())
        proc0_10()
    )

)
(instance iconRun of IconI
    (properties
        view 931
        loop 0
        cel 0
        nsLeft 7
        nsTop 4
        cursor 940
        message 3
        signal $01c3
        maskView 931
        maskLoop 14
        noun 1
        modNum 20
        helpVerb 9
    )

    (method (select param1)
        return 
            (if ((super:select(rest param1)))
                (actionBar:hide())
                (send gMainIconBar:curIcon((send gMainIconBar:at(1))))
                (send gOwner:changeGait(1 1))
                return 1
            )(else
                return 0
            )
    )

)
(instance iconSneak of IconI
    (properties
        view 931
        loop 1
        cel 0
        nsLeft 36
        nsTop 4
        cursor 941
        message 3
        signal $01c3
        maskView 931
        maskLoop 14
        noun 2
        modNum 20
        helpVerb 9
    )

    (method (select param1)
        return 
            (if ((super:select(rest param1)))
                (actionBar:hide())
                (send gMainIconBar:curIcon((send gMainIconBar:at(1))))
                (if (<> global100 2)
                    (if ((send gOwner:trySkill(8 5 0)))
                        (send gOwner:changeGait(2 1))
                    )(else
                        (send gQg3Messager:say(7 6 1 0 0 20))
                    )
                )
                return 1
            )(else
                return 0
            )
    )

)
(instance iconRest of IconI
    (properties
        view 931
        loop 3
        cel 0
        nsLeft 65
        nsTop 4
        cursor 943
        message 74
        signal $01c3
        maskView 931
        maskLoop 14
        noun 3
        modNum 20
        helpVerb 9
    )

    (method (select param1)
        return 
            (if ((super:select(rest param1)))
                (actionBar:hide())
                (send (ScriptID(7 2)):init())
                return 1
            )(else
                return 0
            )
    )

)
(instance iconSheet of IconI
    (properties
        view 931
        loop 5
        cel 0
        nsLeft 94
        nsTop 4
        cursor 999
        signal $01c3
        maskView 931
        maskLoop 14
        noun 4
        modNum 20
        helpVerb 9
    )

    (method (select param1)
        return 
            (if ((super:select(rest param1)))
                (actionBar:hide())
                (if (not proc0_1(2100))
                    (send gQg3Messager:say(7 6 2 0 0 20))
                )(else
                    (if (not global208)
                        = local0 1
                    )
                )
                return 1
            )(else
                return 0
            )
    )

)
(instance iconTime of IconI
    (properties
        view 931
        loop 6
        cel 0
        nsLeft 123
        nsTop 4
        cursor 999
        signal $01c3
        maskView 931
        maskLoop 14
        noun 5
        modNum 20
        helpVerb 9
    )

    (method (select param1)
        (if ((super:select(rest param1)))
            (actionBar:hide())
            (send (ScriptID(7 3)):init())
        )
    )

)
(instance iconActionHelp of IconI
    (properties
        view 931
        loop 8
        cel 0
        nsLeft 152
        nsTop 4
        cursor 949
        message 9
        signal $01c3
        noun 6
        modNum 20
        helpVerb 9
    )
)
(instance iconEdge of IconI
    (properties
        view 931
        loop 9
        cel 1
        nsLeft 181
        nsTop 4
        signal $01c3
    )

    (method (select)
        return 0
    )

)
(instance actWin of GloryWindow
    (properties)

    (method (open)
        (self:
            top(30)
            left(61)
            bottom(67)
            right(254)
            priority(-1)
        )
        (super:open())
    )

)
