⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.gml

📁 在线游戏最新服务器端源代码
💻 GML
字号:
#ifndef _COMLIST_
#define _COMLIST_

#define BTNCOLOR R140G180B170
#define BTNCOLORH R180G220B210
#define BTNCOLORL R100G100B90
#define LISTBKIMG dark(6)
#define LISTWIDTH 10
<style>
.listscrollUp:div{
	size=#(LISTWIDTH),#(LISTWIDTH);
	bkimg=btnup(#(BTNCOLOR));
	draw={offsetorg(width/2-1,height/2+2);pixel(0,-3,0);line(-1,-2,1,-2,0);
		line(-2,-1,2,-1,0);line(-3,0,3,0,0)};
	OnLButtonDown={<:$[pid.pid] voffset=0,13>
		<: bkimg=btndown(#(BTNCOLOR));OnUpdate={<:$[pid.pid] voffset=0,13>}:2>};
	OnLButtonUp={<: OnUpdate=null;bkimg=btnup(#(BTNCOLOR))>};
}
.listscrollDown:div{
	size=#(LISTWIDTH),#(LISTWIDTH);
	bkimg=btnup(#(BTNCOLOR));
	draw={offsetorg(width/2-1,height/2-2);
		pixel(0,3,0);line(-1,2,1,2,0);line(-2,1,2,1,0);line(-3,0,3,0,0)}
	OnLButtonDown={<: pid.pid.voffset=0,-13;
		bkimg=btndown(#(BTNCOLOR));OnUpdate={<:$[pid.pid] voffset=0,-13>}:2>
		};
	OnLButtonUp={<: OnUpdate=null;bkimg=btnup(#(BTNCOLOR))>};
	OnSize={<: pos=0,pid.height-#(LISTWIDTH)>};
}
.listscrollSpan:div{
	bkimg=btnup(#(BTNCOLOR));
	OnLButtonDown={<: follow=mouse(0,0,setpan)>};
	OnLButtonUp={<: follow=null>};
	Onsetpan={<: y=(eventparam1-#(LISTWIDTH));
		ymax=(pid.height-height-#(LISTWIDTH)*2);
		if=(y<0)?{y=0;};
		if=(y>ymax)?{y=(ymax);};
		ypos=y+pid.width;
		y=(-y*pid.pid.vheight/ymax);pid.pid.vypos=y;>
	};
	draw={line(width/2-2,4,width/2-2,height-5,#(BTNCOLORH));
		line(width/2-1,4,width/2-1,height-5,#(BTNCOLORL));
		line(width/2,4,width/2,height-5,#(BTNCOLORH));
		line(width/2+1,4,width/2+1,height-5,#(BTNCOLORL));
		}
	OnMapsetpan={<:	if=((pid.pid.mapheight-pid.pid.height)<3)?{pid.show=0;}:{
				th=(pid.height-#(LISTWIDTH)*2);
				height=(pid.pid.height*th/pid.pid.mapheight);
				if=(height<15)?{height=15};
				th=(th-height);
				ypos=-pid.pid.vypos*th/(pid.pid.mapheight-pid.pid.height)+#(LISTWIDTH);
				pid.show=1}
		>
	}
	OnSize={<: eve=Mapsetpan>};
}
.listscroll:div{
	bkimg=dark(7);
	abspos=1;
	zorder=top;
	clip=0;
	Oncreate#pan={
				<: pid.scrollobj=*id;eve=size>
				<listscrollUp></listscrollUp>
				<listscrollSpan pid.spanobj=*id;pid.pid.spanobj=*id;width=pid.width></listscrollSpan>
				<listscrollDown></listscrollDown>
				<: eve=size>
	}
	OnLButtonDown={<: spanobj.eve=setpan,(0,mouseypos-(spanobj.height/2))>};
	OnSize={
		<: size=#(LISTWIDTH),pid.height;
		 if=(pid.rightscroll)?{pos=pid.width-width,0}:{pos=0,0};
		enumsub={<: eve=size>}>
		};
}
.list:map{
	bkimg=#(LISTBKIMG);
	cache=0;
	movestep=1;
	cache=0;
	scrollobj=0;
	autosubpos=vert(15,3,1,true,115);
	OnCreate#scroll={<listscroll show=0;>};
	ifchged(voffset)={<: spanobj.eve=Mapsetpan>};
	ifchged(size)={<: scrollobj.eve=size>}
	//自动移到尾巴
	OnMapsizechg={<: voffset=0,-10000>};
	//是否使用右滚动条(0=左)
	rightscroll=0;
}
</style>
#endif //_COMLIST_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -