标题: [已解決]物品欄界面卡了2秒才會跑出來||..求幫助TVT
kurlapika
会员
Rank: 1



UID 2374
精华 0
积分 39
帖子 10
阅读权限 5
注册 2009-10-6
 
发表于 2011-10-17 13:00  资料  短消息  加为好友  添加 kurlapika 为MSN好友 通过MSN和 kurlapika 交谈
[已解決]物品欄界面卡了2秒才會跑出來||..求幫助TVT

如下我先定義了下面這些物品..
//0名字 1是否被知道 2元素屬性(0~4分別是金木水火土) 3~9是加點orz.... 10擁有數量 11是否可以被合成..
[
["阿法受體結抗劑","true",0,0,0,0,0,0,0,0,0,"false"],
["被塔受體結抗劑","true",4,0,0,0,0,0,0,0,0,"false"],
["西弟藍","true",2,0,0,0,0,0,0,0,0,"false"],
["度冷丁","true",2,0,0,0,0,0,0,0,0,"false"],
["利多卡音","true",2,0,0,0,0,0,0,0,0,"false"],
["浮賽米","true",2,0,0,0,0,0,0,0,0,"false"],
["本妥音那","true",1,0,0,0,0,0,0,0,0,"false"],
["弟高薪","true",2,0,0,0,0,0,0,0,0,"false"],
["本妥音那","true",1,0,0,0,0,0,0,0,0,"false"],
["蕭本地坪","true",2,0,0,0,0,0,0,0,0,"true"],
["譜耐落爾","true",2,0,0,0,0,0,0,0,0,"true"],
["為拉怕米","true",2,0,0,0,0,0,0,0,0,"true"],
["蕭譜那","true",2,0,0,0,0,0,0,0,0,"true"],
["股安酸假","true",2,0,0,0,0,0,0,0,0,"true"],
["柳蛋黃否定","true",2,0,0,0,0,0,0,0,0,"true"],
["蓋結抗劑","true",2,0,0,0,0,0,0,0,0,"true"],
["通道組致劑","true",2,0,0,0,0,0,0,0,0,"true"],
["類生命物質","true",2,0,0,0,0,0,0,0,0,"true"],
["類靈魂物質","true",3,0,0,0,0,0,0,0,0,"true"]
]

然後物品欄出現如下||orz..

*real_start
[eval exp="tf.ab = 0" cond="tf.ab === void"]
;(0~4分別是五行屬性||=A=)
[eval exp="tf.goods_page = 1" cond="tf.goods_page === void"]

[backlay]
@position layer="message3" frame="bgworks" visible=true opacity=0 top=0 left=0 height=640 width=480 marginl=0 marginr=0 margint=30 marginb=0 page="back"
@current layer="message3" page="back"
@er

*重新讀取物品頁面
[jump target=*New_Page]

;--------------------------------
;            共用按钮 每頁上的五行屬性按鈕+翻頁按鈕==||..
;--------------------------------

*works_button

[nowait]

