forked from M1A2C/AviutlDevelopingScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorPalette.anm
More file actions
81 lines (74 loc) · 2.03 KB
/
ColorPalette.anm
File metadata and controls
81 lines (74 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
----------------------------
@ColorPalette
----------------------------
--track0:type,0,1000,0,1
--track1:size,0,2000,200,1
--track2:line,0,4000,4000,1
--track3:表示,0,1,1,1
--check0:パレット出力,0
--dialog:テキストを表示する/chk,local isDisText=1;テキストの色/col,local col=0x000000;
local lst=type
local type=obj.track0
local i
local size=obj.track1
local line=obj.track2
local ox=obj.ox
local oy=obj.oy
local tmp
local scpath, oripath=obj.getinfo("script_path")
local path
obj.zoom=1
local colnum,colfol
local t,j,pt,ptnum
require("colors") --colors.luaより配列を読み込み
require("rikky_module")
if(lst(colors)=="table") then
local path=obj.getinfo("script_path")
local pathc=path.."\ColorPaletteFolder"
colfol=rikky_module.dir(pathc,".lua")
for i=1,#colfol
require(colfol[i])
if(lst(usercolors)=="table") then
for j=1,#userColors do
if(lst(usercolors[j]=="table")) and (lst(usercolors[j]["name"]==string)) and (#usercolors[j]==5) then
table.insert(colors,userColors[j])
end
end
end
end
if(type>0 and type<(#colors+1)) then
if(obj.track3==1) then
colnum=#colors[type]
for i=1,colnum do
obj.load("figure","四角形",colors[type][i],size,line)
obj.draw(size*(math.ceil(colnum/2))*-1+i*size)
end
if(isDisText==1) then
obj.setfont("メイリオ",100,0,col)
obj.load(colors[type]["name"])
obj.draw(ox,oy+size)
end
end
if(obj.check0) then
if(CP==nil) then CP={} end
CP["layer"..obj.layer]={color=colors[type], name=colors[type]["name"]}
end
elseif(type==0) then
if((isDisText==1) and (obj.track3==1)) then
obj.setfont("メイリオ",100,0,col)
obj.load("typeは現在"..tostring(#colors).."つ選べます。")
obj.draw(ox,oy+size)
end
else
if((isDisText==1) and (obj.track3==1)) then
obj.setfont("メイリオ",100,0,col)
obj.load("無効なtypeです。\ntypeは現在1から"..tostring(#colors).."選べます。")
obj.draw(ox,oy+size)
end
end
else
obj.setfont("メイリオ",100,0,col)
obj.load("colors配列が見つかりませんでした。\n\n正常に読み込まれていないか、\ncolors.luaが削除されている可能性があります。")
obj.draw(ox,oy+size)
end
tmp=path