(version 2)
(include "sci.sh")
(exports
    0 intro
)
(use "Main")
(use "GloryWindow")
(use "IconI")
(use "GameControls")
(use "Game")
(use "Obj")
(script 61)


(local
    local0[10]
    local10[10]
    local20

)
(procedure (localproc_00ed)
    Message(0 61 1 6 2 1 @local0)
    Message(0 61 1 6 3 1 @local10)
    (quest:
        init()
        show()
        dispose()
    )
    return local20
)


(instance public intro of Rgn
    (properties)

    (method (init param1)
        (send gQg3MDHandler:add(self))
        (send gQg3KDHandler:add(self))
        (super:init(rest param1))
    )


    (method (handleEvent pEvent param2)
        (if (IsObject(gNewEventHandler))
            (super:handleEvent(pEvent rest param2))
        )(else
            (if ((send pEvent:claimed))
                0
            )(else
                (if (proc999_5((send pEvent:type) 4 1 256))
                    (send pEvent:claimed(1))
                    (send gSounds:eachElementDo(168 1))
                    (if (localproc_00ed())
                        (send gSounds:eachElementDo(168 0))
                        (send global2:newRoom(280))
                    )
                    (send gSounds:eachElementDo(168 0))
                )(else
                    (if (== (send pEvent:type) 2)
                        (send pEvent:claimed(1))
                    )
                )
            )
            (super:handleEvent(pEvent rest param2))
        )
    )

)
(instance quest of GameControls
    (properties)

    (method (init param1)
        (send gGame:setCursor(999))
        (send (= window (GloryWindow:new())):
            top(60)
            left(97)
            bottom(115)
            right(223)
            priority(15)
            yourself()
        )
        (self:add(titleIcon yesIcon noIcon))
        (super:init(rest param1))
    )

)
(instance titleIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 0
        signal $0004
        maskView 361
        maskLoop 3
    )

    (method (show)
        (var temp0[30])
        Message(0 61 1 6 1 1 @temp0)
        Display(@temp0 106 135 100 5 3 102 17)
    )

)
(instance yesIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 25
        signal $0101
        maskView 361
        maskLoop 3
    )

    (method (show)
        = nsRight 80
        = nsBottom (+ nsTop 15)
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(@local0 100 20 + nsTop 3 102 17)
        (if (& signal $0004)
            (self:mask())
        )
        (if (gPseudoMouse and (send gPseudoMouse:respondsTo(#stop)))
            (send gPseudoMouse:stop())
        )
    )


    (method (select)
        = local20 1
        (quest:state((& (quest:state) $ffdf)))
    )


    (method (highlight param1)
        (var temp0)
        (if (param1)
            DrawCel(view loop 1 nsLeft nsTop -1)
            = temp0 46
        )(else
            DrawCel(view loop 0 nsLeft nsTop -1)
            = temp0 17
        )
        Display(@local0 100 20 + nsTop 3 102 temp0)
    )

)
(instance noIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 40
        signal $0101
        maskView 361
        maskLoop 3
    )

    (method (show)
        = nsRight 80
        = nsBottom (+ nsTop 15)
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(@local10 100 20 + nsTop 3 102 17)
        (if (& signal $0004)
            (self:mask())
        )
        (if (gPseudoMouse and (send gPseudoMouse:respondsTo(#stop)))
            (send gPseudoMouse:stop())
        )
    )


    (method (select)
        = local20 0
        (quest:state((& (quest:state) $ffdf)))
    )


    (method (highlight param1)
        (var temp0)
        (if (param1)
            DrawCel(view loop 1 nsLeft nsTop -1)
            = temp0 46
        )(else
            DrawCel(view loop 0 nsLeft nsTop -1)
            = temp0 17
        )
        Display(@local10 100 20 + nsTop 3 102 temp0)
    )

)
