找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 433|回复: 4

[求助] 关于use screen的一个问题

[复制链接]
发表于 2023-2-26 01:23:28 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
明明没有在 被 use 的screen 中的textbutton设置隐藏之类的action

但是在点击后会让原来的整个界面都给消失?
这是为什么?



[RenPy] 纯文本查看 复制代码
screen Mybag():
    zorder 30
    style_prefix "baginfo"
    modal True
    textbutton "返回" :
        text_font"SourceHanSerifCN-Bold.otf"
        text_size 20
        pos(1204, 608)
        action Hide("Mybag")#,Hide("showgoods")
    frame:
        pos(101, 43)
        xysize(798, 556)
        background None
        vbox:
            pos(340,230)
            spacing 30
            textbutton "所有"  action SetVariable("showlist",baglist.copy())#,Show('showgoods')
            $ a = ['A','B','C',D']
            for i in a :
                textbutton "[i]" action Function(sortitems,baglist,i,0)#,Show('showgoods')
        vbox:
            pos(880,445)
            spacing 25
            if tp == 0:
                textbutton "使用" text_color"#aaaaaa"  action Notify('请先选择!')
            else:
                textbutton "使用" # action None
            if tp == 0 :
                textbutton "丢弃" text_color"#aaaaaa"  action Notify('请先选择!')
            else:
                textbutton "丢弃" action[Function(trashitem,Ngetitem),
                Notify('已丢弃'),SetVariable("tp",0),
                SetVariable("showlist",baglist.copy())]
                #Show('showgoods')]
    use showgoods()
    use iteminfo(Ngetitem)

screen showgoods():
    frame:
        pos (560,200)
        xysize (310,400)
        background None
        viewport:
            pos(5,5)
            xysize (310,400)
            spacing 10
            draggable True
            mousewheel True
            scrollbars "vertical"
            has vbox:
                if showlist == []:
                    text "当前没有可查看的"
                else:
                    $ counts = showitems(showlist)
                    for i,j in counts.items():
                        hbox:
                            textbutton "[i]" :
                                text_size 20
                                action [SetVariable("tp",1),
                                        Function(checkiteminfo,i)]
                            text"x[j]" xpos 0.9

screen iteminfo(item):
    frame:
        pos(930,220)
        xysize(200,200)
        background None
        if item == '无':
            text '请选择'
        else:
            text '[item.description]' size 20


 楼主| 发表于 2023-2-26 01:25:20 | 显示全部楼层
showgoods 界面下的按钮 点了会让原本界面消失= =
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2023-2-26 01:47:39 | 显示全部楼层
后面改用label call screen 不用use 算是解决了,但是实在无法理解为什么会让整个界面消失
回复 支持 抱歉

使用道具 举报

发表于 2023-2-27 09:03:23 | 显示全部楼层
楼主给的代码中包含了很多未给出定义的变量和函数,其他人没办法调试……
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2023-2-28 11:12:24 | 显示全部楼层
被诅咒的章鱼 发表于 2023-2-27 09:03
楼主给的代码中包含了很多未给出定义的变量和函数,其他人没办法调试…… ...

那几个变量我在define 里定义了,应该不是变量的问题,运行时没有报错,就是界面突然消失,我想应该还是call 还有use的应用我没理解透
回复 支持 抱歉

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|RenPy中文空间 ( 苏ICP备17067825号|苏公网安备 32092302000068号 )

GMT+8, 2024-4-19 23:53 , Processed in 0.072599 second(s), 12 queries , File On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表