[locate x=20 y=13]
[button normal=ab_metal1 over=ab_metal1 on=ab_metal1 clickse="se1" enterse="se2" cond="tf.ab==0"]
[button normal=ab_metal2 over=ab_metal1 on=ab_metal1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=0" exp="tf.ab = 0"]

[locate x=20 y=56]
[button normal=ab_wood1 over=ab_wood1 on=ab_wood1 clickse="se1" enterse="se2" cond="tf.ab==1"]
[button normal=ab_wood2 over=ab_wood1 on=ab_wood1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=1" exp="tf.ab = 1"]

[locate x=20 y=99]
[button normal=ab_water1 over=ab_water1 on=ab_water1 clickse="se1" enterse="se2" cond="tf.ab==2"]
[button normal=ab_water2 over=ab_water1 on=ab_water1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=2" exp="tf.ab = 2"]

[locate x=20 y=142]
[button normal=ab_fire1 over=ab_fire1 on=ab_fire1 clickse="se1" enterse="se2" cond="tf.ab==3"]
[button normal=ab_fire2 over=ab_fire1 on=ab_fire1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=3" exp="tf.ab = 3"]

[locate x=20 y=185]
[button normal=ab_soil1 over=ab_soil1 on=ab_soil1 clickse="se1" enterse="se2" cond="tf.ab==4"]
[button normal=ab_soil2 over=ab_soil1 on=ab_soil1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=4" exp="tf.ab = 4"]

[locate x=510 y=378]
[button normal=button_back1 over=button_back2 on=button_back2 clickse="se1" enterse="se2" target=*drclick]

[endnowait]

[return]

;--------------------------------

*goods_page

[nowait]

[locate x=333 y=24]
[button normal=goods_preview2 over=goods_preview clickse="se7" exp="tf.goods_page--" enterse="se8" target=*重新讀取物品頁面 cond="tf.goods_page>1"]
[button normal=goods_preview2 over=goods_preview clickse="se7" enterse="se8" cond="tf.goods_page<=1"]

[locate x=333 y=324]
[button normal=goods_next2 over=goods_next clickse="se7" enterse="se8" exp="tf.goods_page++" target=*重新讀取物品頁面 cond="tf.goods_page<9"]
[button normal=goods_next2 over=goods_next clickse="se7" enterse="se8" cond="tf.goods_page>=9"]

@locate x=130 y=384
[button normal=page1_2 over=page1_2 on=page1_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==1"]
[button normal=page1 over=page1_2 on=page1_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=1" exp="tf.goods_page=1"]

@locate x=170 y=384
[button normal=page2_2 over=page2_2 on=page2_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==2"]
[button normal=page2 over=page2_2 on=page2_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=2" exp="tf.goods_page=2"]

@locate x=210 y=384
[button normal=page3_2 over=page3_2 on=page3_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==3"]
[button normal=page3 over=page3_2 on=page3_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=3" exp="tf.goods_page=3"]

@locate x=250 y=384
[button normal=page4_2 over=page4_2 on=page4_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==4"]
[button normal=page4 over=page4_2 on=page4_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=4" exp="tf.goods_page=4"]

@locate x=290 y=384
[button normal=page5_2 over=page5_2 on=page5_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==5"]
[button normal=page5 over=page5_2 on=page5_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=5" exp="tf.goods_page=5"]

@locate x=330 y=384
[button normal=page6_2 over=page6_2 on=page6_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==6"]
[button normal=page6 over=page6_2 on=page6_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=6" exp="tf.goods_page=6"]

@locate x=370 y=384
[button normal=page7_2 over=page7_2 on=page7_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==7"]
[button normal=page7 over=page7_2 on=page7_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=7" exp="tf.goods_page=7"]

@locate x=410 y=384
[button normal=page8_2 over=page8_2 on=page8_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==8"]
[button normal=page8 over=page8_2 on=page8_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=8" exp="tf.goods_page=8"]

@locate x=450 y=384
[button normal=page9_2 over=page9_2 on=page9_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==9"]
[button normal=page9 over=page9_2 on=page9_2 target=*重新讀取物品頁面 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=9" exp="tf.goods_page=9"]

[endnowait]

[return]

;-------------------------------------------------------------------
*New_Ab
[eval exp="tf.goods_page=1"]

*New_Page
[er]

[nowait]

[叫出goods_loop.ks上得到的物品]
[叫出頁面上的屬性按鈕works_button]
[叫出頁面上的物品頁數按鈕goods_page]

[endnowait]

[trans method=universal time=500 rule=9]
[wt]

[s]




然後下面是循環goods_loop.ks內的內容||= =..

*goodsloop

;判斷tf.ab與f.goods_f[][2]是否相等來取物品。
;--------------------------
;       座標初始值
;--------------------------
[eval exp="tf.goodslocate_x = [90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90]" cond="tf.goodslocate_x === void"]
[eval exp="tf.goodslocate_y = [30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330]" cond="tf.goodslocate_y === void"]
;--------------------------
;      循環數量初始值
;--------------------------
;循環到的物品數
[eval exp="tf.goods_n=0"]
;符合標準讀到的物品數
[eval exp="tf.goodsread_n=0"]
;物品顯現位置的順序
[eval exp="tf.goodslocate_n=0"]
;---------------------------------------------------------------
[nowait]
;---------------------------------------------------------------
*goods_place_loop

[if exp="f.goods_f[tf.goods_n][2]==tf.ab && f.goods_f[tf.goods_n][1]=='true'"]
;尋找到物品的情況下

;根據頁數擺放
[if exp="tf.goodslocate_n < 11 && tf.goods_page==1"]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]

[elsif exp="tf.goodsread_n < 22 && tf.goodsread_n >= 11  && tf.goods_page==2"]
[if exp="tf.goodsread_n==11"]
[eval exp="tf.goodslocate_n=0"]
[er]
[call target=*show]
[jump target=*finallyloop]
[else]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[endif]

[elsif exp="tf.goodsread_n < 33 && tf.goodsread_n >= 22 && tf.goods_page==3"]
[if exp="tf.goodsread_n==22"]
[eval exp="tf.goodslocate_n=0"]
[er]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[else]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[endif]

[elsif exp="tf.goodsread_n < 44 && tf.goodsread_n >= 33  && tf.goods_page==4"]
[if exp="tf.goodsread_n==33"]
[eval exp="tf.goodslocate_n=0"]
[er]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[else]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[endif]

[elsif exp="tf.goodsread_n < 55 && tf.goodsread_n >= 44  && tf.goods_page==5"]
[if exp="tf.goodsread_n==44"]
[eval exp="tf.goodslocate_n=0"]
[er]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[else]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[endif]

[elsif exp="tf.goodsread_n < 66 && tf.goodsread_n >= 55  && tf.goods_page==6"]
[if exp="tf.goodsread_n==55"]
[eval exp="tf.goodslocate_n=0"]
[er]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[else]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[endif]

[elsif exp="tf.goodsread_n < 77 && tf.goodsread_n >= 66  && tf.goods_page==7"]
[if exp="tf.goodsread_n==66"]
[eval exp="tf.goodslocate_n=0"]
[er]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[else]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[endif]

[elsif exp="tf.goodsread_n < 88 && tf.goodsread_n >= 77  && tf.goods_page==8"]
[if exp="tf.goodsread_n==77"]
[eval exp="tf.goodslocate_n=0"]
[er]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[else]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[endif]

[elsif exp="tf.goodsread_n < 99 && tf.goodsread_n >= 88  && tf.goods_page==9"]
[if exp="tf.goodsread_n==88"]
[eval exp="tf.goodslocate_n=0"]
[er]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[else]
[叫出顯示這個物品的標籤*show]
[jump target=*finallyloop]
[endif]
;---------------------------------------------------------------
[else]
;找到但是不在頁數上不能放的情況下
[eval exp="tf.goodsread_n=tf.goodsread_n+1"]
[jump target=*goods_place_loop cond="++tf.goods_n < f.goods_f.count"]
[jump target=*read_over]
[endif]

[else]
;沒有找到物品的情況下
[jump target=*goods_place_loop cond="++tf.goods_n < f.goods_f.count"]
[jump target=*read_over]
[endif]
;---------------------------------------------------------------
*read_over
[endnowait]
[return]
;---------------------------------------------------------------
*show
@locate x="&tf.goodslocate_x[tf.goodslocate_n]" y="&tf.goodslocate_y[tf.goodslocate_n]"
[emb exp="f.goods_f[tf.goods_n][0]"]
@locate x="&tf.goodslocate_x[tf.goodslocate_n]+200" y="&tf.goodslocate_y[tf.goodslocate_n]"
;數量
[emb exp="f.goods_f[tf.goods_n][10]"]
[return]
;---------------------------------------------------------------
*finallyloop
;物品顯現位置的順序
[eval exp="tf.goodslocate_n=tf.goodslocate_n+1"]
;計數讀到的數目
[eval exp="tf.goodsread_n=tf.goodsread_n+1"]
[jump target=*goods_place_loop cond="++tf.goods_n < f.goods_f.count"]
[jump target=*read_over]


第一次發這麼大段,排版可能很長,希望指教||...TTvTT||

[ 本帖最后由 kurlapika 于 2011-10-17 15:12 编辑 ]

顶部
全局变量D
亲友
Rank: 2



UID 14
精华 1
积分 1262
帖子 719
阅读权限 50
注册 2006-12-20
 
发表于 2011-10-17 14:58  资料  短消息  加为好友 
用tjs优化了一下。

宏三个:
【type_button】【page_button】基本就是原来呼叫的内容,改成宏了。
【item_button】直接调用TJS函数draw_item_button()。

TJS函数两个:
ab_div() -将物品列表里数量>0的物品取出来,并根据类型分成5类,放到一个数组的5行里。每行是一类物品数组。
draw_item_button() - 根据当前选择的物品类型和页数,描绘写有物品名和数量的按钮。

macro_item.ks

*start

;==================================================================
;分类按钮
[macro name=type_button]

[locate x=20 y=13]
[button normal=ab_metal1 over=ab_metal1 on=ab_metal1 clickse="se1" enterse="se2" cond="tf.ab==0"]
[button normal=ab_metal2 over=ab_metal1 on=ab_metal1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=0" exp="tf.ab = 0"]

[locate x=20 y=56]
[button normal=ab_wood1 over=ab_wood1 on=ab_wood1 clickse="se1" enterse="se2" cond="tf.ab==1"]
[button normal=ab_wood2 over=ab_wood1 on=ab_wood1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=1" exp="tf.ab = 1"]

[locate x=20 y=99]
[button normal=ab_water1 over=ab_water1 on=ab_water1 clickse="se1" enterse="se2" cond="tf.ab==2"]
[button normal=ab_water2 over=ab_water1 on=ab_water1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=2" exp="tf.ab = 2"]

[locate x=20 y=142]
[button normal=ab_fire1 over=ab_fire1 on=ab_fire1 clickse="se1" enterse="se2" cond="tf.ab==3"]
[button normal=ab_fire2 over=ab_fire1 on=ab_fire1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=3" exp="tf.ab = 3"]

[locate x=20 y=185]
[button normal=ab_soil1 over=ab_soil1 on=ab_soil1 clickse="se1" enterse="se2" cond="tf.ab==4"]
[button normal=ab_soil2 over=ab_soil1 on=ab_soil1 clickse="se1" enterse="se2" target=*New_Ab cond="tf.ab!=4" exp="tf.ab = 4"]

[locate x=510 y=378]
[button normal=button_back1 over=button_back2 on=button_back2 clickse="se1" enterse="se2" target=*drclick]
[endmacro]
;==================================================================
;分页按钮
[macro name=page_button]
[locate x=333 y=24]
[button normal=goods_preview2 over=goods_preview clickse="se7" exp="tf.goods_page--" enterse="se8" target=*New_Ab cond="tf.goods_page>1"]
[button normal=goods_preview2 over=goods_preview clickse="se7" enterse="se8" cond="tf.goods_page<=1"]

[locate x=333 y=324]
[button normal=goods_next2 over=goods_next clickse="se7" enterse="se8" exp="tf.goods_page++" target=*New_Ab cond="tf.goods_page<9"]
[button normal=goods_next2 over=goods_next clickse="se7" enterse="se8" cond="tf.goods_page>=9"]

@locate x=130 y=384
[button normal=page1_2 over=page1_2 on=page1_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==1"]
[button normal=page1 over=page1_2 on=page1_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=1" exp="tf.goods_page=1"]

@locate x=170 y=384
[button normal=page2_2 over=page2_2 on=page2_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==2"]
[button normal=page2 over=page2_2 on=page2_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=2" exp="tf.goods_page=2"]

@locate x=210 y=384
[button normal=page3_2 over=page3_2 on=page3_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==3"]
[button normal=page3 over=page3_2 on=page3_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=3" exp="tf.goods_page=3"]

@locate x=250 y=384
[button normal=page4_2 over=page4_2 on=page4_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==4"]
[button normal=page4 over=page4_2 on=page4_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=4" exp="tf.goods_page=4"]

@locate x=290 y=384
[button normal=page5_2 over=page5_2 on=page5_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==5"]
[button normal=page5 over=page5_2 on=page5_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=5" exp="tf.goods_page=5"]

@locate x=330 y=384
[button normal=page6_2 over=page6_2 on=page6_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==6"]
[button normal=page6 over=page6_2 on=page6_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=6" exp="tf.goods_page=6"]

@locate x=370 y=384
[button normal=page7_2 over=page7_2 on=page7_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==7"]
[button normal=page7 over=page7_2 on=page7_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=7" exp="tf.goods_page=7"]

@locate x=410 y=384
[button normal=page8_2 over=page8_2 on=page8_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==8"]
[button normal=page8 over=page8_2 on=page8_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=8" exp="tf.goods_page=8"]

@locate x=450 y=384
[button normal=page9_2 over=page9_2 on=page9_2 clickse="se7" enterse="se8" recthit=true cond="tf.goods_page==9"]
[button normal=page9 over=page9_2 on=page9_2 target=*New_Ab clickse="se7" enterse="se8" recthit=true cond="tf.goods_page!=9" exp="tf.goods_page=9"]

[endmacro]
;==================================================================
;物品按钮
[macro name=item_button]
[eval exp="draw_item_button()"]
[endmacro]
;==================================================================
;物品分类处理
[iscript]
function ab_div()
{
        var ab=[];
        ab[0]=[];
        ab[1]=[];
        ab[2]=[];
        ab[3]=[];
        ab[4]=[];
       
                for (var i=0;i<f.item.count;i++)
                {
                        //根物品数量是否大于0及物品分类,放入数组ab里的不同分栏
                        if (f.item[i][10]>0)
                        switch (f.item[i][2])
                        {
                                case 0:
                                ab[0].add(f.item[i]);
                                break;
                               
                                case 1:
                                ab[1].add(f.item[i]);
                                break;
                               
                                case 2:
                                ab[2].add(f.item[i]);
                                break;
                               
                                case 3:
                                ab[3].add(f.item[i]);
                                break;
                               
                                case 4:
                                ab[4].add(f.item[i]);
                                break;
                        }
                       
                }
       
                        //返回数组
                        return ab;
       
}
[endscript]
;==================================================================
;用tjs描绘物品按钮
[iscript]
function draw_item_button()
{
        //取得当前的分类列表
        var itemlist=f.item_arr[tf.ab];
        //假如当前分类列表不为空
        if (itemlist!=void)
        {
                //进行分页
                var maxpage=itemlist.count\11;
                if (itemlist.count%11>0) maxpage++;
                dm("本类道具一共有"+maxpage+"页");
               
                //假如指定的页数还在显示范围之内
                if (tf.goods_page<=maxpage)
                {
                        for (var i=0;i<11;i++)
                        {
                                //准备显示的物品编号
                                var item_index=(int)(tf.goods_page-1)*11+(int)i;
                                //假如超过了本类物品列表总数,跳出循环
                                if (item_index>=itemlist.count) break;       
                               
                                //否则就描绘按钮
                                   //设定按钮坐标
                                   kag.tagHandlers.locate(%["x" => 80, "y" => 30+i*30 ]);
                                  
                                   var mybutton=new Dictionary();
                                   mybutton.normal="item_button_blank";
                                   mybutton.exp="tf.选择物品=\""+itemlist[item_index][0]+"\""; //点下按钮时,tf.选择物品会返回物品名称
                                   //加上一行mybutton.target="*标签";可以在点下按钮后跳转到对应标签
                                   kag.tagHandlers.button(mybutton);
                                  
                                   //在按钮上描绘文字
                                   var button=kag.current.links[kag.current.links.count-1].object;
                                  
                                   //字体大小
                                   button.font.height=20;
                                  
                                   //文字在按钮上的坐标
                                   var x=0;
                                   var y=3;
                                  
                                   //描绘物品名称
                                   var str=itemlist[item_index][0];
                                  
                                   button.drawText(x,                           y, str, 0x000000);
                                   button.drawText(x+button.width,              y, str, 0x000000);
                                   button.drawText(x+button.width+button.width, y, str, 0x000000);
                                  
                                   //描绘物品数量
                                   x=180;
                                   y=3;
                                   str=itemlist[item_index][10];
                                  
                                   button.drawText(x,                           y, str, 0x000000);
                                   button.drawText(x+button.width,              y, str, 0x000000);
                                   button.drawText(x+button.width+button.width, y, str, 0x000000);
                                  
                        }
                }
               
        }
       
}
[endscript]
;==================================================================
[return]

[ 本帖最后由 全局变量D 于 2011-10-17 20:18 编辑 ]





顶部
全局变量D
亲友
Rank: 2



UID 14
精华 1
积分 1262
帖子 719
阅读权限 50
注册 2006-12-20
 
发表于 2011-10-17 14:59  资料  短消息  加为好友 
item.ks

*start

;载入宏
[call storage="macro_item.ks"]

[iscript]
//载入物品数据
//0名字 1是否被知道 2元素屬性(0~4分別是金木水火土) 3~9是加點orz.... 10擁有數量 11是否可以被合成..
f.item=
[
["阿法受體結抗劑","true",0,0,0,0,0,0,0,0,0,"false"],
["被塔受體結抗劑","true",4,0,0,0,0,0,0,0,0,"false"],
["西弟藍","true",2,0,0,0,0,0,0,0,0,"false"],
["度冷丁","true",2,0,0,0,0,0,0,0,0,"false"],
["利多卡音","true",2,0,0,0,0,0,0,0,0,"false"],
["浮賽米","true",2,0,0,0,0,0,0,0,0,"false"],
["本妥音那","true",1,0,0,0,0,0,0,0,0,"false"],
["弟高薪","true",2,0,0,0,0,0,0,0,0,"false"],
["本妥音那","true",1,0,0,0,0,0,0,0,0,"false"],
["蕭本地坪","true",2,0,0,0,0,0,0,0,0,"true"],
["譜耐落爾","true",2,0,0,0,0,0,0,0,0,"true"],
["為拉怕米","true",2,0,0,0,0,0,0,0,0,"true"],
["蕭譜那","true",2,0,0,0,0,0,0,0,0,"true"],
["股安酸假","true",2,0,0,0,0,0,0,0,0,"true"],
["柳蛋黃否定","true",2,0,0,0,0,0,0,0,0,"true"],
["蓋結抗劑","true",2,0,0,0,0,0,0,0,0,"true"],
["通道組致劑","true",2,0,0,0,0,0,0,0,0,"true"],
["類生命物質","true",2,0,0,0,0,0,0,0,0,"true"],
["類靈魂物質","true",3,0,0,0,0,0,0,0,0,"true"]
];

//测试方便,每个物品添加10个
for (var i=0;i<f.item.count;i++)
{
        f.item[i][10]+=10;
}

//对物品进行分类
f.item_arr=ab_div();

[endscript]

*firstpage
;设定初始值
[eval exp="tf.ab = 0" cond="tf.ab === void"]
[eval exp="tf.goods_page = 1" cond="tf.goods_page === void"]

[backlay]
[position layer="message3" frame="bgworks" visible=true opacity=0 top=0 left=0 height=640 width=480 marginl=0 marginr=0 margint=30 marginb=0 page="back"]
[current layer="message3" page="back"]
[er]
[type_button]
[page_button]
[item_button]
[trans method=crossfade time=500]
[wt]
[s]

*New_Ab
[current layer="message3" page="fore"]
[er]
[type_button]
[page_button]
[item_button]
[s]

*drclick
;这里做返回处理你懂的
[jump target=*New_Ab]






顶部
kurlapika
会员
Rank: 1



UID 2374
精华 0
积分 39
帖子 10
阅读权限 5
注册 2009-10-6
 
发表于 2011-10-17 15:11  资料  短消息  加为好友  添加 kurlapika 为MSN好友 通过MSN和 kurlapika 交谈
回复 #3 全局变量D 的帖子

萬分感謝d大人 >//口//<!
聽完d大分析感覺自己剛剛腦袋就像被槍打醒了TVT/////

顶部
 



清除 Cookies - 联系我们 - [Key Fans Club] the Council of Doujin-game Development and Promotion - Archiver - WAP
Powered by Discuz! 5.5.0 © 2001-2006 Comsenz Inc.
Processed in 1.016000 second(s), 9 queries , Gzip enabled
粤ICP备05060595号
[ 当前模板 - 天高云淡 v 设计制作 - 七星论坛 v 请使用1024*768或以上分辨率浏览本模板 ]
请勿删除或修改此处版权图示