├── 1.png
├── 2-bit
├── 1
└── main.wlua
├── LICENSE
├── LICENSE.zh_cn
├── README.md
├── SciTE.session
├── anim
└── run
│ ├── 1__000.png
│ ├── 1__001.png
│ ├── 1__002.png
│ ├── 1__003.png
│ ├── 1__004.png
│ ├── 1__005.png
│ ├── 1__006.png
│ ├── 1__007.png
│ └── 1__008.png
├── bin
├── 1.exe
├── Spriter
│ └── Spriter.7z
├── clibs
│ ├── LuaXML_lib.dll
│ ├── LuaXml.lua
│ ├── git
│ │ ├── core.dll
│ │ └── core.dylib
│ ├── lfs.dll
│ ├── lfs.dylib
│ ├── liblua.dll
│ ├── libzlib.dll
│ ├── mime
│ │ ├── core.dll
│ │ └── core.dylib
│ └── socket
│ │ ├── core.dll
│ │ └── core.dylib
├── clibs52
│ ├── liblua.dll
│ ├── mime
│ │ ├── core.dll
│ │ └── core.dylib
│ └── socket
│ │ ├── core.dll
│ │ └── core.dylib
├── clibs53
│ ├── mime
│ │ ├── core.dll
│ │ └── core.dylib
│ └── socket
│ │ ├── core.dll
│ │ └── core.dylib
├── ktools
│ ├── CORE_RL_Magick++_.dll
│ ├── CORE_RL_bzlib_.dll
│ ├── CORE_RL_glib_.dll
│ ├── CORE_RL_lcms_.dll
│ ├── CORE_RL_lqr_.dll
│ ├── CORE_RL_magick_.dll
│ ├── CORE_RL_png_.dll
│ ├── CORE_RL_ttf_.dll
│ ├── CORE_RL_wand_.dll
│ ├── CORE_RL_zlib_.dll
│ ├── IM_MOD_RL_png_.dll
│ ├── IM_MOD_RL_rgb_.dll
│ ├── IM_MOD_RL_xc_.dll
│ ├── krane.exe
│ ├── ktech.exe
│ └── run.lua
├── liblua.dylib
├── liblua52.dylib
├── liblua53.dylib
├── libwx.dylib
├── linux
│ ├── x64
│ │ ├── clibs
│ │ │ ├── git
│ │ │ │ └── core.so
│ │ │ ├── lfs.so
│ │ │ ├── mime
│ │ │ │ └── core.so
│ │ │ └── socket
│ │ │ │ └── core.so
│ │ ├── clibs52
│ │ │ ├── mime
│ │ │ │ └── core.so
│ │ │ └── socket
│ │ │ │ └── core.so
│ │ ├── clibs53
│ │ │ ├── mime
│ │ │ │ └── core.so
│ │ │ └── socket
│ │ │ │ └── core.so
│ │ ├── libwx.so
│ │ ├── lua
│ │ ├── lua52
│ │ └── lua53
│ └── x86
│ │ ├── clibs
│ │ ├── git
│ │ │ └── core.so
│ │ ├── lfs.so
│ │ ├── mime
│ │ │ └── core.so
│ │ └── socket
│ │ │ └── core.so
│ │ ├── clibs52
│ │ ├── mime
│ │ │ └── core.so
│ │ └── socket
│ │ │ └── core.so
│ │ ├── clibs53
│ │ ├── mime
│ │ │ └── core.so
│ │ └── socket
│ │ │ └── core.so
│ │ ├── libwx.so
│ │ ├── lua
│ │ ├── lua52
│ │ └── lua53
├── lua
├── lua.app
│ └── Contents
│ │ ├── Info.plist
│ │ └── MacOS
│ │ ├── lua
│ │ ├── lua52
│ │ └── lua53
├── lua.exe
├── lua5.1.dll
├── lua51.dll
├── lua52
├── lua52.dll
├── lua52.exe
├── lua53
├── lua53.dll
├── lua53.exe
├── winapi.dll
└── wx.dll
├── data
├── strings.lua
└── version.lua
├── doc
├── 动画制作软件教程.md
├── 动画资源规范.md
├── 图片素材规范.md
└── 组件.md
├── ds_mod_creator.sh
├── examples
├── icebox-Harvestable
│ ├── modinfo.lua
│ └── modmain.lua
├── mod例子-人物
│ ├── anim
│ │ └── wod.zip
│ ├── bigportraits
│ │ ├── wod.tex
│ │ └── wod.xml
│ ├── images
│ │ ├── saveslot_portraits
│ │ │ ├── wod.tex
│ │ │ └── wod.xml
│ │ └── selectscreen_portraits
│ │ │ ├── wod.tex
│ │ │ ├── wod.xml
│ │ │ ├── wod_silho.tex
│ │ │ └── wod_silho.xml
│ ├── modinfo.lua
│ ├── modmain.lua
│ ├── samplecharacter (1)
│ │ └── samplecharacter
│ │ │ ├── anim
│ │ │ ├── template_player_character.png
│ │ │ └── wod.zip
│ │ │ ├── bigportraits
│ │ │ ├── template_bigportrait.png
│ │ │ ├── template_bigportrait.tex
│ │ │ ├── template_bigportrait.xml
│ │ │ ├── wod.tex
│ │ │ └── wod.xml
│ │ │ ├── images
│ │ │ ├── saveslot_portraits
│ │ │ │ ├── template_save.png
│ │ │ │ ├── template_save.tex
│ │ │ │ ├── template_save.xml
│ │ │ │ ├── wod.tex
│ │ │ │ └── wod.xml
│ │ │ └── selectscreen_portraits
│ │ │ │ ├── template_selectscreen_portraits.png
│ │ │ │ ├── template_selectscreen_portraits.tex
│ │ │ │ ├── template_selectscreen_portraits.xml
│ │ │ │ ├── wod.tex
│ │ │ │ ├── wod.xml
│ │ │ │ ├── wod_silho.tex
│ │ │ │ └── wod_silho.xml
│ │ │ ├── modinfo.lua
│ │ │ ├── modmain.lua
│ │ │ └── scripts
│ │ │ └── prefabs
│ │ │ └── wod.lua
│ ├── samplecharacter_templates1
│ │ └── samplecharacter
│ │ │ ├── anim
│ │ │ └── template_player_character.png
│ │ │ └── images
│ │ │ ├── saveslot_portraits
│ │ │ └── template_save.png
│ │ │ └── selectscreen_portraits
│ │ │ └── template_selectscreen_portraits.png
│ ├── samplecharacter_templates2
│ │ └── samplecharacter
│ │ │ └── bigportraits
│ │ │ └── template_bigportrait.png
│ └── scripts
│ │ └── prefabs
│ │ └── wod.lua
├── mod例子-声音
│ ├── basic3dsound.fdt
│ ├── images
│ │ ├── modicon.png
│ │ ├── modicon.tex
│ │ └── modicon.xml
│ ├── modinfo.lua
│ ├── modmain.lua
│ ├── sound
│ │ ├── modsounds.fsb
│ │ └── soundexample.fev
│ ├── sound_source
│ │ └── bubble_gum_pop.wav
│ └── soundexample.fdp
├── mod例子-武器
│ ├── anim
│ │ ├── swap_wand.zip
│ │ └── wand.zip
│ ├── exported
│ │ ├── swap_wand
│ │ │ ├── swap_wand.scml
│ │ │ ├── swap_wand.zip
│ │ │ └── wand
│ │ │ │ └── wand.png
│ │ └── wand
│ │ │ ├── wand.scml
│ │ │ ├── wand.zip
│ │ │ └── wand
│ │ │ └── wand.png
│ ├── images
│ │ └── inventoryimages
│ │ │ ├── wand.png
│ │ │ ├── wand.tex
│ │ │ └── wand.xml
│ ├── modinfo.lua
│ ├── modmain.lua
│ └── scripts
│ │ └── prefabs
│ │ └── wand.lua
├── mod例子-物品
│ ├── anim
│ │ └── myprefab_build.zip
│ ├── base
│ │ └── base_smilie.png
│ ├── exported
│ │ └── myprefab
│ │ │ ├── base.png
│ │ │ ├── myprefab_build.scml
│ │ │ ├── myprefab_build.scml.txt
│ │ │ ├── myprefab_build.zip
│ │ │ └── shadow.png
│ ├── images
│ │ ├── inventoryimages
│ │ │ ├── myprefab.png
│ │ │ ├── myprefab.tex
│ │ │ └── myprefab.xml
│ │ ├── modicon.png
│ │ ├── modicon.tex
│ │ └── modicon.xml
│ ├── modinfo.lua
│ ├── modmain.lua
│ └── scripts
│ │ └── prefabs
│ │ └── sampleprefabdef.lua
└── mod例子-组件
│ ├── modicon.tex
│ ├── modicon.xml
│ ├── modinfo.lua
│ ├── modmain.lua
│ └── scripts
│ ├── README.txt
│ └── components
│ └── myowncomponent.lua
├── image
└── spriter
│ ├── dh1.png
│ ├── dh2.png
│ ├── dh3.png
│ ├── dh4.png
│ ├── jm1.png
│ ├── jm2.png
│ ├── jm3.png
│ ├── jm4.png
│ ├── sm1.png
│ └── zy1.png
├── mods
├── boxlock
│ ├── modinfo.lua
│ ├── modmain.lua
│ ├── scripts
│ │ └── widgets
│ │ │ └── mmscreen.lua
│ └── 说明.md
├── pick-level1
│ ├── modinfo.lua
│ └── scripts
│ │ └── components
│ │ └── terraformer.lua
├── pick-level2
│ ├── modinfo.lua
│ └── scripts
│ │ └── components
│ │ └── terraformer.lua
├── pick-level3
│ └── modinfo.lua
├── pick-level4
│ └── modinfo.lua
├── pick-level5
│ └── modinfo.lua
├── 芦苇
│ ├── modinfo.lua
│ ├── modmain.lua
│ └── scripts
│ │ └── prefabs
│ │ ├── plantables.lua
│ │ └── reeds.lua
└── 蓝脚印
│ ├── anim
│ └── koalefant_tracks.zip
│ ├── modinfo.lua
│ └── modmain.lua
├── module
├── ID.lua
├── api.lua
├── apiclass.lua
├── aui.lua
├── class.lua
├── editor.lua
├── event.lua
├── grid.lua
├── menu.lua
├── notebook.lua
├── openfile.lua
├── process.lua
├── run.lua
├── runtext.lua
├── text.lua
├── win.lua
└── wxtree.lua
├── res
├── 1.png
├── ICO.jpg
├── ICO.xcf
├── lua中文文法.md
└── lua文法.md
├── run.lua
├── run.wlua
├── src
└── main.lua
├── tool
├── mod处理
│ └── mod2luac.lua
├── osystem.lua
├── tablesave.lua
├── 批量tex转换
│ ├── README.md
│ ├── tex2png.lua
│ └── xml2png.lua
├── 批量动画--linux
│ ├── README.md
│ ├── copyall.lua
│ ├── getrequire.lua
│ ├── main.lua
│ ├── re.lua
│ ├── tablesave.lua
│ ├── unallzip.lua
│ └── zip.lua
├── 批量动画
│ ├── README.md
│ ├── copyall.lua
│ ├── getrequire.lua
│ ├── main.lua
│ ├── re.lua
│ ├── tablesave.lua
│ ├── unallzip.lua
│ └── zip.lua
└── 饥荒字体
│ ├── fnt2xml.lua
│ ├── fontcn.xml
│ ├── sc.fnt
│ └── sc_0.png
├── win32run.bat
├── wxlua相关
├── 代码区
│ ├── 1.lua
│ ├── aui1.wlua
│ ├── aui教程 2.wlua
│ ├── aui教程 3.wlua
│ ├── aui教程.wlua
│ ├── editor.lua
│ ├── editor.wx.wlua
│ └── wxtree.lua
└── 自带例程
│ ├── auidemo.wx - 复制.wlua
│ ├── auidemo.wx.wlua
│ ├── bindings.wx.wlua
│ ├── calculator.wx.wlua
│ ├── calculator.xrc
│ ├── choices.wx.wlua
│ ├── controls.wx.wlua
│ ├── coroutine.wx.wlua
│ ├── dialog.wx.wlua
│ ├── grid.wx.wlua
│ ├── gridtable.wx.wlua
│ ├── htmlwin.wx.wlua
│ ├── image
│ ├── cmyk.jpg
│ ├── horse.bmp
│ ├── horse.cur
│ ├── horse.gif
│ ├── horse.ico
│ ├── horse.jpg
│ ├── horse.pcx
│ ├── horse.png
│ ├── horse.pnm
│ ├── horse.tga
│ ├── horse.tif
│ ├── horse.xpm
│ ├── horse3.ani
│ ├── horse_ag.pnm
│ ├── horse_rg.pnm
│ ├── image.wx.lua
│ ├── smile.xbm
│ ├── smile.xpm
│ └── toucan.png
│ ├── luamodule.wx.wlua
│ ├── mdi.wx.wlua
│ ├── media.wx.wlua
│ ├── minimal.wx.wlua
│ ├── picker.wx.wlua
│ ├── printing.wx.wlua
│ ├── scribble.wx.wlua
│ ├── settings.wx.wlua
│ ├── sizer.wx.wlua
│ ├── tree.wx.wlua
│ ├── unittest.wx.wlua
│ ├── validator.wx.wlua
│ ├── veryminimal.wx.wlua
│ └── wxluasudoku.wx.wlua
└── 待办事宜.md
/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/1.png
--------------------------------------------------------------------------------
/2-bit/main.wlua:
--------------------------------------------------------------------------------
1 | package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
2 |
3 |
4 |
5 | require("wx")
6 |
7 |
8 |
9 |
10 | function openfile(path)
11 | local f = io.open(path,"rb");
12 | return f
13 | end
14 |
15 |
16 |
17 | function filetogrid(filep)
18 | local maxrow=8
19 | s=""
20 | file=io.open("1","rb")
21 | local row,col=0,0
22 | s=file:read(1)
23 | while s do
24 |
25 |
26 | grid:SetCellValue(row, col,string.format( "%x" , string.byte(s) ))
27 | if row ==maxrow then
28 | col=col+1
29 | row=0
30 | else
31 | row=row+1
32 | end
33 | s=file:read(1)
34 | end
35 | end
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxLua wxGrid Sample",
46 | wx.wxPoint(25, 25), wx.wxSize(350, 250))
47 |
48 |
49 |
50 | grid = wx.wxGrid(frame, wx.wxID_ANY)
51 |
52 | grid:CreateGrid(10, 8)
53 | grid:SetColSize(3, 200)
54 | grid:SetRowSize(4, 45)
55 | grid:SetCellValue(0, 0, "First cell")
56 | grid:SetCellValue(1, 1, "Another cell")
57 | grid:SetCellValue(2, 2, "Yet another cell")
58 | grid:SetCellFont(0, 0, wx.wxFont(10, wx.wxROMAN, wx.wxITALIC, wx.wxNORMAL))
59 | grid:SetCellTextColour(1, 1, wx.wxRED)
60 | grid:SetCellBackgroundColour(2, 2, wx.wxCYAN)
61 |
62 | filetogrid("1")
63 |
64 | frame:Show(true)
65 | wx.wxGetApp():MainLoop()
66 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ds_mod_creator(unfinished)
2 | ==============
3 | 全称Don't Starve's MOD Creator.
4 | 饥荒mod制作平台,本项目的设计初衷是为了方便mod工作者制作饥荒的mod,类似于一个IDE,集成了ds_mod_tools(`MIT`协议)工具与ktools(`GPL`协议)。
5 |
6 | 本项目使用lua+`wxlua`(一个wxwidget与lua的绑定)编写,还有一部分C++用来处理上述两个工具与lua的交互。
7 | 这个项目还未完成。
8 |
9 | ================================================
10 |
11 | 如何运行
12 | =================================================
13 | window下双击win32run.bat,或者命令行:
14 | ```bat
15 | bin\lua.exe src\main.lua
16 | ```
17 | linux 下运行
18 | ```sh
19 | ./ds_mod_creator.sh
20 | ```
21 | 或者 在32位
22 | ```sh
23 | bin/linux/x86/lua src/main.lua
24 | ```
25 | 在64位
26 | ```sh
27 | bin/linux/x64/lua src/main.lua
28 | ```
29 |
30 | 加入我们
31 | ==============================================================
32 | 有github账号的点击右上方的fork,clone一份到你的pc上,再pull给我。
33 |
34 | 没有github账号的,点击右方的`Download Zip`按钮下载这个项目,要提交代码的话联系`1486276329@qq.com`。
35 |
36 |
37 |
--------------------------------------------------------------------------------
/SciTE.session:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/SciTE.session
--------------------------------------------------------------------------------
/anim/run/1__000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__000.png
--------------------------------------------------------------------------------
/anim/run/1__001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__001.png
--------------------------------------------------------------------------------
/anim/run/1__002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__002.png
--------------------------------------------------------------------------------
/anim/run/1__003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__003.png
--------------------------------------------------------------------------------
/anim/run/1__004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__004.png
--------------------------------------------------------------------------------
/anim/run/1__005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__005.png
--------------------------------------------------------------------------------
/anim/run/1__006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__006.png
--------------------------------------------------------------------------------
/anim/run/1__007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__007.png
--------------------------------------------------------------------------------
/anim/run/1__008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/anim/run/1__008.png
--------------------------------------------------------------------------------
/bin/1.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/1.exe
--------------------------------------------------------------------------------
/bin/Spriter/Spriter.7z:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/Spriter/Spriter.7z
--------------------------------------------------------------------------------
/bin/clibs/LuaXML_lib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/LuaXML_lib.dll
--------------------------------------------------------------------------------
/bin/clibs/LuaXml.lua:
--------------------------------------------------------------------------------
1 | require("LuaXML_lib")
2 |
3 | local base = _G
4 | local xml = xml
5 | module("xml")
6 |
7 | -- symbolic name for tag index, this allows accessing the tag by var[xml.TAG]
8 | TAG = 0
9 |
10 | -- sets or returns tag of a LuaXML object
11 | function tag(var,tag)
12 | if base.type(var)~="table" then return end
13 | if base.type(tag)=="nil" then
14 | return var[TAG]
15 | end
16 | var[TAG] = tag
17 | end
18 |
19 | -- creates a new LuaXML object either by setting the metatable of an existing Lua table or by setting its tag
20 | function new(arg)
21 | if base.type(arg)=="table" then
22 | base.setmetatable(arg,{__index=xml, __tostring=xml.str})
23 | return arg
24 | end
25 | local var={}
26 | base.setmetatable(var,{__index=xml, __tostring=xml.str})
27 | if base.type(arg)=="string" then var[TAG]=arg end
28 | return var
29 | end
30 |
31 | -- appends a new subordinate LuaXML object to an existing one, optionally sets tag
32 | function append(var,tag)
33 | if base.type(var)~="table" then return end
34 | local newVar = new(tag)
35 | var[#var+1] = newVar
36 | return newVar
37 | end
38 |
39 | -- converts any Lua var into an XML string
40 | function str(var,indent,tagValue)
41 | if base.type(var)=="nil" then return end
42 | local indent = indent or 0
43 | local indentStr=""
44 | for i = 1,indent do indentStr=indentStr.." " end
45 | local tableStr=""
46 |
47 | if base.type(var)=="table" then
48 | local tag = var[0] or tagValue or base.type(var)
49 | local s = indentStr.."<"..tag
50 | for k,v in base.pairs(var) do -- attributes
51 | if base.type(k)=="string" then
52 | if base.type(v)=="table" and k~="_M" then -- otherwise recursiveness imminent
53 | tableStr = tableStr..str(v,indent+1,k)
54 | else
55 | s = s.." "..k.."=\""..encode(base.tostring(v)).."\""
56 | end
57 | end
58 | end
59 | if #var==0 and #tableStr==0 then
60 | s = s.." />\n"
61 | elseif #var==1 and base.type(var[1])~="table" and #tableStr==0 then -- single element
62 | s = s..">"..encode(base.tostring(var[1]))..""..tag..">\n"
63 | else
64 | s = s..">\n"
65 | for k,v in base.ipairs(var) do -- elements
66 | if base.type(v)=="string" then
67 | s = s..indentStr.." "..encode(v).." \n"
68 | else
69 | s = s..str(v,indent+1)
70 | end
71 | end
72 | s=s..tableStr..indentStr..""..tag..">\n"
73 | end
74 | return s
75 | else
76 | local tag = base.type(var)
77 | return indentStr.."<"..tag.."> "..encode(base.tostring(var)).." "..tag..">\n"
78 | end
79 | end
80 |
81 |
82 | -- saves a Lua var as xml file
83 | function save(var,filename)
84 | if not var then return end
85 | if not filename or #filename==0 then return end
86 | local file = base.io.open(filename,"w")
87 | file:write("\n\n\n")
88 | file:write(str(var))
89 | base.io.close(file)
90 | end
91 |
92 |
93 | -- recursively parses a Lua table for a substatement fitting to the provided tag and attribute
94 | function find(var, tag, attributeKey,attributeValue)
95 | -- check input:
96 | if base.type(var)~="table" then return end
97 | if base.type(tag)=="string" and #tag==0 then tag=nil end
98 | if base.type(attributeKey)~="string" or #attributeKey==0 then attributeKey=nil end
99 | if base.type(attributeValue)=="string" and #attributeValue==0 then attributeValue=nil end
100 | -- compare this table:
101 | if tag~=nil then
102 | if var[0]==tag and ( attributeValue == nil or var[attributeKey]==attributeValue ) then
103 | base.setmetatable(var,{__index=xml, __tostring=xml.str})
104 | return var
105 | end
106 | else
107 | if attributeValue == nil or var[attributeKey]==attributeValue then
108 | base.setmetatable(var,{__index=xml, __tostring=xml.str})
109 | return var
110 | end
111 | end
112 | -- recursively parse subtags:
113 | for k,v in base.ipairs(var) do
114 | if base.type(v)=="table" then
115 | local ret = find(v, tag, attributeKey,attributeValue)
116 | if ret ~= nil then return ret end
117 | end
118 | end
119 | end
120 |
--------------------------------------------------------------------------------
/bin/clibs/git/core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/git/core.dll
--------------------------------------------------------------------------------
/bin/clibs/git/core.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/git/core.dylib
--------------------------------------------------------------------------------
/bin/clibs/lfs.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/lfs.dll
--------------------------------------------------------------------------------
/bin/clibs/lfs.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/lfs.dylib
--------------------------------------------------------------------------------
/bin/clibs/liblua.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/liblua.dll
--------------------------------------------------------------------------------
/bin/clibs/libzlib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/libzlib.dll
--------------------------------------------------------------------------------
/bin/clibs/mime/core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/mime/core.dll
--------------------------------------------------------------------------------
/bin/clibs/mime/core.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/mime/core.dylib
--------------------------------------------------------------------------------
/bin/clibs/socket/core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/socket/core.dll
--------------------------------------------------------------------------------
/bin/clibs/socket/core.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs/socket/core.dylib
--------------------------------------------------------------------------------
/bin/clibs52/liblua.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs52/liblua.dll
--------------------------------------------------------------------------------
/bin/clibs52/mime/core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs52/mime/core.dll
--------------------------------------------------------------------------------
/bin/clibs52/mime/core.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs52/mime/core.dylib
--------------------------------------------------------------------------------
/bin/clibs52/socket/core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs52/socket/core.dll
--------------------------------------------------------------------------------
/bin/clibs52/socket/core.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs52/socket/core.dylib
--------------------------------------------------------------------------------
/bin/clibs53/mime/core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs53/mime/core.dll
--------------------------------------------------------------------------------
/bin/clibs53/mime/core.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs53/mime/core.dylib
--------------------------------------------------------------------------------
/bin/clibs53/socket/core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs53/socket/core.dll
--------------------------------------------------------------------------------
/bin/clibs53/socket/core.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/clibs53/socket/core.dylib
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_Magick++_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_Magick++_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_bzlib_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_bzlib_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_glib_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_glib_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_lcms_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_lcms_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_lqr_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_lqr_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_magick_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_magick_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_png_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_png_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_ttf_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_ttf_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_wand_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_wand_.dll
--------------------------------------------------------------------------------
/bin/ktools/CORE_RL_zlib_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/CORE_RL_zlib_.dll
--------------------------------------------------------------------------------
/bin/ktools/IM_MOD_RL_png_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/IM_MOD_RL_png_.dll
--------------------------------------------------------------------------------
/bin/ktools/IM_MOD_RL_rgb_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/IM_MOD_RL_rgb_.dll
--------------------------------------------------------------------------------
/bin/ktools/IM_MOD_RL_xc_.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/IM_MOD_RL_xc_.dll
--------------------------------------------------------------------------------
/bin/ktools/krane.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/krane.exe
--------------------------------------------------------------------------------
/bin/ktools/ktech.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/ktools/ktech.exe
--------------------------------------------------------------------------------
/bin/ktools/run.lua:
--------------------------------------------------------------------------------
1 | os.execute("krane anim.bin build.bin czf\\")
2 |
--------------------------------------------------------------------------------
/bin/liblua.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/liblua.dylib
--------------------------------------------------------------------------------
/bin/liblua52.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/liblua52.dylib
--------------------------------------------------------------------------------
/bin/liblua53.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/liblua53.dylib
--------------------------------------------------------------------------------
/bin/libwx.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/libwx.dylib
--------------------------------------------------------------------------------
/bin/linux/x64/clibs/git/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/clibs/git/core.so
--------------------------------------------------------------------------------
/bin/linux/x64/clibs/lfs.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/clibs/lfs.so
--------------------------------------------------------------------------------
/bin/linux/x64/clibs/mime/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/clibs/mime/core.so
--------------------------------------------------------------------------------
/bin/linux/x64/clibs/socket/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/clibs/socket/core.so
--------------------------------------------------------------------------------
/bin/linux/x64/clibs52/mime/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/clibs52/mime/core.so
--------------------------------------------------------------------------------
/bin/linux/x64/clibs52/socket/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/clibs52/socket/core.so
--------------------------------------------------------------------------------
/bin/linux/x64/clibs53/mime/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/clibs53/mime/core.so
--------------------------------------------------------------------------------
/bin/linux/x64/clibs53/socket/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/clibs53/socket/core.so
--------------------------------------------------------------------------------
/bin/linux/x64/libwx.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/libwx.so
--------------------------------------------------------------------------------
/bin/linux/x64/lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/lua
--------------------------------------------------------------------------------
/bin/linux/x64/lua52:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/lua52
--------------------------------------------------------------------------------
/bin/linux/x64/lua53:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x64/lua53
--------------------------------------------------------------------------------
/bin/linux/x86/clibs/git/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/clibs/git/core.so
--------------------------------------------------------------------------------
/bin/linux/x86/clibs/lfs.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/clibs/lfs.so
--------------------------------------------------------------------------------
/bin/linux/x86/clibs/mime/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/clibs/mime/core.so
--------------------------------------------------------------------------------
/bin/linux/x86/clibs/socket/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/clibs/socket/core.so
--------------------------------------------------------------------------------
/bin/linux/x86/clibs52/mime/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/clibs52/mime/core.so
--------------------------------------------------------------------------------
/bin/linux/x86/clibs52/socket/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/clibs52/socket/core.so
--------------------------------------------------------------------------------
/bin/linux/x86/clibs53/mime/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/clibs53/mime/core.so
--------------------------------------------------------------------------------
/bin/linux/x86/clibs53/socket/core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/clibs53/socket/core.so
--------------------------------------------------------------------------------
/bin/linux/x86/libwx.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/libwx.so
--------------------------------------------------------------------------------
/bin/linux/x86/lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/lua
--------------------------------------------------------------------------------
/bin/linux/x86/lua52:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/lua52
--------------------------------------------------------------------------------
/bin/linux/x86/lua53:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/linux/x86/lua53
--------------------------------------------------------------------------------
/bin/lua:
--------------------------------------------------------------------------------
1 | lua.app/Contents/MacOS/lua
--------------------------------------------------------------------------------
/bin/lua.app/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | lua
9 | CFBundleDisplayName
10 | Lua
11 | CFBundleGetInfoString
12 |
13 | CFBundleIconFile
14 |
15 | CFBundleIdentifier
16 | org.Lua.LuaInterpreter
17 | CFBundleInfoDictionaryVersion
18 | 6.0
19 | CFBundleLongVersionString
20 |
21 | CFBundleName
22 | Lua
23 | CFBundlePackageType
24 | APPL
25 | CFBundleShortVersionString
26 |
27 | CFBundleSignature
28 | ????
29 | CFBundleVersion
30 |
31 | CSResourcesFileMapped
32 |
33 | LSRequiresCarbon
34 |
35 | NSHumanReadableCopyright
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/bin/lua.app/Contents/MacOS/lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua.app/Contents/MacOS/lua
--------------------------------------------------------------------------------
/bin/lua.app/Contents/MacOS/lua52:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua.app/Contents/MacOS/lua52
--------------------------------------------------------------------------------
/bin/lua.app/Contents/MacOS/lua53:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua.app/Contents/MacOS/lua53
--------------------------------------------------------------------------------
/bin/lua.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua.exe
--------------------------------------------------------------------------------
/bin/lua5.1.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua5.1.dll
--------------------------------------------------------------------------------
/bin/lua51.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua51.dll
--------------------------------------------------------------------------------
/bin/lua52:
--------------------------------------------------------------------------------
1 | lua.app/Contents/MacOS/lua52
--------------------------------------------------------------------------------
/bin/lua52.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua52.dll
--------------------------------------------------------------------------------
/bin/lua52.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua52.exe
--------------------------------------------------------------------------------
/bin/lua53:
--------------------------------------------------------------------------------
1 | lua.app/Contents/MacOS/lua53
2 |
--------------------------------------------------------------------------------
/bin/lua53.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua53.dll
--------------------------------------------------------------------------------
/bin/lua53.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/lua53.exe
--------------------------------------------------------------------------------
/bin/winapi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/winapi.dll
--------------------------------------------------------------------------------
/bin/wx.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/bin/wx.dll
--------------------------------------------------------------------------------
/data/strings.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/data/strings.lua
--------------------------------------------------------------------------------
/data/version.lua:
--------------------------------------------------------------------------------
1 | return {
2 | version=[[dev 0.1]]
3 | }
--------------------------------------------------------------------------------
/doc/动画制作软件教程.md:
--------------------------------------------------------------------------------
1 | 动画制作教程
2 | ================================
3 |
4 | >本文档来教授关于骨骼动画与Spriter软件的基础知识.
5 |
6 | 相关链接
7 | ---------------------------
8 |
9 | [骨骼动画-维基百科](http://en.wikipedia.org/wiki/Skeletal_animation)
10 |
11 | [Spriter官网](http://brashmonkey.com/)
12 |
13 | [klei 论坛教程](http://forums.kleientertainment.com/topic/28021-getting-started-guides-tutorials-and-examples/)
14 |
15 | 骨骼动画
16 | ===========================
17 |
18 | 相信大家小时候都玩过变形金刚吧,就是关节可以动的那种,
19 | 骨骼动画和这种玩具类似,也是由一个个部件组成,其中的连接点可以动,
20 | 我们只要摆好两个动作,软件会自动生成过渡的动画.
21 |
22 | 
23 |
24 |
25 | 我们现在只要按时间轴的顺序,依次摆好各个动作,骨骼动画就完成了.
26 |
27 |
28 | 开始准备
29 | ====================================
30 |
31 | 制作骨骼动画可以用很多软件,这里就用Spriter作为示范.
32 |
33 | 制作动画先要有素材,通常采用png格式的图片,Spriter只是一个制作动画的软件,
34 | 图片请用PS或者Gimp 等软件处理.
35 |
36 | 现在准备一些素材,不同的部件最好用不同的文件夹存放可以方便制作.
37 |
38 |
39 | 打开Spriter软件(在本项目的bin/spriter/文件夹下有win和linux的免费版),
40 | 新建一个工程文件,弹出对话框让你现在工程所在目录,
41 |
42 | 
43 |
44 | 请选择你素材所在的父文件夹,如下:
45 |
46 | 
47 |
48 | 在右方可以看见你目录下的图片文件:
49 |
50 | 
51 |
52 | 现在重命名下方的Entity名称和anim名,改成你想要的,注意最好只用字母,数字和下划线.
53 |
54 | 
55 |
56 | 选择名为"idle"的动画,把右方的图片拖进中间的工作区,摆成你想要的动作
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 | 参数|说明
82 | ----|----------------------
83 | play speed |播放速度
84 | name|动画名,与右下角的一样
85 | curtent|时间线当前时间,与动画长度
86 | Repeat play|循环播放
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/doc/动画资源规范.md:
--------------------------------------------------------------------------------
1 | 规范上传动画资源的格式
2 | ==================================
3 |
4 | **要上传的动画资源应该满足以下要求:**
5 |
6 | * 动画的原图片应该满足图片素材规范所说的
7 | * 动画名最好只包含字母或数字
8 | * 动画的大小应该和实际的大小一样最好(不是也行)
9 | * 动画的长度也和实际的一样(不是也行)
10 | * 每个动画最好单个文件夹,如果共用资源的话
11 |
12 |
13 | >请在上传前检查一下你的动画,如果不合要求,请修改,O(∩_∩)O谢谢!
--------------------------------------------------------------------------------
/doc/图片素材规范.md:
--------------------------------------------------------------------------------
1 | 规范上传图片素材的格式
2 | ========================
3 |
4 | **要上传的图片素材应该满足以下要求:**
5 |
6 | * 除非特殊,背景要透明.
7 | * 格式使用png格式,可以用ps转,记得质量选最高
8 | * 文件名有意义,相同部件用文件夹分开(如人物的头部在一个文件夹,身体在另外一个文件夹)
9 | * 文件命名最好只有字母和数字,下划线也行
10 | * 无特殊情况,图片大小在不影响质量的情况下尽量小
11 | * 图片四周的透明也尽量用ps减小
12 |
13 | >请在上传前检查一下你的图片,如果不合要求,请修改,O(∩_∩)O谢谢!
--------------------------------------------------------------------------------
/ds_mod_creator.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Thanks to StackOverflow wiki (http://stackoverflow.com/a/246128)
4 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5 |
6 | if [[ $(uname) == 'Darwin' ]]; then
7 | (cd "$DIR"; open zbstudio/ZeroBraneStudio.app --args "$@")
8 | else
9 | case "$(uname -m)" in
10 | x86_64) ARCH=x64;;
11 | armv7l) ARCH=armhf;;
12 | *) ARCH=x86;;
13 | esac
14 | (cd "$DIR"; bin/linux/$ARCH/lua src/main.lua "$@") &
15 | fi
16 |
--------------------------------------------------------------------------------
/examples/icebox-Harvestable/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "icebox harvestable"
3 | description = "For icebox add a component harvestable"
4 | author = "czfshine"
5 | version = "0.1"
6 | api_version = 5
--------------------------------------------------------------------------------
/examples/icebox-Harvestable/modmain.lua:
--------------------------------------------------------------------------------
1 |
2 | -----------------------------------
3 | -- Prefab mod example
4 | --
5 | -- AddPrefabPostInit("prefabname", initfn)
6 | -- Use this to modify a prefab by adding, removing, or editing its properties
7 | -- and components.
8 | -----------------------------------
9 |
10 | local function Init(prefab)
11 |
12 |
13 |
14 | prefab:AddComponent("harvestable")
15 |
16 | prefab.components.harvestable:SetUp("honey", 6, 10)
17 | prefab.components.harvestable:Grow()
18 |
19 |
20 |
21 |
22 | end
23 | AddPrefabPostInit("icebox",Init)
24 |
25 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/anim/wod.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/anim/wod.zip
--------------------------------------------------------------------------------
/examples/mod例子-人物/bigportraits/wod.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/bigportraits/wod.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/bigportraits/wod.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/images/saveslot_portraits/wod.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/images/saveslot_portraits/wod.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/images/saveslot_portraits/wod.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/images/selectscreen_portraits/wod.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/images/selectscreen_portraits/wod.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/images/selectscreen_portraits/wod.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/images/selectscreen_portraits/wod_silho.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/images/selectscreen_portraits/wod_silho.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/images/selectscreen_portraits/wod_silho.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "Sample Character"
3 | description = "This mod contains template art and prefabs to show how custom characters are made."
4 | author = "Graham Jans (Ipsquiggle)"
5 | version = "1.3"
6 |
7 | -- This is the URL name of the mod's thread on the forum; the part after the index.php? and before the first & in the URL
8 | -- Example:
9 | -- http://forums.kleientertainment.com/index.php?/files/file/202-sample-mods/
10 | -- becomes
11 | -- /files/file/202-sample-mods/
12 | forumthread = "/files/file/202-sample-mods/"
13 |
14 | -- This lets other players know if your mod is out of date, update it to match the current version in the game
15 | api_version = 4
16 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/modmain.lua:
--------------------------------------------------------------------------------
1 | PrefabFiles = {
2 | "wod",
3 | }
4 |
5 | Assets = {
6 | Asset( "IMAGE", "images/saveslot_portraits/wod.tex" ),
7 | Asset( "ATLAS", "images/saveslot_portraits/wod.xml" ),
8 |
9 | Asset( "IMAGE", "images/selectscreen_portraits/wod.tex" ),
10 | Asset( "ATLAS", "images/selectscreen_portraits/wod.xml" ),
11 |
12 | Asset( "IMAGE", "images/selectscreen_portraits/wod_silho.tex" ),
13 | Asset( "ATLAS", "images/selectscreen_portraits/wod_silho.xml" ),
14 |
15 | Asset( "IMAGE", "bigportraits/wod.tex" ),
16 | Asset( "ATLAS", "bigportraits/wod.xml" ),
17 |
18 | }
19 |
20 |
21 | -- strings! Any "WOD" below would have to be replaced by the prefab name of your character.
22 |
23 | -- The character select screen lines
24 | -- note: these are lower-case character name
25 | GLOBAL.STRINGS.CHARACTER_TITLES.wod = "The Template"
26 | GLOBAL.STRINGS.CHARACTER_NAMES.wod = "Wod" -- Note! This line is especially important as some parts of the game require
27 | -- the character to have a valid name.
28 | GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.wod = "* An example of how to create a mod character."
29 | GLOBAL.STRINGS.CHARACTER_QUOTES.wod = "\"I am a blank slate.\""
30 |
31 | -- You can also add any kind of custom dialogue that you would like. Don't forget to make
32 | -- categores that don't exist yet using = {}
33 | -- note: these are UPPER-CASE charcacter name
34 | GLOBAL.STRINGS.CHARACTERS.WOD = {}
35 | GLOBAL.STRINGS.CHARACTERS.WOD.DESCRIBE = {}
36 | GLOBAL.STRINGS.CHARACTERS.WOD.DESCRIBE.EVERGREEN = "A template description of a tree."
37 |
38 | -- Let the game know Wod is a male, for proper pronouns during the end-game sequence.
39 | -- Possible genders here are MALE, FEMALE, or ROBOT
40 | table.insert(GLOBAL.CHARACTER_GENDERS.MALE, "wod")
41 |
42 |
43 | AddModCharacter("wod")
44 |
45 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/anim/template_player_character.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/anim/template_player_character.png
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/anim/wod.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/anim/wod.zip
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/bigportraits/template_bigportrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/bigportraits/template_bigportrait.png
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/bigportraits/template_bigportrait.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/bigportraits/template_bigportrait.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/bigportraits/template_bigportrait.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/bigportraits/wod.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/bigportraits/wod.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/bigportraits/wod.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/saveslot_portraits/template_save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/saveslot_portraits/template_save.png
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/saveslot_portraits/template_save.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/saveslot_portraits/template_save.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/saveslot_portraits/template_save.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/saveslot_portraits/wod.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/saveslot_portraits/wod.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/saveslot_portraits/wod.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/template_selectscreen_portraits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/template_selectscreen_portraits.png
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/template_selectscreen_portraits.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/template_selectscreen_portraits.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/template_selectscreen_portraits.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/wod.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/wod.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/wod.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/wod_silho.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/wod_silho.tex
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/images/selectscreen_portraits/wod_silho.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "Sample Character"
3 | description = "This mod contains template art and prefabs to show how custom characters are made."
4 | author = "Graham Jans (Ipsquiggle)"
5 | version = "1.3"
6 |
7 | -- This is the URL name of the mod's thread on the forum; the part after the index.php? and before the first & in the URL
8 | -- Example:
9 | -- http://forums.kleientertainment.com/index.php?/files/file/202-sample-mods/
10 | -- becomes
11 | -- /files/file/202-sample-mods/
12 | forumthread = "/files/file/202-sample-mods/"
13 |
14 | -- This lets other players know if your mod is out of date, update it to match the current version in the game
15 | api_version = 4
16 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/modmain.lua:
--------------------------------------------------------------------------------
1 | PrefabFiles = {
2 | "wod",
3 | }
4 |
5 | Assets = {
6 | Asset( "IMAGE", "images/saveslot_portraits/wod.tex" ),
7 | Asset( "ATLAS", "images/saveslot_portraits/wod.xml" ),
8 |
9 | Asset( "IMAGE", "images/selectscreen_portraits/wod.tex" ),
10 | Asset( "ATLAS", "images/selectscreen_portraits/wod.xml" ),
11 |
12 | Asset( "IMAGE", "images/selectscreen_portraits/wod_silho.tex" ),
13 | Asset( "ATLAS", "images/selectscreen_portraits/wod_silho.xml" ),
14 |
15 | Asset( "IMAGE", "bigportraits/wod.tex" ),
16 | Asset( "ATLAS", "bigportraits/wod.xml" ),
17 |
18 | }
19 |
20 |
21 | -- strings! Any "WOD" below would have to be replaced by the prefab name of your character.
22 |
23 | -- The character select screen lines
24 | -- note: these are lower-case character name
25 | GLOBAL.STRINGS.CHARACTER_TITLES.wod = "The Template"
26 | GLOBAL.STRINGS.CHARACTER_NAMES.wod = "Wod" -- Note! This line is especially important as some parts of the game require
27 | -- the character to have a valid name.
28 | GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.wod = "* An example of how to create a mod character."
29 | GLOBAL.STRINGS.CHARACTER_QUOTES.wod = "\"I am a blank slate.\""
30 |
31 | -- You can also add any kind of custom dialogue that you would like. Don't forget to make
32 | -- categores that don't exist yet using = {}
33 | -- note: these are UPPER-CASE charcacter name
34 | GLOBAL.STRINGS.CHARACTERS.WOD = {}
35 | GLOBAL.STRINGS.CHARACTERS.WOD.DESCRIBE = {}
36 | GLOBAL.STRINGS.CHARACTERS.WOD.DESCRIBE.EVERGREEN = "A template description of a tree."
37 |
38 | -- Let the game know Wod is a male, for proper pronouns during the end-game sequence.
39 | -- Possible genders here are MALE, FEMALE, or ROBOT
40 | table.insert(GLOBAL.CHARACTER_GENDERS.MALE, "wod")
41 |
42 |
43 | AddModCharacter("wod")
44 |
45 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter (1)/samplecharacter/scripts/prefabs/wod.lua:
--------------------------------------------------------------------------------
1 |
2 | local MakePlayerCharacter = require "prefabs/player_common"
3 |
4 |
5 | local assets = {
6 |
7 | Asset( "ANIM", "anim/player_basic.zip" ),
8 | Asset( "ANIM", "anim/player_idles_shiver.zip" ),
9 | Asset( "ANIM", "anim/player_actions.zip" ),
10 | Asset( "ANIM", "anim/player_actions_axe.zip" ),
11 | Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),
12 | Asset( "ANIM", "anim/player_actions_shovel.zip" ),
13 | Asset( "ANIM", "anim/player_actions_blowdart.zip" ),
14 | Asset( "ANIM", "anim/player_actions_eat.zip" ),
15 | Asset( "ANIM", "anim/player_actions_item.zip" ),
16 | Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),
17 | Asset( "ANIM", "anim/player_actions_bugnet.zip" ),
18 | Asset( "ANIM", "anim/player_actions_fishing.zip" ),
19 | Asset( "ANIM", "anim/player_actions_boomerang.zip" ),
20 | Asset( "ANIM", "anim/player_bush_hat.zip" ),
21 | Asset( "ANIM", "anim/player_attacks.zip" ),
22 | Asset( "ANIM", "anim/player_idles.zip" ),
23 | Asset( "ANIM", "anim/player_rebirth.zip" ),
24 | Asset( "ANIM", "anim/player_jump.zip" ),
25 | Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),
26 | Asset( "ANIM", "anim/player_teleport.zip" ),
27 | Asset( "ANIM", "anim/wilson_fx.zip" ),
28 | Asset( "ANIM", "anim/player_one_man_band.zip" ),
29 | Asset( "ANIM", "anim/shadow_hands.zip" ),
30 | Asset( "SOUND", "sound/sfx.fsb" ),
31 | Asset( "SOUND", "sound/wilson.fsb" ),
32 | Asset( "ANIM", "anim/beard.zip" ),
33 |
34 | -- Don't forget to include your character's custom assets!
35 | Asset( "ANIM", "anim/wod.zip" ),
36 | }
37 | local prefabs = {}
38 |
39 | local fn = function(inst)
40 |
41 | -- choose which sounds this character will play
42 | inst.soundsname = "wolfgang"
43 |
44 | -- a minimap icon must be specified
45 | inst.MiniMapEntity:SetIcon( "wilson.png" )
46 |
47 | -- todo: Add an example special power here.
48 | end
49 |
50 |
51 |
52 | return MakePlayerCharacter("wod", prefabs, assets, fn)
53 |
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter_templates1/samplecharacter/anim/template_player_character.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter_templates1/samplecharacter/anim/template_player_character.png
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter_templates1/samplecharacter/images/saveslot_portraits/template_save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter_templates1/samplecharacter/images/saveslot_portraits/template_save.png
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter_templates1/samplecharacter/images/selectscreen_portraits/template_selectscreen_portraits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter_templates1/samplecharacter/images/selectscreen_portraits/template_selectscreen_portraits.png
--------------------------------------------------------------------------------
/examples/mod例子-人物/samplecharacter_templates2/samplecharacter/bigportraits/template_bigportrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-人物/samplecharacter_templates2/samplecharacter/bigportraits/template_bigportrait.png
--------------------------------------------------------------------------------
/examples/mod例子-人物/scripts/prefabs/wod.lua:
--------------------------------------------------------------------------------
1 |
2 | local MakePlayerCharacter = require "prefabs/player_common"
3 |
4 |
5 | local assets = {
6 |
7 | Asset( "ANIM", "anim/player_basic.zip" ),
8 | Asset( "ANIM", "anim/player_idles_shiver.zip" ),
9 | Asset( "ANIM", "anim/player_actions.zip" ),
10 | Asset( "ANIM", "anim/player_actions_axe.zip" ),
11 | Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),
12 | Asset( "ANIM", "anim/player_actions_shovel.zip" ),
13 | Asset( "ANIM", "anim/player_actions_blowdart.zip" ),
14 | Asset( "ANIM", "anim/player_actions_eat.zip" ),
15 | Asset( "ANIM", "anim/player_actions_item.zip" ),
16 | Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),
17 | Asset( "ANIM", "anim/player_actions_bugnet.zip" ),
18 | Asset( "ANIM", "anim/player_actions_fishing.zip" ),
19 | Asset( "ANIM", "anim/player_actions_boomerang.zip" ),
20 | Asset( "ANIM", "anim/player_bush_hat.zip" ),
21 | Asset( "ANIM", "anim/player_attacks.zip" ),
22 | Asset( "ANIM", "anim/player_idles.zip" ),
23 | Asset( "ANIM", "anim/player_rebirth.zip" ),
24 | Asset( "ANIM", "anim/player_jump.zip" ),
25 | Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),
26 | Asset( "ANIM", "anim/player_teleport.zip" ),
27 | Asset( "ANIM", "anim/wilson_fx.zip" ),
28 | Asset( "ANIM", "anim/player_one_man_band.zip" ),
29 | Asset( "ANIM", "anim/shadow_hands.zip" ),
30 | Asset( "SOUND", "sound/sfx.fsb" ),
31 | Asset( "SOUND", "sound/wilson.fsb" ),
32 | Asset( "ANIM", "anim/beard.zip" ),
33 |
34 | -- Don't forget to include your character's custom assets!
35 | Asset( "ANIM", "anim/wod.zip" ),
36 | }
37 | local prefabs = {}
38 |
39 | local fn = function(inst)
40 |
41 | -- choose which sounds this character will play
42 | inst.soundsname = "wolfgang"
43 |
44 | -- a minimap icon must be specified
45 | inst.MiniMapEntity:SetIcon( "wilson.png" )
46 |
47 | -- todo: Add an example special power here.
48 | end
49 |
50 |
51 |
52 | return MakePlayerCharacter("wod", prefabs, assets, fn)
53 |
--------------------------------------------------------------------------------
/examples/mod例子-声音/basic3dsound.fdt:
--------------------------------------------------------------------------------
1 |
2 | basic3dsound
3 | 0
4 |
5 |
--------------------------------------------------------------------------------
/examples/mod例子-声音/images/modicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-声音/images/modicon.png
--------------------------------------------------------------------------------
/examples/mod例子-声音/images/modicon.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-声音/images/modicon.tex
--------------------------------------------------------------------------------
/examples/mod例子-声音/images/modicon.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/mod例子-声音/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "Sample Sound Effect"
3 | description = "Demonstration mod of a custom sound effect. With this mod, bats make popping noises while they flap."
4 | author = "Cheeriodude"
5 | version = "1.3"
6 |
7 | -- This is the URL name of the mod's thread on the forum; the part after the index.php? and before the first & in the URL
8 | -- Example:
9 | -- http://forums.kleientertainment.com/index.php?/files/file/202-sample-mods/
10 | -- becomes
11 | -- /files/file/202-sample-mods/
12 | forumthread = "/files/file/202-sample-mods/"
13 |
14 | -- This lets other players know if your mod is out of date, update it to match the current version in the game
15 | api_version = 4
16 |
17 | ---- Can specify a custom icon for this mod!
18 | icon_atlas = "images/modicon.xml"
19 | icon = "modicon.tex"
20 |
--------------------------------------------------------------------------------
/examples/mod例子-声音/modmain.lua:
--------------------------------------------------------------------------------
1 | Assets = {
2 | Asset("SOUNDPACKAGE", "sound/soundexample.fev"),
3 | Asset("SOUND", "sound/modsounds.fsb"),
4 | }
5 |
6 | RemapSoundEvent("dontstarve/creatures/bat/flap", "soundexample/creatures/bat/pop")
7 |
--------------------------------------------------------------------------------
/examples/mod例子-声音/sound/modsounds.fsb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-声音/sound/modsounds.fsb
--------------------------------------------------------------------------------
/examples/mod例子-声音/sound/soundexample.fev:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-声音/sound/soundexample.fev
--------------------------------------------------------------------------------
/examples/mod例子-声音/sound_source/bubble_gum_pop.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-声音/sound_source/bubble_gum_pop.wav
--------------------------------------------------------------------------------
/examples/mod例子-武器/anim/swap_wand.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-武器/anim/swap_wand.zip
--------------------------------------------------------------------------------
/examples/mod例子-武器/anim/wand.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-武器/anim/wand.zip
--------------------------------------------------------------------------------
/examples/mod例子-武器/exported/swap_wand/swap_wand.scml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/mod例子-武器/exported/swap_wand/swap_wand.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-武器/exported/swap_wand/swap_wand.zip
--------------------------------------------------------------------------------
/examples/mod例子-武器/exported/swap_wand/wand/wand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-武器/exported/swap_wand/wand/wand.png
--------------------------------------------------------------------------------
/examples/mod例子-武器/exported/wand/wand.scml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/mod例子-武器/exported/wand/wand.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-武器/exported/wand/wand.zip
--------------------------------------------------------------------------------
/examples/mod例子-武器/exported/wand/wand/wand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-武器/exported/wand/wand/wand.png
--------------------------------------------------------------------------------
/examples/mod例子-武器/images/inventoryimages/wand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-武器/images/inventoryimages/wand.png
--------------------------------------------------------------------------------
/examples/mod例子-武器/images/inventoryimages/wand.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-武器/images/inventoryimages/wand.tex
--------------------------------------------------------------------------------
/examples/mod例子-武器/images/inventoryimages/wand.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/mod例子-武器/modinfo.lua:
--------------------------------------------------------------------------------
1 | name = "Wand Example"
2 | description = "This is an example of an equippable item. Huge thanks to the Waverly team for letting me use their art for this."
3 | author = "Cheerio"
4 | version = ".1"
5 | forumthread = ""
6 | api_version = 6
--------------------------------------------------------------------------------
/examples/mod例子-武器/modmain.lua:
--------------------------------------------------------------------------------
1 | PrefabFiles = {
2 | "wand",
3 | }
4 |
5 |
6 | -- Import things we like into our mod's own global scope, so we don't have
7 | -- to type "GLOBAL." every time want to use them.
8 | SpawnPrefab = GLOBAL.SpawnPrefab
9 |
10 |
11 | function SimInit(player)
12 | print("spawning item")
13 | local prefab = SpawnPrefab("wand")
14 | player.components.inventory:GiveItem(prefab)
15 | end
16 |
17 | AddSimPostInit(SimInit )
18 |
--------------------------------------------------------------------------------
/examples/mod例子-武器/scripts/prefabs/wand.lua:
--------------------------------------------------------------------------------
1 | local assets=
2 | {
3 | Asset("ANIM", "anim/wand.zip"),
4 | Asset("ANIM", "anim/swap_wand.zip"),
5 |
6 | Asset("ATLAS", "images/inventoryimages/wand.xml"),
7 | Asset("IMAGE", "images/inventoryimages/wand.tex"),
8 | }
9 |
10 | local prefabs =
11 | {
12 | }
13 |
14 | local function fn(colour)
15 |
16 | local function OnEquip(inst, owner)
17 | --owner.AnimState:OverrideSymbol("swap_object", "swap_wands", "purplestaff")
18 | owner.AnimState:OverrideSymbol("swap_object", "swap_wand", "wand")
19 | owner.AnimState:Show("ARM_carry")
20 | owner.AnimState:Hide("ARM_normal")
21 | end
22 |
23 | local function OnUnequip(inst, owner)
24 | owner.AnimState:Hide("ARM_carry")
25 | owner.AnimState:Show("ARM_normal")
26 | end
27 |
28 | local inst = CreateEntity()
29 | local trans = inst.entity:AddTransform()
30 | local anim = inst.entity:AddAnimState()
31 | MakeInventoryPhysics(inst)
32 |
33 | anim:SetBank("wand")
34 | anim:SetBuild("wand")
35 | anim:PlayAnimation("idle")
36 |
37 | inst:AddComponent("inventoryitem")
38 | inst.components.inventoryitem.imagename = "wand"
39 | inst.components.inventoryitem.atlasname = "images/inventoryimages/wand.xml"
40 |
41 | inst:AddComponent("equippable")
42 | inst.components.equippable:SetOnEquip( OnEquip )
43 | inst.components.equippable:SetOnUnequip( OnUnequip )
44 |
45 | return inst
46 | end
47 |
48 | return Prefab("common/inventory/wand", fn, assets, prefabs)
--------------------------------------------------------------------------------
/examples/mod例子-物品/anim/myprefab_build.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/anim/myprefab_build.zip
--------------------------------------------------------------------------------
/examples/mod例子-物品/base/base_smilie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/base/base_smilie.png
--------------------------------------------------------------------------------
/examples/mod例子-物品/exported/myprefab/base.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/exported/myprefab/base.png
--------------------------------------------------------------------------------
/examples/mod例子-物品/exported/myprefab/myprefab_build.scml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/examples/mod例子-物品/exported/myprefab/myprefab_build.scml.txt:
--------------------------------------------------------------------------------
1 | Building 'C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\..\..\dont_starve\mods\sampleprefab/exported\myprefab\myprefab_build.scml'.
2 |
--------------------------------------------------------------------------------
/examples/mod例子-物品/exported/myprefab/myprefab_build.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/exported/myprefab/myprefab_build.zip
--------------------------------------------------------------------------------
/examples/mod例子-物品/exported/myprefab/shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/exported/myprefab/shadow.png
--------------------------------------------------------------------------------
/examples/mod例子-物品/images/inventoryimages/myprefab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/images/inventoryimages/myprefab.png
--------------------------------------------------------------------------------
/examples/mod例子-物品/images/inventoryimages/myprefab.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/images/inventoryimages/myprefab.tex
--------------------------------------------------------------------------------
/examples/mod例子-物品/images/inventoryimages/myprefab.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/mod例子-物品/images/modicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/images/modicon.png
--------------------------------------------------------------------------------
/examples/mod例子-物品/images/modicon.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-物品/images/modicon.tex
--------------------------------------------------------------------------------
/examples/mod例子-物品/images/modicon.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/mod例子-物品/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "Sample Prefab"
3 | description = "A demonstration of creating your own prefab. Puts a smiley face in your inventory on load!"
4 | author = "Graham Jans (Ipsquiggle)"
5 | version = "1.5"
6 |
7 | -- This is the URL name of the mod's thread on the forum; the part after the index.php? and before the first & in the URL
8 | -- Example:
9 | -- http://forums.kleientertainment.com/index.php?/files/file/202-sample-mods/
10 | -- becomes
11 | -- /files/file/202-sample-mods/
12 | forumthread = "/files/file/202-sample-mods/"
13 |
14 | -- This lets other players know if your mod is out of date, update it to match the current version in the game
15 | api_version = 4
16 |
17 | -- Can specify a custom icon for this mod!
18 | icon_atlas = "images/modicon.xml"
19 | icon = "modicon.tex"
20 |
--------------------------------------------------------------------------------
/examples/mod例子-物品/modmain.lua:
--------------------------------------------------------------------------------
1 | --[[
2 |
3 | This mod shows how to load custom prefabs and assets so that they are usable
4 | by the game.
5 |
6 | --]]
7 |
8 |
9 | -- The PrefabFiles list is the list of all the files in your /scripts/prefabs folder
10 | -- that you want to load prefabs from
11 | PrefabFiles = {
12 | "sampleprefabdef",
13 | }
14 |
15 |
16 | -- Import things we like into our mod's own global scope, so we don't have
17 | -- to type "GLOBAL." every time want to use them.
18 | SpawnPrefab = GLOBAL.SpawnPrefab
19 |
20 |
21 | function SimInit(player)
22 | print("spawning item")
23 | local prefab = SpawnPrefab("myprefab")
24 | player.components.inventory:GiveItem(prefab)
25 | end
26 |
27 | AddSimPostInit(SimInit )
28 |
--------------------------------------------------------------------------------
/examples/mod例子-物品/scripts/prefabs/sampleprefabdef.lua:
--------------------------------------------------------------------------------
1 |
2 | -- In a prefab file, you need to list all the assets it requires.
3 | -- These can be either standard assets, or custom ones in your mod
4 | -- folder.
5 | local Assets =
6 | {
7 | Asset("ANIM", "anim/myprefab_build.zip"), -- a standard asset
8 | Asset("ATLAS", "images/inventoryimages/myprefab.xml"), -- a custom asset, found in the mod folder
9 | }
10 |
11 | -- Write a local function that creats, customizes, and returns an instance of the prefab.
12 | local function fn(Sim)
13 | local inst = CreateEntity()
14 | inst.entity:AddTransform()
15 | inst.entity:AddAnimState()
16 |
17 | MakeInventoryPhysics(inst)
18 |
19 | inst.AnimState:SetBank("myprefab")
20 | inst.AnimState:SetBuild("myprefab_build")
21 | inst.AnimState:PlayAnimation("idle", true)
22 |
23 | inst:AddComponent("inventoryitem")
24 | inst.components.inventoryitem.atlasname = "images/inventoryimages/myprefab.xml"
25 |
26 | inst:AddComponent("inspectable")
27 |
28 | return inst
29 | end
30 |
31 | -- Add some strings for this item
32 | STRINGS.NAMES.MYPREFAB = "My example prefab"
33 | STRINGS.CHARACTERS.GENERIC.DESCRIBE.MYPREFAB = "I made an example out of it."
34 |
35 |
36 | -- Finally, return a new prefab with the construction function and assets.
37 | return Prefab( "common/inventory/myprefab", fn, Assets)
38 |
39 |
--------------------------------------------------------------------------------
/examples/mod例子-组件/modicon.tex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/examples/mod例子-组件/modicon.tex
--------------------------------------------------------------------------------
/examples/mod例子-组件/modicon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/examples/mod例子-组件/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "Sample Mod"
3 | description = "Demonstration of various mod functionality."
4 | author = "Jamie Cheng (Bigfoot)"
5 | version = "1.4"
6 |
7 | -- This is the URL name of the mod's thread on the forum; the part after the index.php? and before the first & in the URL
8 | -- Example:
9 | -- http://forums.kleientertainment.com/index.php?/files/file/202-sample-mods/
10 | -- becomes
11 | -- /files/file/202-sample-mods/
12 | forumthread = "/files/file/202-sample-mods/"
13 |
14 | -- This lets other players know if your mod is out of date, update it to match the current version in the game
15 | api_version = 4
16 |
17 | -- Can specify a custom icon for this mod!
18 | icon_atlas = "modicon.xml"
19 | icon = "modicon.tex"
20 |
--------------------------------------------------------------------------------
/examples/mod例子-组件/modmain.lua:
--------------------------------------------------------------------------------
1 | --[[
2 |
3 | ***************************************************************
4 | Created by: Jamie Cheng
5 | Date: February 20, 2013
6 | Description: Sample mod that shows how to:
7 | - add post init functions for prefabs, components, simulation
8 | - edit tuning values
9 | - create your own component
10 | ***************************************************************
11 |
12 | ]]
13 |
14 | --special post-init function for a particular prefab: pigs in this case
15 | function pigmanpostinit(inst)
16 | print("hello pigman init!")
17 |
18 | --halve wilson's max hunger on initialization
19 | inst.components.health:SetMaxHealth(TUNING.PIG_HEALTH*0.5)
20 |
21 | --add your own component, defined in mods/[yourmodname]/scripts/components/myowncomponent.lua
22 | inst:AddComponent("myowncomponent")
23 | end
24 |
25 | function inventorypostinit(component,inst)
26 | print("hello inventory init!")
27 | end
28 |
29 | function simpostinit(player)
30 | print("hello sim init!")
31 | print("We are playing as "..player.prefab)
32 | end
33 |
34 | function gamepostinit()
35 | print("hello game init!")
36 | --if you want to load your own prefabs, this is where you'd do it
37 | end
38 |
39 | --add a post init for the pigman
40 | AddPrefabPostInit("pigman", pigmanpostinit)
41 |
42 | --add a post init function for the inventory component
43 | AddComponentPostInit("inventory", inventorypostinit)
44 |
45 | --add a post init to the sim starting up
46 | AddSimPostInit(simpostinit)
47 |
48 | --add a post init to the game starting up
49 | AddGamePostInit(gamepostinit)
50 |
51 | --override specific tuning values here!
52 | TUNING.WILSON_HUNGER = 50
53 |
--------------------------------------------------------------------------------
/examples/mod例子-组件/scripts/README.txt:
--------------------------------------------------------------------------------
1 | ------------------------------------------
2 | This is where you can completely override scripts from the game. You must use the same directory structure as the game, and it will automagically override them.
3 |
4 | Note that while this is the most powerful way to write a mod, it is also the least bulletproof in terms of updates. The main game updates WILL break these mods!
--------------------------------------------------------------------------------
/examples/mod例子-组件/scripts/components/myowncomponent.lua:
--------------------------------------------------------------------------------
1 | local MyOwnComponent = Class(function(self, inst)
2 | self.inst = inst
3 | print "I've initialized my own component!"
4 | end)
5 |
6 | return MyOwnComponent
7 |
--------------------------------------------------------------------------------
/image/spriter/dh1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/dh1.png
--------------------------------------------------------------------------------
/image/spriter/dh2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/dh2.png
--------------------------------------------------------------------------------
/image/spriter/dh3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/dh3.png
--------------------------------------------------------------------------------
/image/spriter/dh4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/dh4.png
--------------------------------------------------------------------------------
/image/spriter/jm1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/jm1.png
--------------------------------------------------------------------------------
/image/spriter/jm2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/jm2.png
--------------------------------------------------------------------------------
/image/spriter/jm3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/jm3.png
--------------------------------------------------------------------------------
/image/spriter/jm4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/jm4.png
--------------------------------------------------------------------------------
/image/spriter/sm1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/sm1.png
--------------------------------------------------------------------------------
/image/spriter/zy1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/image/spriter/zy1.png
--------------------------------------------------------------------------------
/mods/boxlock/modinfo.lua:
--------------------------------------------------------------------------------
1 | name = "boxlock 1"
2 | author = "czfshine"
3 | version = "alpha-0.0.1"
4 |
5 |
6 | description = ("boxlock")
7 |
8 | dont_starve_compatible = true
9 | reign_of_giants_compatible = true
10 | dst_compatible = true
11 |
12 | all_clients_require_mod = true
13 | clients_only_mod = false
14 |
15 | forumthread = ""
16 |
17 | api_version = 6
18 |
19 | -- This is used by the packaging system.
20 | dst_api_version = 10
21 |
22 |
23 | --[[
24 | icon_atlas = "favicon/upandaway.xml"
25 | icon = "upandaway.tex"
26 | ]]
27 |
28 | priority = -1
29 |
30 |
31 |
32 | --[[
33 | ------------------------------------------------------------------------
34 | -- CFG
35 | ------------------------------------------------------------------------
36 |
37 | local function NamedSwitch(on_desc, off_desc)
38 | return function(name, label, default_value)
39 | return {
40 | name = name,
41 | label = label,
42 | options = {
43 | {description = on_desc, data = true},
44 | {description = off_desc, data = false},
45 | },
46 | default = default_value and true or false,
47 | }
48 | end
49 | end
50 |
51 | local EnableSwitch = NamedSwitch("Enabled", "Disabled")
52 | local OnSwitch = NamedSwitch("On", "Off")
53 | local YesSwitch = NamedSwitch("Yes", "No")
54 |
55 | ------------------------------------
56 |
57 | configuration_options = {
58 | EnableSwitch("DEBUG", "Debugging Mode", true),
59 | EnableSwitch("UP_SPLASH.ENABLED", "Custom Menu", true),
60 | EnableSwitch("CLOUD_LIGHTNING.ENABLED", "Ground Lightning", true),
61 | EnableSwitch("CLOUD_MIST.ENABLED", "Mist", true),
62 | EnableSwitch("RAM.SPARKS", "Storm Ram Sparks", true),
63 | }
64 | ]]
--------------------------------------------------------------------------------
/mods/boxlock/modmain.lua:
--------------------------------------------------------------------------------
1 | local MMScreen=GLOBAL.require("widgets/mmscreen")
2 | local KEY_CTRL = GLOBAL.KEY_CTRL
3 | local Vector3 = GLOBAL.Vector3
4 | local TheInput = GLOBAL.TheInput
5 | local table = GLOBAL.table
6 | local require = GLOBAL.require
7 | local unpack = GLOBAL.unpack
8 |
9 |
10 |
11 |
12 |
13 | local function SilkPostInit(inst)
14 |
15 | local function onopenmm (inst,data)
16 |
17 | local can=inst.components.container
18 | local canopen = can.canopen
19 |
20 | if canopen then
21 |
22 | inst.AnimState:PlayAnimation("open")
23 | inst.SoundEmitter:PlaySound("dontstarve/wilson/chest_open")
24 | print("canopenopen")
25 |
26 | elseif not can.MM then
27 |
28 |
29 | inst.AnimState:PlayAnimation("close")
30 | inst.SoundEmitter:PlaySound("dontstarve/wilson/chest_close")
31 |
32 | controls.MM:Setting(can,data.doer,true)
33 |
34 |
35 | else
36 |
37 |
38 | inst.AnimState:PlayAnimation("close")
39 | inst.SoundEmitter:PlaySound("dontstarve/wilson/chest_close")
40 |
41 | controls.MM:Setting(can,data.doer,false)
42 | end
43 | print("open")
44 | end
45 |
46 |
47 | inst:ListenForEvent("onopen", onopenmm)
48 |
49 |
50 | local function onclosemm(inst)
51 | inst.components.container.canopen=false
52 | end
53 | inst:ListenForEvent("onclose", onclosemm)
54 |
55 |
56 | end
57 |
58 |
59 |
60 | local function AddMM(self)
61 | controls = self
62 |
63 | controls.MM = controls:AddChild(MMScreen())
64 |
65 | --local screenwidth, screenheight = GLOBAL.TheSim:GetScreenSize()
66 | --controls.MM:SetPosition(screenwidth/2,screenheight/2,0)
67 | --controls.MM.inst.UITransform:SetScale(STARTSCALE, STARTSCALE, 1)
68 |
69 | controls.MM:Hide()
70 |
71 | --[[
72 | GLOBAL.TheInput:AddKeyDownHandler(ToggleButton, ShowGestureWheel)
73 | GLOBAL.TheInput:AddKeyUpHandler(ToggleButton, HideGestureWheel)
74 | ]]
75 |
76 |
77 | local OldOnUpdate = controls.OnUpdate
78 | local function OnUpdate(...)
79 | OldOnUpdate(...)
80 |
81 | self.MM:OnUpdate()
82 |
83 | end
84 |
85 | controls.OnUpdate = OnUpdate
86 | end
87 |
88 | AddClassPostConstruct( "widgets/controls", AddMM )
89 |
90 | AddPrefabPostInit('pandoraschest',SilkPostInit)
91 | AddPrefabPostInit('treasurechest',SilkPostInit)
92 | AddPrefabPostInit('skullchest',SilkPostInit)
93 | AddPrefabPostInit('minotaurchest',SilkPostInit)
94 |
95 |
--------------------------------------------------------------------------------
/mods/boxlock/scripts/widgets/mmscreen.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/mods/boxlock/scripts/widgets/mmscreen.lua
--------------------------------------------------------------------------------
/mods/boxlock/说明.md:
--------------------------------------------------------------------------------
1 | 箱锁
2 | ====================
3 |
4 | 为箱子上锁
5 |
6 |
7 | 2015-1-15 更新
8 | =======================================
9 | 增加在第一次打开时可设置密码 .
10 | 在输入密码时,如果正确,可按设置按钮设置密码.
11 |
12 | 121911 测试通过
13 |
14 | 待办事宜
15 | ----------------------
16 | 保存.
17 | 用* 号替换
18 |
19 |
20 | 2015-1-14 更新
21 | ====================
22 | 主体界面框架写好,可以打开箱子时输入正确密码才能打开(12345678).
23 | 其他部分未完成.
24 |
25 | 121911 测试通过
--------------------------------------------------------------------------------
/mods/pick-level1/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "pick 4 lev 1"
3 | description = "can pick 4 block"
4 | author = "czfshine"
5 | version = "level-1.0"
6 | api_version = 5
7 |
--------------------------------------------------------------------------------
/mods/pick-level1/scripts/components/terraformer.lua:
--------------------------------------------------------------------------------
1 | local Terraformer = Class(function(self, inst)
2 | self.inst = inst
3 | end)
4 |
5 |
6 | local GROUND_TURFS =
7 | {
8 | [GROUND.ROCKY] = "turf_rocky",
9 | [GROUND.ROAD] = "turf_road",
10 | [GROUND.DIRT] = "turf_dirt",
11 | [GROUND.SAVANNA] = "turf_savanna",
12 | [GROUND.GRASS] = "turf_grass",
13 | [GROUND.FOREST] = "turf_forest",
14 | [GROUND.MARSH] = "turf_marsh",
15 | [GROUND.WOODFLOOR] = "turf_woodfloor",
16 | [GROUND.CARPET] = "turf_carpetfloor",
17 | [GROUND.CHECKER] = "turf_checkerfloor",
18 |
19 | [GROUND.CAVE] = "turf_cave",
20 | [GROUND.FUNGUS] = "turf_fungus",
21 | [GROUND.FUNGUSRED] = "turf_fungus_red",
22 | [GROUND.FUNGUSGREEN]= "turf_fungus_green",
23 |
24 | [GROUND.SINKHOLE] = "turf_sinkhole",
25 | [GROUND.UNDERROCK] = "turf_underrock",
26 | [GROUND.MUD] = "turf_mud",
27 |
28 | webbing = "turf_webbing",
29 | }
30 |
31 |
32 | function Terraformer:CanTerraformPoint(pt)
33 | local ground = GetWorld()
34 | if ground then
35 | local tile = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z)
36 | return tile ~= GROUND.IMPASSIBLE and tile ~= GROUND.DIRT and tile < GROUND.UNDERGROUND
37 | end
38 | return false
39 | end
40 |
41 | function Terraformer:CollectPointActions(doer, pos, actions, right)
42 | if right then
43 | local valid = true
44 | -- if RoadManager then
45 | -- valid = not RoadManager:IsOnRoad( pos.x, 0, pos.z )
46 | -- end
47 |
48 | if valid and self:CanTerraformPoint(pos) then
49 | table.insert(actions, ACTIONS.TERRAFORM)
50 | end
51 | end
52 | end
53 |
54 | local function SpawnTurf( turf, pt )
55 | if turf then
56 | local loot = SpawnPrefab(turf)
57 | loot.Transform:SetPosition(pt.x, pt.y, pt.z)
58 | if loot.Physics then
59 | local angle = math.random()*2*PI
60 | loot.Physics:SetVel(2*math.cos(angle), 10, 2*math.sin(angle))
61 | end
62 | end
63 | end
64 |
65 | function Terraformer:Terraform(pt)
66 | if self:CanTerraformPoint(pt) == false then
67 | return false
68 | end
69 |
70 | local ground = GetWorld()
71 | if ground then
72 | local tile = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z)
73 | if tile ~= GROUND.DIRT then
74 | local original_tile_type = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z)
75 | local x, y = ground.Map:GetTileCoordsAtPoint(pt.x, pt.y, pt.z)
76 |
77 | ground.Map:SetTile( x, y, GROUND.DIRT )
78 | ground.Map:SetTile( x+1, y, GROUND.DIRT )
79 | ground.Map:SetTile( x, y+1, GROUND.DIRT )
80 | ground.Map:SetTile( x+1, y+1, GROUND.DIRT )
81 |
82 | ground.Map:RebuildLayer( original_tile_type, x, y )
83 | ground.Map:RebuildLayer( original_tile_type, x+1, y )
84 | ground.Map:RebuildLayer( original_tile_type, x, y +1)
85 | ground.Map:RebuildLayer( original_tile_type, x+1, y +1)
86 | ground.Map:RebuildLayer( GROUND.DIRT, x, y )
87 | ground.Map:RebuildLayer( GROUND.DIRT, x+1, y )
88 | ground.Map:RebuildLayer( GROUND.DIRT, x, y +1)
89 | ground.Map:RebuildLayer( GROUND.DIRT, x+1, y+1 )
90 |
91 |
92 | local minimap = TheSim:FindFirstEntityWithTag("minimap")
93 | if minimap then
94 | minimap.MiniMap:RebuildLayer( original_tile_type, x, y )
95 | minimap.MiniMap:RebuildLayer( GROUND.DIRT, x, y )
96 | end
97 |
98 | SpawnTurf( GROUND_TURFS[tile], pt )
99 | SpawnTurf( GROUND_TURFS[tile], pt )
100 | SpawnTurf( GROUND_TURFS[tile], pt )
101 | SpawnTurf( GROUND_TURFS[tile], pt )
102 | return true
103 | end
104 | end
105 | end
106 |
107 |
108 | return Terraformer
109 |
--------------------------------------------------------------------------------
/mods/pick-level2/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "pick 4 lev 2"
3 | description = "can pick 4 block"
4 | author = "czfshine"
5 | version = "level-2"
6 | api_version = 5
7 |
--------------------------------------------------------------------------------
/mods/pick-level2/scripts/components/terraformer.lua:
--------------------------------------------------------------------------------
1 | local Terraformer = Class(function(self, inst)
2 | self.inst = inst
3 | end)
4 |
5 |
6 | local GROUND_TURFS =
7 | {
8 | [GROUND.ROCKY] = "turf_rocky",
9 | [GROUND.ROAD] = "turf_road",
10 | [GROUND.DIRT] = "turf_dirt",
11 | [GROUND.SAVANNA] = "turf_savanna",
12 | [GROUND.GRASS] = "turf_grass",
13 | [GROUND.FOREST] = "turf_forest",
14 | [GROUND.MARSH] = "turf_marsh",
15 | [GROUND.WOODFLOOR] = "turf_woodfloor",
16 | [GROUND.CARPET] = "turf_carpetfloor",
17 | [GROUND.CHECKER] = "turf_checkerfloor",
18 |
19 | [GROUND.CAVE] = "turf_cave",
20 | [GROUND.FUNGUS] = "turf_fungus",
21 | [GROUND.FUNGUSRED] = "turf_fungus_red",
22 | [GROUND.FUNGUSGREEN]= "turf_fungus_green",
23 |
24 | [GROUND.SINKHOLE] = "turf_sinkhole",
25 | [GROUND.UNDERROCK] = "turf_underrock",
26 | [GROUND.MUD] = "turf_mud",
27 |
28 | webbing = "turf_webbing",
29 | }
30 |
31 |
32 | function Terraformer:CanTerraformPoint(pt)
33 | local ground = GetWorld()
34 | if ground then
35 | local tile = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z)
36 | return tile ~= GROUND.IMPASSIBLE and tile ~= GROUND.DIRT and tile < GROUND.UNDERGROUND
37 | end
38 | return false
39 | end
40 |
41 | function Terraformer:CollectPointActions(doer, pos, actions, right)
42 | if right then
43 | local valid = true
44 | -- if RoadManager then
45 | -- valid = not RoadManager:IsOnRoad( pos.x, 0, pos.z )
46 | -- end
47 |
48 | if valid and self:CanTerraformPoint(pos) then
49 | table.insert(actions, ACTIONS.TERRAFORM)
50 | end
51 | end
52 | end
53 |
54 | local function SpawnTurf( turf, pt )
55 | if turf then
56 | local loot = SpawnPrefab(turf)
57 | loot.Transform:SetPosition(pt.x, pt.y, pt.z)
58 | if loot.Physics then
59 | local angle = math.random()*2*PI
60 | loot.Physics:SetVel(2*math.cos(angle), 10, 2*math.sin(angle))
61 | end
62 | end
63 | end
64 |
65 | function Terraformer:Terraform(pt)
66 | if self:CanTerraformPoint(pt) == false then
67 | return false
68 | end
69 | local returnval
70 | local ground = GetWorld()
71 | if ground then
72 | local tile1 = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z)
73 | local tile2 = ground.Map:GetTileAtPoint(pt.x+1, pt.y, pt.z)
74 | local tile3 = ground.Map:GetTileAtPoint(pt.x, pt.y+1, pt.z)
75 | local tile4 = ground.Map:GetTileAtPoint(pt.x+1, pt.y+1, pt.z)
76 |
77 | if tile1 ~= GROUND.DIRT then
78 | local original_tile_type = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z)
79 | local x, y = ground.Map:GetTileCoordsAtPoint(pt.x, pt.y, pt.z)
80 |
81 | ground.Map:SetTile( x, y, GROUND.DIRT )
82 | ground.Map:RebuildLayer( original_tile_type, x, y )
83 | ground.Map:RebuildLayer( GROUND.DIRT, x, y )
84 |
85 | local minimap = TheSim:FindFirstEntityWithTag("minimap")
86 | if minimap then
87 | minimap.MiniMap:RebuildLayer( original_tile_type, x, y )
88 | minimap.MiniMap:RebuildLayer( GROUND.DIRT, x, y )
89 | end
90 |
91 | SpawnTurf( GROUND_TURFS[tile1], pt )
92 | returnval=true
93 | end
94 |
95 | if tile2 ~= GROUND.DIRT then
96 | local original_tile_type = ground.Map:GetTileAtPoint(pt.x+1, pt.y, pt.z)
97 | local x, y = ground.Map:GetTileCoordsAtPoint(pt.x+1, pt.y, pt.z)
98 |
99 | ground.Map:SetTile( x+1, y, GROUND.DIRT )
100 | ground.Map:RebuildLayer( original_tile_type, x+1, y )
101 | ground.Map:RebuildLayer( GROUND.DIRT, x+1, y )
102 |
103 | local minimap = TheSim:FindFirstEntityWithTag("minimap")
104 | if minimap then
105 | minimap.MiniMap:RebuildLayer( original_tile_type, x+1, y )
106 | minimap.MiniMap:RebuildLayer( GROUND.DIRT, x+1, y )
107 | end
108 |
109 | SpawnTurf( GROUND_TURFS[tile2], pt )
110 | returnval=true
111 | end
112 | if tile3 ~= GROUND.DIRT then
113 | local original_tile_type = ground.Map:GetTileAtPoint(pt.x, pt.y+1, pt.z)
114 | local x, y = ground.Map:GetTileCoordsAtPoint(pt.x, pt.y+1, pt.z)
115 |
116 | ground.Map:SetTile( x, y+1, GROUND.DIRT )
117 | ground.Map:RebuildLayer( original_tile_type, x, y+1 )
118 | ground.Map:RebuildLayer( GROUND.DIRT, x, y+1 )
119 |
120 | local minimap = TheSim:FindFirstEntityWithTag("minimap")
121 | if minimap then
122 | minimap.MiniMap:RebuildLayer( original_tile_type, x, y+1 )
123 | minimap.MiniMap:RebuildLayer( GROUND.DIRT, x, y +1)
124 | end
125 |
126 | SpawnTurf( GROUND_TURFS[tile3], pt )
127 | returnval=true
128 | end
129 |
130 | if tile4 ~= GROUND.DIRT then
131 | local original_tile_type = ground.Map:GetTileAtPoint(pt.x+1, pt.y+1, pt.z)
132 | local x, y = ground.Map:GetTileCoordsAtPoint(pt.x+1, pt.y+1, pt.z)
133 |
134 | ground.Map:SetTile( x+1, y+1, GROUND.DIRT )
135 | ground.Map:RebuildLayer( original_tile_type, x+1, y+1 )
136 | ground.Map:RebuildLayer( GROUND.DIRT+1, x, y+1 )
137 |
138 | local minimap = TheSim:FindFirstEntityWithTag("minimap")
139 | if minimap then
140 | minimap.MiniMap:RebuildLayer( original_tile_type+1, x, y+1 )
141 | minimap.MiniMap:RebuildLayer( GROUND.DIRT+1, x, y +1)
142 | end
143 |
144 | SpawnTurf( GROUND_TURFS[tile4], pt )
145 | returnval=true
146 | end
147 |
148 | end
149 | end
150 |
151 |
152 | return Terraformer
153 |
--------------------------------------------------------------------------------
/mods/pick-level3/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "pick 4"
3 | description = "can pick 4 block"
4 | author = "czfshine"
5 | version = "level-1"
6 | api_version = 6
7 |
--------------------------------------------------------------------------------
/mods/pick-level4/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "pick 4"
3 | description = "can pick 4 block"
4 | author = "czfshine"
5 | version = "level-1"
6 | api_version = 6
7 |
--------------------------------------------------------------------------------
/mods/pick-level5/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "pick 4"
3 | description = "can pick 4 block"
4 | author = "czfshine"
5 | version = "level-1"
6 | api_version = 6
7 |
--------------------------------------------------------------------------------
/mods/芦苇/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "reeds"
3 | description = "can pick 4 block"
4 | author = "czfshine"
5 | version = "level-1"
6 | api_version = 5
7 |
--------------------------------------------------------------------------------
/mods/芦苇/modmain.lua:
--------------------------------------------------------------------------------
1 | require=GLOBAL.require
2 | GLOBAL.CHEATS_ENABLED = true
3 | require "constants"
4 | AddGameDebugKey=GLOBAL.require( 'debugkeys' )
5 |
6 | AddGameDebugKey(108, function()
7 | player=GLOBAL.GetPlayer()
8 | local pt = GLOBAL.Vector3(player.Transform:GetWorldPosition())
9 |
10 | local spawn = GLOBAL.SpawnPrefab("animal_track")
11 |
12 | spawn.Transform:SetPosition( pt.x,pt.y,pt.z )
13 | end
14 | )
15 |
--------------------------------------------------------------------------------
/mods/芦苇/scripts/prefabs/plantables.lua:
--------------------------------------------------------------------------------
1 | require "prefabutil"
2 |
3 | local notags = {'NOBLOCK', 'player', 'FX'}
4 | local function test_ground(inst, pt)
5 | local tiletype = GetGroundTypeAtPosition(pt)
6 | local ground_OK = tiletype ~= GROUND.ROCKY and tiletype ~= GROUND.ROAD and tiletype ~= GROUND.IMPASSABLE and
7 | tiletype ~= GROUND.UNDERROCK and tiletype ~= GROUND.WOODFLOOR and
8 | tiletype ~= GROUND.CARPET and tiletype ~= GROUND.CHECKER and tiletype < GROUND.UNDERGROUND
9 |
10 | if ground_OK then
11 | local ents = TheSim:FindEntities(pt.x,pt.y,pt.z, 4, nil, notags) -- or we could include a flag to the search?
12 | local min_spacing = inst.components.deployable.min_spacing or 2
13 |
14 | for k, v in pairs(ents) do
15 | if v ~= inst and v.entity:IsValid() and v.entity:IsVisible() and not v.components.placer and v.parent == nil then
16 | if distsq( Vector3(v.Transform:GetWorldPosition()), pt) < min_spacing*min_spacing then
17 | return false
18 | end
19 | end
20 | end
21 |
22 | return true
23 |
24 | end
25 | return false
26 |
27 | end
28 |
29 |
30 | local function make_plantable(data)
31 |
32 | local name = data.name
33 |
34 | local assets =
35 | {
36 | Asset("ANIM", "anim/"..name..".zip"),
37 | }
38 | if data.build then
39 | table.insert(assets, Asset("ANIM", "anim/"..data.build..".zip"))
40 | end
41 |
42 | local function ondeploy(inst, pt)
43 | local tree = SpawnPrefab(name)
44 | if tree then
45 | tree.Transform:SetPosition(pt.x, pt.y, pt.z)
46 | inst.components.stackable:Get():Remove()
47 | tree.components.pickable:OnTransplant()
48 | end
49 | end
50 |
51 | local function fn(Sim)
52 | local inst = CreateEntity()
53 | inst.entity:AddTransform()
54 | inst.entity:AddAnimState()
55 | --inst.entity:AddSoundEmitter()
56 | MakeInventoryPhysics(inst)
57 |
58 | inst.AnimState:SetBank(data.bank or data.name)
59 | inst.AnimState:SetBuild(data.build or data.name)
60 | inst.AnimState:PlayAnimation("dropped")
61 |
62 | inst:AddComponent("stackable")
63 | inst.components.stackable.maxsize = TUNING.STACK_SIZE_LARGEITEM
64 |
65 | inst:AddComponent("inspectable")
66 | inst.components.inspectable.nameoverride = data.inspectoverride or "dug_"..data.name
67 | inst:AddComponent("inventoryitem")
68 |
69 | inst:AddComponent("fuel")
70 | inst.components.fuel.fuelvalue = TUNING.LARGE_FUEL
71 |
72 |
73 | MakeMediumBurnable(inst, TUNING.LARGE_BURNTIME)
74 | MakeSmallPropagator(inst)
75 |
76 | inst:AddComponent("deployable")
77 | --inst.components.deployable.test = function() return true end
78 | inst.components.deployable.ondeploy = ondeploy
79 | inst.components.deployable.test = test_ground
80 | inst.components.deployable.min_spacing = data.minspace or 2
81 |
82 | inst:AddComponent("edible")
83 | inst.components.edible.foodtype = "WOOD"
84 | inst.components.edible.woodiness = 10
85 |
86 |
87 | ---------------------
88 | return inst
89 | end
90 |
91 | return Prefab( "common/objects/dug_"..name, fn, assets)
92 | end
93 |
94 | local plantables =
95 | {
96 | {name="berrybush", anim="idle_dead", minspace=2},
97 | {name="berrybush2", bank = "berrybush", inspectoverride = "dug_berrybush", anim = "idle_dead", minspace=2},
98 | {name="sapling", minspace=1},
99 | {name="grass", build="grass1", minspace=1},
100 | {name="marsh_bush", minspace=1},
101 | {name="reeds",build="grass1", minspace=1},
102 | }
103 |
104 | local prefabs= {}
105 | for k,v in pairs(plantables) do
106 | table.insert(prefabs, make_plantable(v))
107 | table.insert(prefabs, MakePlacer( "common/dug_"..v.name.."_placer", v.bank or v.name, v.build or v.name, v.anim or "idle" ))
108 | end
109 |
110 | return unpack(prefabs)
111 |
--------------------------------------------------------------------------------
/mods/芦苇/scripts/prefabs/reeds.lua:
--------------------------------------------------------------------------------
1 | local assets=
2 | {
3 | Asset("ANIM", "anim/grass.zip"),
4 | Asset("ANIM", "anim/reeds.zip"),
5 | Asset("SOUND", "sound/common.fsb"),
6 | }
7 |
8 | local prefabs =
9 | {
10 | "cutreeds",
11 | "dug_grass",
12 |
13 | }
14 |
15 |
16 |
17 | local function dig_up(inst, chopper)
18 | if inst.components.pickable and inst.components.pickable:CanBePicked() then
19 | inst.components.lootdropper:SpawnLootPrefab("cutreeds")
20 | end
21 | inst:Remove()
22 | local bush = inst.components.lootdropper:SpawnLootPrefab("dug_reeds")
23 |
24 | end
25 |
26 |
27 |
28 |
29 | local function onpickedfn(inst)
30 | inst.SoundEmitter:PlaySound("dontstarve/wilson/pickup_reeds")
31 | inst.AnimState:PlayAnimation("picking")
32 | inst.AnimState:PushAnimation("picked")
33 | end
34 |
35 | local function onregenfn(inst)
36 | inst.AnimState:PlayAnimation("grow")
37 | inst.AnimState:PushAnimation("idle", true)
38 | end
39 |
40 | local function makeemptyfn(inst)
41 | inst.AnimState:PlayAnimation("picked")
42 | end
43 |
44 |
45 | local function fn(Sim)
46 | local inst = CreateEntity()
47 | local trans = inst.entity:AddTransform()
48 | local anim = inst.entity:AddAnimState()
49 | local sound = inst.entity:AddSoundEmitter()
50 | local minimap = inst.entity:AddMiniMapEntity()
51 |
52 | minimap:SetIcon( "reeds.png" )
53 |
54 | anim:SetBank("grass")
55 | anim:SetBuild("reeds")
56 | anim:PlayAnimation("idle",true)
57 | anim:SetTime(math.random()*2)
58 | local color = 0.75 + math.random() * 0.25
59 | anim:SetMultColour(color, color, color, 1)
60 |
61 |
62 | inst:AddComponent("pickable")
63 | inst.components.pickable.picksound = "dontstarve/wilson/pickup_reeds"
64 | inst.components.pickable:SetUp("cutreeds", TUNING.REEDS_REGROW_TIME)
65 | inst.components.pickable.onregenfn = onregenfn
66 | inst.components.pickable.onpickedfn = onpickedfn
67 | inst.components.pickable.makeemptyfn = makeemptyfn
68 |
69 | inst.components.pickable.SetRegenTime = 120
70 |
71 | inst:AddComponent("inspectable")
72 |
73 |
74 | ---------------------
75 | inst:AddComponent("fuel")
76 | inst.components.fuel.fuelvalue = TUNING.SMALL_FUEL
77 |
78 |
79 | inst:AddComponent("lootdropper")
80 | inst:AddComponent("workable")
81 | inst.components.workable:SetWorkAction(ACTIONS.DIG)
82 | inst.components.workable:SetOnFinishCallback(dig_up)
83 | inst.components.workable:SetWorkLeft(1)
84 |
85 |
86 |
87 | MakeSmallBurnable(inst, TUNING.SMALL_FUEL)
88 | MakeSmallPropagator(inst)
89 | MakeNoGrowInWinter(inst)
90 | ---------------------
91 |
92 | return inst
93 | end
94 |
95 | return Prefab( "forest/objects/reeds", fn, assets, prefabs)
96 |
--------------------------------------------------------------------------------
/mods/蓝脚印/anim/koalefant_tracks.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/mods/蓝脚印/anim/koalefant_tracks.zip
--------------------------------------------------------------------------------
/mods/蓝脚印/modinfo.lua:
--------------------------------------------------------------------------------
1 | -- This information tells other players more about the mod
2 | name = "bule brack"
3 | description = "bule brack"
4 | author = "czfshine"
5 | version = "1.0"
6 | api_version = 5
7 |
--------------------------------------------------------------------------------
/mods/蓝脚印/modmain.lua:
--------------------------------------------------------------------------------
1 | require=GLOBAL.require
2 | GLOBAL.CHEATS_ENABLED = true
3 | require "constants"
4 | AddGameDebugKey=GLOBAL.require( 'debugkeys' )
5 |
6 | AddGameDebugKey(108, function()
7 | player=GLOBAL.GetPlayer()
8 | local pt = GLOBAL.Vector3(player.Transform:GetWorldPosition())
9 |
10 | local spawn = GLOBAL.SpawnPrefab("animal_track")
11 |
12 | spawn.Transform:SetPosition( pt.x,pt.y,pt.z )
13 | end
14 | )
15 |
--------------------------------------------------------------------------------
/module/ID.lua:
--------------------------------------------------------------------------------
1 | require "module.class"
2 |
3 |
4 | ID=Class(function(self)
5 | self.COUNTER = wxID_HIGHEST + 1
6 |
7 | end)
8 |
9 |
10 |
11 | function ID:New ()
12 | self.COUNTER = self.COUNTER + 1
13 | return self.COUNTER
14 | end
15 |
16 | return ID
17 |
--------------------------------------------------------------------------------
/module/api.lua:
--------------------------------------------------------------------------------
1 | api={}
2 |
3 | function addapi(name,fn)
4 | api[name]={}
5 | api[name].new=fn
6 | end
7 |
8 | addapi("Editbook",function (self)
9 | self.api=wxaui.wxAuiPaneInfo():
10 | Name("test"):
11 | Caption("Client Size Reporter"):
12 | Right():
13 | Layer(2):
14 | CloseButton(true):
15 | MaximizeButton(true):
16 | CaptionVisible (false):
17 | Center()
18 | return self.api
19 | end)
20 |
21 |
22 |
23 | addapi("Tree",function(self)
24 | self.api=wxaui.wxAuiPaneInfo():
25 | Name("test7"):
26 | Caption("Client Size Reporter"):
27 | Left():
28 | Layer(1):
29 | BestSize(200,200)
30 |
31 | return self.api
32 | end)
33 | addapi("Grid",function(self)
34 | self.api=wxaui.wxAuiPaneInfo():
35 | Name("test7"):
36 | Caption("Client Size Reporter"):
37 | Right():
38 | Layer(1):
39 | BestSize(200,200)
40 |
41 | return self.api
42 | end)
43 |
44 |
45 | addapi("Text",function (self)
46 | self.api=wxaui.wxAuiPaneInfo():
47 | Name(""):
48 | Caption(""):
49 | Right():
50 | Layer(3):
51 | CaptionVisible (false):
52 | Bottom():
53 | BestSize(200,200)
54 | return self.api
55 | end)
56 | addapi("Run",function (self)
57 | self.api=wxaui.wxAuiPaneInfo():
58 | Name(""):
59 | Caption(""):
60 | Left():
61 | Layer(3):
62 | CaptionVisible (false):
63 | --self.api:PaneBorder(true)
64 | Movable(false):
65 | Bottom():
66 | --PinButton(true):
67 | BestSize(200,200)
68 | return self.api
69 | end)
70 |
--------------------------------------------------------------------------------
/module/apiclass.lua:
--------------------------------------------------------------------------------
1 | require("module.class")
2 |
3 | local API=Class(function (self)
4 | self.api==wxaui.wxAuiPaneInfo()
5 |
6 |
7 |
8 | end)
9 |
10 | function API:我的名字是(name)
11 | self.api:Name(name)
12 | return self
13 | end
14 |
15 | function API:标题是什么好呢(tilte)
16 | self.api:Caption(tilte)
17 | return self
18 | end
19 |
20 | function API:我要在右边()
21 | self.api:Right()
22 | return self
23 | end
24 | function API:第几层(num)
25 | self.api:Layer(num)
26 | return self
27 | end
28 |
29 | function API:关闭按钮这么丑我才不要呢(b)
30 | self.api:CloseButton(b)
31 | return self
32 | end
33 | function API:最大化这个东东很好呀(b)
34 | self.api:MaximizeButton(b)
35 | return self
36 | end
37 | function API:标题栏被我吃了(b)
38 | self.api:CaptionVisible (b)
39 | return self
40 | end
41 | function API:我要在中间嘛()
42 | self.api:Center()
43 | return self
44 | end
45 |
46 | function API:左边这个位置风水好()
47 | self.api:Left()
48 | return self
49 | endfunction API:最小只能这么小哦(x,y)
50 | self.api:BestSize(x,y)
51 | return self
52 | endfunction API:我要在中间嘛()
53 | self.api:Center()
54 | return self
55 | endfunction API:我要在中间嘛()
56 | self.api:Center()
57 | return self
58 | end
59 | return API
--------------------------------------------------------------------------------
/module/aui.lua:
--------------------------------------------------------------------------------
1 | require("module.class")
2 | require "module.wxtree"
3 | require "module.editor"
4 | require "module.text"
5 | require "module.api"
6 | require "module.run"
7 | require "module.grid"
8 | Aui=Class(function (self,frame)
9 |
10 | self.m_mgr = wxaui.wxAuiManager()
11 | self.m_mgr:SetManagedWindow(frame)
12 | self.frame=frame
13 |
14 | self:Add(Tree,"Tree","notebook")
15 | self:Add(Editor,"Editbook","notebook")
16 | self:Add(Text,"Text","notebook")
17 | self:Add(Run,"Run","notebook")
18 | self:Add(Grid,"Grid","notebook")
19 | --=================!!!!
20 | self.m_mgr:Update()--is require
21 | --===================
22 |
23 |
24 | end)
25 | function Aui:Add(Class,name,child)
26 | self[name]=Class(self.frame)
27 | if api[name] then
28 | self.m_mgr:AddPane(self[name][child],api[name]:new())
29 | else
30 | self.m_mgr:AddPane(self[name][child],self[name].api)
31 | end
32 | end
33 |
34 | return Aui
35 |
--------------------------------------------------------------------------------
/module/class.lua:
--------------------------------------------------------------------------------
1 | -- class.lua
2 | -- Compatible with Lua 5.1 (not 5.0).
3 |
4 | local TrackClassInstances = false
5 |
6 | if TrackClassInstances == true then
7 | global("ClassTrackingTable")
8 | global("ClassTrackingInterval")
9 |
10 | ClassTrackingInterval = 100
11 | end
12 |
13 | function Class(base, _ctor)
14 | local c = {} -- a new class instance
15 | if not _ctor and type(base) == 'function' then
16 | _ctor = base
17 | base = nil
18 | elseif type(base) == 'table' then
19 | -- our new class is a shallow copy of the base class!
20 | for i,v in pairs(base) do
21 | c[i] = v
22 | end
23 | c._base = base
24 | end
25 |
26 | -- the class will be the metatable for all its objects,
27 | -- and they will look up their methods in it.
28 | c.__index = c
29 |
30 | -- expose a constructor which can be called by ()
31 | local mt = {}
32 |
33 | if TrackClassInstances == true then
34 | if ClassTrackingTable == nil then
35 | ClassTrackingTable = {}
36 | end
37 | ClassTrackingTable[mt] = {}
38 | local dataroot = "@"..CWD.."\\"
39 | local tablemt = {}
40 | setmetatable(ClassTrackingTable[mt], tablemt)
41 | tablemt.__mode = "k" -- now the instancetracker has weak keys
42 |
43 | local source = "**unknown**"
44 | if _ctor then
45 | -- what is the file this ctor was created in?
46 |
47 | local info = debug.getinfo(_ctor, "S")
48 | -- strip the drive letter
49 | -- convert / to \\
50 | source = info.source
51 | source = string.gsub(source, "/", "\\")
52 | source = string.gsub(source, dataroot, "")
53 | local path = source
54 |
55 | local file = io.open(path, "r")
56 | if file ~= nil then
57 | local count = 1
58 | for i in file:lines() do
59 | if count == info.linedefined then
60 | source = i
61 | -- okay, this line is a class definition
62 | -- so it's [local] name = Class etc
63 | -- take everything before the =
64 | local equalsPos = string.find(source,"=")
65 | if equalsPos then
66 | source = string.sub(source,1,equalsPos-1)
67 | end
68 | -- remove trailing and leading whitespace
69 | source = source:gsub("^%s*(.-)%s*$", "%1")
70 | -- do we start with local? if so, strip it
71 | if string.find(source,"local ") ~= nil then
72 | source = string.sub(source,7)
73 | end
74 | -- trim again, because there may be multiple spaces
75 | source = source:gsub("^%s*(.-)%s*$", "%1")
76 | break
77 | end
78 | count = count + 1
79 | end
80 | file:close()
81 | end
82 | end
83 |
84 | mt.__call = function(class_tbl, ...)
85 | local obj = {}
86 | setmetatable(obj,c)
87 | ClassTrackingTable[mt][obj] = source
88 | if c._ctor then
89 | c._ctor(obj,...)
90 | end
91 | return obj
92 | end
93 | else
94 | mt.__call = function(class_tbl, ...)
95 | local obj = {}
96 | setmetatable(obj,c)
97 | if c._ctor then
98 | c._ctor(obj,...)
99 | end
100 | return obj
101 | end
102 | end
103 |
104 | c._ctor = _ctor
105 | c.is_a = function(self, klass)
106 | local m = getmetatable(self)
107 | while m do
108 | if m == klass then return true end
109 | m = m._base
110 | end
111 | return false
112 | end
113 | setmetatable(c, mt)
114 | return c
115 | end
116 |
117 | local lastClassTrackingDumpTick = 0
118 |
119 | function HandleClassInstanceTracking()
120 | if TrackClassInstances then
121 | lastClassTrackingDumpTick = lastClassTrackingDumpTick + 1
122 |
123 | if lastClassTrackingDumpTick >= ClassTrackingInterval then
124 | collectgarbage()
125 | print("------------------------------------------------------------------------------------------------------------")
126 | lastClassTrackingDumpTick = 0
127 | if ClassTrackingTable then
128 | local sorted = {}
129 | local index = 1
130 | for i,v in pairs(ClassTrackingTable) do
131 | local count = 0
132 | local first = nil
133 | for j,k in pairs(v) do
134 | if count == 1 then
135 | first = k
136 | end
137 | count = count + 1
138 | end
139 | if count>1 then
140 | sorted[#sorted+1] = {first, count-1}
141 | end
142 | index = index + 1
143 | end
144 | -- get the top 10
145 | table.sort(sorted, function(a,b) return a[2] > b[2] end )
146 | for i=1,10 do
147 | local entry = sorted[i]
148 | if entry then
149 | print(tostring(i).." : "..tostring(sorted[i][1]).." - "..tostring(sorted[i][2]))
150 | end
151 | end
152 | print("------------------------------------------------------------------------------------------------------------")
153 | end
154 | end
155 | end
156 | end
--------------------------------------------------------------------------------
/module/editor.lua:
--------------------------------------------------------------------------------
1 | require "module.class"
2 | require "module.ID"
3 |
4 |
5 | Editor=Class(function(self,frame)
6 |
7 | self.notebook= wxaui.wxAuiNotebook(frame, wx.wxID_ANY,wx.wxDefaultPosition, wx.wxDefaultSize)
8 | self:NewEditor()
9 |
10 | end)
11 |
12 | function Editor:NewEditor()
13 | self.editor = wxstc.wxStyledTextCtrl(self.notebook, wx.wxID_ANY,
14 | wx.wxDefaultPosition, wx.wxSize(0, 0),
15 | wx.wxBORDER_NONE)
16 |
17 | self.notebook:AddPage(self.editor,"ll")
18 | end
19 |
20 | return Editor
21 |
--------------------------------------------------------------------------------
/module/event.lua:
--------------------------------------------------------------------------------
1 | require "module.openfile"
2 |
3 | eventfn=eventfn or {}
4 | eventfn.openfile=function (event)
5 | local filename=OpenFileDialog(eventfn.frame).fileName
6 | print_lua(filename)
7 | end
8 |
--------------------------------------------------------------------------------
/module/grid.lua:
--------------------------------------------------------------------------------
1 | require "module.class"
2 |
3 | Grid=Class(function(self,frame)
4 | self.notebook= wxaui.wxAuiNotebook(frame,
5 | wx.wxID_ANY,wx.wxDefaultPosition,
6 | wx.wxDefaultSize,
7 | wxaui.wxAUI_NB_BOTTOM+
8 | wxaui.wxAUI_NB_TAB_SPLIT+
9 | wxaui.wxAUI_NB_TAB_MOVE+
10 | wxaui.wxAUI_NB_TAB_EXTERNAL_MOVE)
11 | self.grid=wxGrid(self.notebook,wxID_ANY)
12 | self.panel=wxPanel(self.notebook, wx.wxID_ANY)
13 | self.sizer = wx.wxBoxSizer(wx.wxVERTICAL)
14 | local sizer1=self.sizer
15 | local panel1=self.panel
16 | local choices = {"one", "two", "three", "four"}
17 | local radioBox = wx.wxRadioBox(panel1, wx.wxID_ANY, "wxRadioBox",
18 | wx.wxDefaultPosition, wx.wxDefaultSize,
19 | choices, 1, wx.wxRA_SPECIFY_ROWS)
20 | local listBox = wx.wxListBox(panel1, wx.wxID_ANY, wx.wxDefaultPosition,
21 | wx.wxDefaultSize, choices)
22 | local listBoxStaticBox = wx.wxStaticBox( panel1, wx.wxID_ANY, "wxListBox")
23 | local listBoxStaticBoxSizer = wx.wxStaticBoxSizer( listBoxStaticBox, wx.wxVERTICAL )
24 |
25 | listBoxStaticBoxSizer:Add(listBox, 1, wx.wxALL + wx.wxGROW + wx.wxCENTER, 5)
26 |
27 | sizer1:Add(radioBox, 1, wx.wxALL + wx.wxGROW, 5)
28 | sizer1:Add(listBoxStaticBoxSizer, 1, wx.wxALL + wx.wxGROW, 5)
29 |
30 | panel1:SetSizer(sizer1)
31 | sizer1:SetSizeHints(panel1)
32 |
33 | self.notebook:AddPage(self.grid,"属性")
34 | self.notebook:AddPage(self.panel,"选择")
35 | end)
36 |
37 | return Grid
--------------------------------------------------------------------------------
/module/menu.lua:
--------------------------------------------------------------------------------
1 | -------------------------------------
2 | --菜单类
3 | ------------------------------------
4 | require("module.class")
5 | require "module.event"
6 |
7 | Menu=Class(function (self,frame)
8 |
9 | 啦啦啦=1
10 | print_lua(啦啦啦)
11 | self.menubar=wx.wxMenuBar() --菜单栏
12 | self.frame=frame
13 | self.ID={}
14 | local menubar=self.menubar
15 |
16 | local fileMenu = wx.wxMenu()
17 | self:Add(fileMenu,"打开(&O)","openfile")
18 | self:Add(fileMenu,"YUNGXIN","run")
19 | local helpMenu = wx.wxMenu()
20 | self:Add(helpMenu,"帮助(&H)","help")
21 | menubar:Append(fileMenu, "&File")
22 | menubar:Append(helpMenu, "&Help")
23 |
24 |
25 | end)
26 |
27 | function Menu:Add(menu,name,eventname,str)
28 | --增加菜单项
29 | local id=ID:New()
30 | self.ID[name]=id
31 | menu:Append(id, name, str or "")
32 | self.frame:Connect(id, wx.wxEVT_COMMAND_MENU_SELECTED,
33 | eventfn[eventname] or function (event) end)
34 |
35 | end
36 |
37 | return Meun
38 |
39 |
--------------------------------------------------------------------------------
/module/notebook.lua:
--------------------------------------------------------------------------------
1 | require "module.class"
2 |
3 | Notebook=Class(function(self,frame)
4 | self.notebook = wxaui.wxAuiNotebook(frame, wx.wxID_ANY,
5 | wx.wxDefaultPosition, wx.wxDefaultSize
6 | )
7 | self.api=wxaui.wxAuiPaneInfo()
8 | self.api:Name("test")
9 | self.api:Caption("Client Size Reporter")
10 | self.api:Right()
11 | self.api:Layer(2)
12 | self.api:CloseButton(true)
13 | self.api:MaximizeButton(true)
14 | self.api:CaptionVisible (false)--标题
15 |
16 | end)
17 |
18 | return Notebook
19 |
--------------------------------------------------------------------------------
/module/openfile.lua:
--------------------------------------------------------------------------------
1 | require "module.class"
2 |
3 | OpenFileDialog=Class(function (self,frame)
4 | self.fileDialog = wx.wxFileDialog(frame,
5 | "Open Lua file",
6 | "",
7 | "",
8 | "lua file (*.lua)|*.lua|All files(*)|*",
9 | wx.wxFD_OPEN + wx.wxFD_FILE_MUST_EXIST)
10 | self.result = false
11 | if self.fileDialog:ShowModal() == wx.wxID_OK then
12 | self.fileName = self.fileDialog:GetPath()
13 | frame:SetTitle("饥荒mod平台" .. self.fileName)
14 | end
15 | if fileDialog then
16 | fileDialog:Destroy()
17 | end
18 |
19 | end)
20 |
21 |
--------------------------------------------------------------------------------
/module/process.lua:
--------------------------------------------------------------------------------
1 | require "module.class"
2 | --[[
3 | Process=Class(function (self,frame,cmdmod)
4 |
5 | end)
6 |
7 | function Process:Run(cmd,sync)
8 | self.process =wxProcess()
9 | if cmdmod then
10 | self.process:Redirect()
11 | end
12 |
13 | self.process:Connect(wx.wxEVT_END_PROCESS,function (event)
14 |
15 | self.process=nil
16 | print_lua("kill",event:GetPid())
17 |
18 | end)
19 |
20 |
21 | local pid = wx.wxExecute(cmd,sync,self.process)
22 |
23 | if pid == -1 then
24 | print_lua("Unknown ERROR Running program!\n", true)
25 | else
26 | print_lua("Process id is: "..tostring(pid).."\n", true)
27 | end
28 |
29 | end
30 | ]]
31 | return Process
--------------------------------------------------------------------------------
/module/run.lua:
--------------------------------------------------------------------------------
1 | require "module.class"
2 |
3 | Run=Class(function(self,frame)
4 | self.notebook= wxaui.wxAuiNotebook(frame, wx.wxID_ANY,wx.wxDefaultPosition, wx.wxDefaultSize,wxaui.wxAUI_NB_BOTTOM)
5 | self.text=wxstc.wxStyledTextCtrl(self.notebook, wx.wxID_ANY,
6 | wx.wxDefaultPosition, wx.wxSize(0, 0),
7 | wx.wxBORDER_NONE)
8 | self.notebook:AddPage(self.text,"..")
9 | end)
10 |
11 | return Run
12 |
--------------------------------------------------------------------------------
/module/runtext.lua:
--------------------------------------------------------------------------------
1 | -- coding: UTF-8
2 | --运行框
3 | -------------------------------------------
4 | require "module.class"
5 |
6 | RunText=Class(function(self,frame)
7 | self.notebook= wxaui.wxAuiNotebook(frame, wx.wxID_ANY,wx.wxDefaultPosition, wx.wxDefaultSize,wxaui.wxAUI_NB_BOTTOM)
8 | self.text=wxstc.wxStyledTextCtrl(self.notebook, wx.wxID_ANY,
9 | wx.wxDefaultPosition, wx.wxSize(0, 0),
10 | wx.wxBORDER_NONE)
11 | self.notebook:AddPage(self.text,"..")
12 | end)
13 |
14 | return RunText
15 |
--------------------------------------------------------------------------------
/module/text.lua:
--------------------------------------------------------------------------------
1 | require "module.class"
2 |
3 | Text=Class(function(self,frame)
4 | self.notebook= wxaui.wxAuiNotebook(frame,
5 | wx.wxID_ANY,
6 | wx.wxDefaultPosition,
7 | wx.wxDefaultSize,
8 | wxaui.wxAUI_NB_BOTTOM)
9 | self.text=wxTextCtrl(self.notebook,wxID_ANY)
10 | self.notebook:AddPage(self.text,"..")
11 |
12 | end)
13 |
14 | return Text
--------------------------------------------------------------------------------
/module/win.lua:
--------------------------------------------------------------------------------
1 | require("module.class")
2 | Aui=require("module.aui")
3 |
4 | MainWin = Class(wxFrame,function(self,parent,id,title,pos,size,style,name)
5 | parent=parent or wx.NULL
6 | id=id or wx.wxID_ANY
7 | title=title or strings.view.DefaultTitle
8 | pos=pos or wx.wxDefaultPosition
9 | size=size or wx.wxDefaultSize
10 | style= style or wx.wxDEFAULT_FRAME_STYLE
11 | name =name or ""
12 |
13 |
14 | self.frame=wx.wxFrame(parent,id,title,pos,size,style,name)
15 | local frame=self.frame
16 |
17 | local xpmdata =
18 | {
19 | "16 16 5 1",
20 | " c None",
21 | "a c Black",
22 | "b c #FFFFFF",
23 | "c c #808080",
24 | "d c #9DBDCD",
25 | " aaaaaaaaaaaa ",
26 | " addddddddddac ",
27 | " adaaaaaaaadac ",
28 | " adabbbbbbadac ",
29 | " adabbbbbbadac ",
30 | " adaaaaaaaadac ",
31 | " addddddddddac ",
32 | " adaadaadaadac ",
33 | " adaadaadaadac ",
34 | " addddddddddac ",
35 | " adaadaadaadac ",
36 | " adaadaadaadac ",
37 | " addddddddddac ",
38 | " aaaaaaaaaaaac ",
39 | " ccccccccccccc ",
40 | " aaaaaaaaaaaac "
41 | }
42 |
43 | --frame:SetCursor(wxCursor( 1,wxImage(wx.wxBitmap(xpmdata))))
44 | frame:SetCursor(wxCursor(2))
45 |
46 | im=wxImage(wx.wxBitmap(xpmdata))
47 | im:SaveFile("1.png")
48 | aui=Aui(frame)
49 |
50 |
51 | end)
52 |
53 | return MainWin
54 |
--------------------------------------------------------------------------------
/module/wxtree.lua:
--------------------------------------------------------------------------------
1 | require("module.class")
2 |
3 |
4 | Tree=Class(function(self,frame,data)
5 |
6 |
7 |
8 | self.notebook= wxaui.wxAuiNotebook(frame, wx.wxID_ANY,wx.wxDefaultPosition, wx.wxDefaultSize,
9 | wxaui.wxAUI_NB_BOTTOM+wxaui.wxAUI_NB_TAB_SPLIT+wxaui.wxAUI_NB_TAB_MOVE+wxaui.wxAUI_NB_TAB_EXTERNAL_MOVE)
10 | self.tree = wx.wxTreeCtrl( self.notebook, wx.wxID_ANY,
11 | wx.wxDefaultPosition, wx.wxSize(-1, 200),
12 | wx.wxTR_LINES_AT_ROOT + wx.wxTR_HAS_BUTTONS )
13 | local tree=self.tree
14 | self.notebook:AddPage(self.tree,"..")
15 |
16 |
17 |
18 |
19 | local root_id = tree:AddRoot( "Root" )
20 | local parent_id = tree:AppendItem( root_id, "Parent " )
21 | local child_id = tree:AppendItem( parent_id, "Child " )
22 | --local imagelist=wx.wxImageList(32,32)
23 | --local bitmap = wx.wxBitmap(sample_xpm)
24 | --imagelist:Add(bitmap) --index is 0 no 1
25 | --tree:AssignImageList(imagelist)
26 | --tree:SetItemImage(root_id,0,wx.wxTreeItemIcon_Normal)
27 | --tree:SetItemTextColour(root_id,wx.wxColour("0xFF0000"))
28 | --tree:SetItemBackgroundColour(root_id,wx.wxColour("0xFF0000"))
29 | tree:SetIndent(32)
30 | tree:SetItemDropHighlight(root_id,true)
31 | local child_id2=tree:PrependItem ( root_id,"string",0)
32 |
33 | end)
34 | return Tree
35 |
--------------------------------------------------------------------------------
/res/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/res/1.png
--------------------------------------------------------------------------------
/res/ICO.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/res/ICO.jpg
--------------------------------------------------------------------------------
/res/ICO.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/res/ICO.xcf
--------------------------------------------------------------------------------
/res/lua中文文法.md:
--------------------------------------------------------------------------------
1 | LUA 5.1 BNF
2 | ================
3 | **语句组** ::= {语句段 [\`;´]} [段尾 [`;´]]
4 |
5 | **语句块** ::= 语句组
6 |
7 | **语句段** ::= 值列 \`=´ 表达式列 |
8 |
9 | >>> 函数调用 |
10 |
11 | >>>**do** 语句块 **end** |
12 |
13 | >>>**while** 表达式 **do** 语句块 **end** |
14 |
15 | >>>**repeat** 语句块 **until** 表达式 |
16 |
17 | >>>**if** 表达式 **then** 语句块 {**elseif** 表达式 **then** 语句块} [**else** 语句块] **end** |
18 |
19 | >>>**for** 变量 \`=´ 表达式 \`,´ 表达式 [\`,´ 表达式] **do** 语句块 **end** |
20 |
21 | >>>**for** 变量列 **in** 表达式列 **do** 语句块 **end** |
22 |
23 | >>>**function** 函数名 函数体 |
24 |
25 | >>>**local** **function** 变量 函数体 |
26 |
27 | >>>**local** 变量列 [\`=´ 表达式列]
28 |
29 | **段尾** ::= **return** [表达式列] | **break**
30 |
31 | **函数名** ::= 变量 {\`.´ 变量} [\`:´ 变量]
32 |
33 | **值列** ::= 值 {`,´ 值}
34 |
35 | **值** ::= 变量 | 前缀表达式 \`[´ 表达式 \`]´ | 前缀表达式 `.´ 变量
36 |
37 | **变量列** ::= 变量 {`,´ 变量}
38 |
39 | **表达式列** ::= {表达式 `,´} 表达式
40 |
41 | **表达式** ::= **nil** | **false** | **true** | 数字 | 字符串 | `...´ | 函数 |
42 | 前缀表达式 | 表构造子 | 表达式 二元符 表达式 | 一元符 表达式
43 |
44 | **前缀表达式** ::= 值 | 函数调用 | \`(´ 表达式 `)´
45 |
46 | **函数调用** ::= 前缀表达式 参数 | 前缀表达式 `:´ 变量 参数
47 |
48 | **参数** ::= \`(´ [值列] `)´ | 表构造子 | 字符串
49 |
50 | **函数** ::= **function** 函数体
51 |
52 | **函数体** ::= \`(´ [形参] `)´ 语句块 **end**
53 |
54 | **形参** ::= 变量列 [\`,´ \`...´] | `...´
55 |
56 | **表构造子** ::=\ \`{´ [域列] \`}´
57 |
58 | **域列** ::= 域 {域分隔符 域} [域分隔符]
59 |
60 | **域** ::= \`[´ 表达式 \`]´ \`=´ 表达式 | 变量 \`=´ 表达式 | 表达式
61 |
62 | **域分隔符** ::= \`,´ | `;´
63 |
64 | **二元符** ::= \`+´ | \`-´ | \`*´ | \`/´ | \`^´ | \`%´ | \`..´ |
65 |
66 | >>>\`<´ | \`<=´ | \`>´ | \`>=´ | \`==´ | `~=´ |
67 |
68 | >>>**and** | **or**
69 |
70 | **一元符** ::= \`-´ | **not** | `#´
71 |
--------------------------------------------------------------------------------
/res/lua文法.md:
--------------------------------------------------------------------------------
1 | LUA 5.1 BNF
2 | ================
3 | **chunk** ::= {stat [\`;´]} [laststat [`;´]]
4 |
5 | **block** ::= chunk
6 |
7 | **stat** ::= varlist \`=´ explist |
8 |
9 | >>> functioncall |
10 |
11 | >>>**do** block **end** |
12 |
13 | >>>**while** exp **do** block **end** |
14 |
15 | >>>**repeat** block **until** exp |
16 |
17 | >>>**if** exp **then** block {**elseif** exp **then** block} [**else** block] **end** |
18 |
19 | >>>**for** Name \`=´ exp \`,´ exp [\`,´ exp] **do** block **end** |
20 |
21 | >>>**for** namelist **in** explist **do** block **end** |
22 |
23 | >>>**function** funcname funcbody |
24 |
25 | >>>**local** **function** Name funcbody |
26 |
27 | >>>**local** namelist [\`=´ explist]
28 |
29 | **laststat** ::= **return** [explist] | **break**
30 |
31 | **funcname** ::= Name {\`.´ Name} [\`:´ Name]
32 |
33 | **varlist** ::= var {`,´ var}
34 |
35 | **var** ::= Name | prefixexp \`[´ exp \`]´ | prefixexp `.´ Name
36 |
37 | **namelist** ::= Name {`,´ Name}
38 |
39 | **explist** ::= {exp `,´} exp
40 |
41 | **exp** ::= **nil** | **false** | **true** | Number | String | `...´ | function |
42 | prefixexp | tableconstructor | exp binop exp | unop exp
43 |
44 | **prefixexp** ::= var | functioncall | \`(´ exp `)´
45 |
46 | **functioncall** ::= prefixexp args | prefixexp `:´ Name args
47 |
48 | **args** ::= \`(´ [explist] `)´ | tableconstructor | String
49 |
50 | **functio**n ::= **function** funcbody
51 |
52 | **funcbody** ::= \`(´ [parlist] `)´ block **end**
53 |
54 | **parlist** ::= namelist [\`,´ \`...´] | `...´
55 |
56 | **tableconstructor** ::=\ \`{´ [fieldlist] \`}´
57 |
58 | **fieldlist** ::= field {fieldsep field} [fieldsep]
59 |
60 | **field** ::= \`[´ exp \`]´ \`=´ exp | Name \`=´ exp | exp
61 |
62 | **fieldsep** ::= \`,´ | `;´
63 |
64 | **binop** ::= \`+´ | \`-´ | \`*´ | \`/´ | \`^´ | \`%´ | \`..´ |
65 |
66 | >>>\`<´ | \`<=´ | \`>´ | \`>=´ | \`==´ | `~=´ |
67 |
68 | >>>**and** | **or**
69 |
70 | **unop** ::= \`-´ | **not** | `#´
71 |
72 | LUA 5.2 BNF
73 | ================
74 |
75 | chunk ::= block
76 |
77 | block ::= {stat} [retstat]
78 |
79 | stat ::= ‘;’ |
80 |
81 | >>>varlist ‘=’ explist |
82 |
83 | >>>functioncall |
84 |
85 | >>>label |
86 |
87 | >>>break |
88 |
89 | >>>goto Name |
90 |
91 | >>>do block end |
92 |
93 | >>>while exp do block end |
94 |
95 | >>>repeat block until exp |
96 |
97 | >>>if exp then block {elseif exp then block} [else block] end |
98 |
99 | >>>for Name ‘=’ exp ‘,’ exp [‘,’ exp] do block end |
100 |
101 | >>>for namelist in explist do block end |
102 |
103 | >>>function funcname funcbody |
104 |
105 | >>>local function Name funcbody |
106 |
107 | >>>local namelist [‘=’ explist]
108 |
109 |
110 | retstat ::= return [explist] [‘;’]
111 |
112 | label ::= ‘::’ Name ‘::’
113 |
114 | funcname ::= Name {‘.’ Name} [‘:’ Name]
115 |
116 | varlist ::= var {‘,’ var}
117 |
118 | var ::= Name | prefixexp ‘[’ exp ‘]’ | prefixexp ‘.’ Name
119 |
120 | namelist ::= Name {‘,’ Name}
121 |
122 | explist ::= exp {‘,’ exp}
123 |
124 | exp ::= nil | false | true | Number | String | ‘...’ | functiondef |
125 |
126 | >>>prefixexp | tableconstructor | exp binop exp | unop exp
127 |
128 | prefixexp ::= var | functioncall | ‘(’ exp ‘)’
129 |
130 | functioncall ::= prefixexp args | prefixexp ‘:’ Name args
131 |
132 | args ::= ‘(’ [explist] ‘)’ | tableconstructor | String
133 |
134 | functiondef ::= function funcbody
135 |
136 | funcbody ::= ‘(’ [parlist] ‘)’ block end
137 |
138 | parlist ::= namelist [‘,’ ‘...’] | ‘...’
139 |
140 | tableconstructor ::= ‘{’ [fieldlist] ‘}’
141 |
142 | fieldlist ::= field {fieldsep field} [fieldsep]
143 |
144 | field ::= ‘[’ exp ‘]’ ‘=’ exp | Name ‘=’ exp | exp
145 |
146 | fieldsep ::= ‘,’ | ‘;’
147 |
148 | binop ::= ‘+’ | ‘-’ | ‘*’ | ‘/’ | ‘^’ | ‘%’ | ‘..’ |
149 |
150 | >>>‘<’ | ‘<=’ | ‘>’ | ‘>=’ | ‘==’ | ‘~=’ |
151 |
152 | >>>and | or
153 |
154 | unop ::= ‘-’ | not | ‘#’
155 |
156 |
--------------------------------------------------------------------------------
/run.lua:
--------------------------------------------------------------------------------
1 | -------------------------------------
2 | --使用ide运行程序
3 | --可以进入debug
4 | ----------------------------
5 | dofile("src\\main.lua")
6 |
--------------------------------------------------------------------------------
/run.wlua:
--------------------------------------------------------------------------------
1 | -------------------------------------
2 | --使用ide运行程序
3 | --可以进入debug
4 | ----------------------------
5 | dofile("src\\main.lua")
6 |
--------------------------------------------------------------------------------
/src/main.lua:
--------------------------------------------------------------------------------
1 | -------------------------
2 | --main f
3 | --by:czfshine
4 | --time:2014-12-10 19:14
5 | ---------------------------
6 | require("tool.osystem")
7 |
8 | -- Load the wxLua module
9 | require("wx")
10 | setmetatable(_G, {__index=wx})
11 |
12 | require("module.class")
13 | require("module.menu")
14 | require("module.win")
15 |
16 | idclass=require "module.ID"
17 |
18 | ID=idclass()
19 |
20 |
21 | --==string================
22 | strings={}
23 | strings.view={}
24 | strings.view.maintitle="啦啦啦"
25 | strings.view.DefaultTitle="frame"
26 |
27 | --========view================
28 |
29 | MyApp={}
30 | function MyApp:OnInit()
31 |
32 | local mainwin=MainWin(wx.NULL,
33 | wx.wxID_ANY,
34 | strings.view.maintitle,
35 | wx.wxDefaultPosition,
36 | wx.wxSize(800,600),
37 | wx.wxDEFAULT_FRAME_STYLE
38 | +wx.wxMAXIMIZE)
39 | local frame=mainwin.frame
40 |
41 | require "module.event"
42 | eventfn.frame=frame
43 |
44 |
45 | local menu=Menu(frame)
46 | local menubar=menu.menubar
47 | frame:SetMenuBar(menubar)
48 |
49 |
50 |
51 | wx.wxGetApp():SetTopWindow(frame);
52 | frame:Show();
53 | return true;
54 | end
55 |
56 | --========view=end=========
57 | MyApp:OnInit()
58 | wx.wxGetApp():MainLoop()
59 | os.exit(0)
60 |
--------------------------------------------------------------------------------
/tool/mod处理/mod2luac.lua:
--------------------------------------------------------------------------------
1 |
2 | local tmp = "/tmp"
3 | local sep = "\\"
4 | local upper = ".."
5 |
6 |
7 | require"lfs"
8 | print (lfs._VERSION)
9 |
10 | path="e:\\boxlock"
11 |
12 |
13 | local newdir=path.."1"
14 |
15 | lfs.mkdir(newdir..sep)
16 | print("XCOPY \""..path.."".."\" \""..newdir..sep.."\" /S")
17 | os.execute("XCOPY \""..path.."".."\" \""..newdir..sep.."\" /S" )
18 |
19 | function dir (path)
20 |
21 |
22 | print(path)
23 |
24 | for file in lfs.dir(path) do
25 | if file ~= "." and file ~= ".." then
26 | local f = path..sep..file
27 |
28 | local attr = lfs.attributes (f)
29 | assert (type(attr) == "table")
30 | if attr.mode == "directory" then
31 | dir (f)
32 | elseif attr.mode == "file" then
33 | ext=f:sub(-3,-1)
34 | pp=f:sub(1,-5)
35 | print(f,ext,pp)
36 | if ext=="lua" then
37 |
38 | print(f)
39 |
40 | os.execute("luac -o "..pp..".lua "..f)
41 |
42 | end
43 | end
44 | end
45 | end
46 | end
47 |
48 | dir (newdir)
49 |
--------------------------------------------------------------------------------
/tool/osystem.lua:
--------------------------------------------------------------------------------
1 | --coding: UTF-8-------
2 | --获取系统版本信息
3 | --------------------------------------------------
4 | -- put bin/ first to avoid conflicts with included modules
5 | -- that may have other versions present somewhere else in path/cpath.
6 | os.iswindows = os.getenv('WINDIR') or (os.getenv('OS') or ''):match('[Ww]indows')
7 |
8 | os.islinux = not os.iswindows and not os.getenv('DYLD_LIBRARY_PATH') and io.open("/proc")
9 | os.arch = "x86" -- use 32bit by default
10 | unpack = table.unpack or unpack
11 |
12 | if os.islinux then
13 | local file = io.popen("uname -m")
14 | if file then
15 | local machine=file:read("*l")
16 | local archtype= { x86_64="x64", armv7l="armhf" }
17 | print(machine)
18 | os.arch = archtype[machine] or "x86"
19 | file:close()
20 | end
21 | end
22 |
23 | package.cpath = (
24 | os.iswindows and 'bin/?.dll;bin/clibs/?.dll;' or
25 | os.islinux and ('bin/linux/%s/lib?.so;bin/linux/%s/clibs/?.so;'):format(os.arch,os.arch) or
26 | --[[isosx]] 'bin/lib?.dylib;bin/clibs/?.dylib;')
27 | .. package.cpath
28 |
29 | package.path = 'lualibs/?.lua;lualibs/?/?.lua;lualibs/?/init.lua;lualibs/?/?/?.lua;lualibs/?/?/init.lua;'
30 | .. package.path
--------------------------------------------------------------------------------
/tool/tablesave.lua:
--------------------------------------------------------------------------------
1 | -- coding: UTF-8-----------------
2 | --将table 保存进文件,与读取保存文件
3 | ---------------------------------
4 | --[[
5 | Save Table to File
6 | Load Table from File
7 | v 1.0
8 |
9 | Lua 5.2 compatible
10 |
11 | Only Saves Tables, Numbers and Strings
12 | Insides Table References are saved
13 | Does not save Userdata, Metatables, Functions and indices of these
14 | ----------------------------------------------------
15 | table.save( table , filename )
16 |
17 | on failure: returns an error msg
18 |
19 | ----------------------------------------------------
20 | table.load( filename or stringtable )
21 |
22 | Loads a table that has been saved via the table.save function
23 |
24 | on success: returns a previously saved table
25 | on failure: returns as second argument an error msg
26 | ----------------------------------------------------
27 |
28 | Licensed under the same terms as Lua itself.
29 | ]]--
30 | do
31 | -- declare local variables
32 | --// exportstring( string )
33 | --// returns a "Lua" portable version of the string
34 | local function exportstring( s )
35 | return string.format("%q", s)
36 | end
37 |
38 | --// The Save Function
39 | function table.save( tbl,filename )
40 | local charS,charE = " ","\n"
41 | local file,err = io.open( filename, "wb" )
42 | if err then return err end
43 |
44 | -- initiate variables for save procedure
45 | local tables,lookup = { tbl },{ [tbl] = 1 }
46 | file:write( "return {"..charE )
47 |
48 | for idx,t in ipairs( tables ) do
49 | file:write( "-- Table: {"..idx.."}"..charE )
50 | file:write( "{"..charE )
51 | local thandled = {}
52 |
53 | for i,v in ipairs( t ) do
54 | thandled[i] = true
55 | local stype = type( v )
56 | -- only handle value
57 | if stype == "table" then
58 | if not lookup[v] then
59 | table.insert( tables, v )
60 | lookup[v] = #tables
61 | end
62 | file:write( charS.."{"..lookup[v].."},"..charE )
63 | elseif stype == "string" then
64 | file:write( charS..exportstring( v )..","..charE )
65 | elseif stype == "number" then
66 | file:write( charS..tostring( v )..","..charE )
67 | end
68 | end
69 |
70 | for i,v in pairs( t ) do
71 | -- escape handled values
72 | if (not thandled[i]) then
73 |
74 | local str = ""
75 | local stype = type( i )
76 | -- handle index
77 | if stype == "table" then
78 | if not lookup[i] then
79 | table.insert( tables,i )
80 | lookup[i] = #tables
81 | end
82 | str = charS.."[{"..lookup[i].."}]="
83 | elseif stype == "string" then
84 | str = charS.."["..exportstring( i ).."]="
85 | elseif stype == "number" then
86 | str = charS.."["..tostring( i ).."]="
87 | end
88 |
89 | if str ~= "" then
90 | stype = type( v )
91 | -- handle value
92 | if stype == "table" then
93 | if not lookup[v] then
94 | table.insert( tables,v )
95 | lookup[v] = #tables
96 | end
97 | file:write( str.."{"..lookup[v].."},"..charE )
98 | elseif stype == "string" then
99 | file:write( str..exportstring( v )..","..charE )
100 | elseif stype == "number" then
101 | file:write( str..tostring( v )..","..charE )
102 | end
103 | end
104 | end
105 | end
106 | file:write( "},"..charE )
107 | end
108 | file:write( "}" )
109 | file:close()
110 | end
111 |
112 | --// The Load Function
113 | function table.load( sfile )
114 | local ftables,err = loadfile( sfile )
115 | if err then return _,err end
116 | local tables = ftables()
117 | for idx = 1,#tables do
118 | local tolinki = {}
119 | for i,v in pairs( tables[idx] ) do
120 | if type( v ) == "table" then
121 | tables[idx][i] = tables[v[1]]
122 | end
123 | if type( i ) == "table" and tables[i[1]] then
124 | table.insert( tolinki,{ i,tables[i[1]] } )
125 | end
126 | end
127 | -- link indices
128 | for _,v in ipairs( tolinki ) do
129 | tables[idx][v[2]],tables[idx][v[1]] = tables[idx][v[1]],nil
130 | end
131 | end
132 | return tables[1]
133 | end
134 | -- close do
135 | end
136 |
137 | -- ChillCode
--------------------------------------------------------------------------------
/tool/批量tex转换/README.md:
--------------------------------------------------------------------------------
1 | 饥荒图片处理
2 | ============================
3 | 本工具用来处理饥荒纹理图片的,可以将饥荒的tex转换成png格式,并利用
4 | 对应的xml文件解析切割成小的png图片。
5 |
6 | 依赖
7 | ========================
8 | 这个工具需要用到`ktools`,lua的`wx`,`lfs`(luafilesystem),`luaxml`库。
9 |
10 | 如何使用
11 | ======================================
12 |
13 | 修改tex2png.lua的最后一行的attrdir函数为你的饥荒路径,例如
14 |
15 | ```lua
16 | attrdir("E:/ds")
17 | ```
18 | 运行tex2png.lua
19 |
20 |
21 | 修改xml2png.lua的最后一行的attrdir函数为你的饥荒路径,例如
22 |
23 | ```lua
24 | attrdir("E:/ds")
25 | ```
26 | 运行xml2png.lua
27 |
28 | 在饥荒对应的目录下会输出对应的png文件。
29 |
--------------------------------------------------------------------------------
/tool/批量tex转换/tex2png.lua:
--------------------------------------------------------------------------------
1 | --coding: UTF-8-------
2 | --********************************+
3 | --将目录下的所有tex后缀的纹理图片*+
4 | --用ktech转换成png格式************+
5 | --********************************+
6 | ----------------------------------------
7 | --配置---------------------------
8 | ---------------------------------
9 |
10 | --饥荒目录
11 | local ds_dir="H:\\ds1"
12 |
13 | --------------------------------
14 | --获取系统版本信息
15 | --------------------------------------------------
16 | -- put bin/ first to avoid conflicts with included modules
17 | -- that may have other versions present somewhere else in path/cpath.
18 | os.iswindows = os.getenv('WINDIR')
19 | or (os.getenv('OS') or ''):match('[Ww]indows')
20 | os.islinux = not os.iswindows
21 | and not os.getenv('DYLD_LIBRARY_PATH')
22 | and io.open("/proc")
23 | os.arch = "x86" -- use 32bit by default
24 | unpack = table.unpack or unpack
25 | --获取位数
26 | if os.islinux then
27 | local file = io.popen("uname -m")
28 | if file then
29 | local machine=file:read("*l")
30 | local archtype= { x86_64="x64", armv7l="armhf" }
31 | print(machine)
32 | os.arch = archtype[machine] or "x86"
33 | file:close()
34 | end
35 | end
36 |
37 | package.cpath = (
38 | os.iswindows and 'bin/?.dll;bin/clibs/?.dll;' or
39 | os.islinux and ('bin/linux/%s/lib?.so;bin/linux/%s/clibs/?.so;'):format(os.arch,os.arch) or
40 | --[[isosx]] 'bin/lib?.dylib;bin/clibs/?.dylib;')
41 | .. package.cpath
42 |
43 | package.path = 'lualibs/?.lua;lualibs/?/?.lua;lualibs/?/init.lua;lualibs/?/?/?.lua;lualibs/?/?/init.lua;'
44 | .. package.path
45 |
46 |
47 | --路径分隔符
48 | if os.islinux then
49 | sep = "/"
50 | else
51 | sep="\\"
52 | end
53 |
54 | local upper = ".."
55 |
56 | ------------------------------------------
57 | --main
58 | -------------------------------------
59 | --载入lfs库
60 | require"lfs"
61 | print (lfs._VERSION)
62 |
63 |
64 | function attrdir (path)
65 | --目录迭代器
66 | for file in lfs.dir(path) do
67 | if file ~= "." and file ~= ".." then
68 | local f = path..sep..file
69 |
70 | local attr = lfs.attributes (f)
71 | assert (type(attr) == "table")
72 | if attr.mode == "directory" then
73 | attrdir (f)
74 | elseif attr.mode == "file" then
75 | --如果是文件的话
76 | run(f,path)
77 | end
78 | end
79 | end
80 | end
81 |
82 | function run(f,path)
83 | --处理函数
84 | ext=f:sub(-3,-1)
85 | --print(f,ext)
86 | if ext=="tex" then
87 | ----------------------------------------------+
88 | --********************************************|
89 | os.execute("ktech "..f.." "..path)--**********|
90 | --********************************************|
91 | ----------------------------------------------+
92 | end
93 | end
94 |
95 |
96 | attrdir(ds_dir,run)
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/tool/批量tex转换/xml2png.lua:
--------------------------------------------------------------------------------
1 | --coding: UTF-8-------
2 | --********************************+
3 | --利用每个tex配套的xml文件********+
4 | --把一个大的png解析为小的png******+
5 | --并用wx库切割********************+
6 | --********************************+
7 | ----------------------------------------
8 | --配置---------------------------
9 | ---------------------------------
10 |
11 | --饥荒目录
12 | local ds_dir="H:\\ds1"
13 |
14 | --------------------------------
15 | --获取系统版本信息
16 | --------------------------------------------------
17 | -- put bin/ first to avoid conflicts with included modules
18 | -- that may have other versions present somewhere else in path/cpath.
19 | os.iswindows = os.getenv('WINDIR')
20 | or (os.getenv('OS') or ''):match('[Ww]indows')
21 | os.islinux = not os.iswindows
22 | and not os.getenv('DYLD_LIBRARY_PATH')
23 | and io.open("/proc")
24 | os.arch = "x86" -- use 32bit by default
25 | unpack = table.unpack or unpack
26 | --获取位数
27 | if os.islinux then
28 | local file = io.popen("uname -m")
29 | if file then
30 | local machine=file:read("*l")
31 | local archtype= { x86_64="x64", armv7l="armhf" }
32 | print(machine)
33 | os.arch = archtype[machine] or "x86"
34 | file:close()
35 | end
36 | end
37 |
38 | package.cpath = (
39 | os.iswindows and 'bin/?.dll;bin/clibs/?.dll;' or
40 | os.islinux and ('bin/linux/%s/lib?.so;bin/linux/%s/clibs/?.so;'):format(os.arch,os.arch) or
41 | --[[isosx]] 'bin/lib?.dylib;bin/clibs/?.dylib;')
42 | .. package.cpath
43 |
44 | package.path = 'lualibs/?.lua;lualibs/?/?.lua;lualibs/?/init.lua;lualibs/?/?/?.lua;lualibs/?/?/init.lua;'
45 | .. package.path
46 |
47 |
48 | --路径分隔符
49 | if os.islinux then
50 | sep = "/"
51 | else
52 | sep="\\"
53 | end
54 | local upper = ".."
55 |
56 | -----------------------------------
57 | --载入所需要的库
58 | ---------------------------------
59 | require "luaxml"
60 | require"wx"
61 | print=print_lua
62 | require"lfs"
63 | print (lfs._VERSION)
64 | ------------------------------------
65 | function xml2png(xmlpath,path)
66 | --接受xml路径与解析文件路径
67 |
68 | xmlfile=xml.load(xmlpath)
69 | texture=xmlfile:find("Texture")
70 |
71 | if texture then
72 |
73 | filen=tostring(texture.filename)
74 | filen=path..filen:sub(1,-4).."png"
75 |
76 | print("start filename:"..filen)
77 |
78 | im,err=wx.wxImage (filen,wx.wxBITMAP_TYPE_ANY)
79 | if im then
80 |
81 | x, y = im:GetWidth(),im:GetHeight()
82 | print(x,y)
83 |
84 | emt=xmlfile:find("Elements")
85 | for i=1,#emt do
86 | local name =emt[i].name
87 | local u1 =math.floor(tonumber(emt[i].u1)*x)
88 | local u2 =math.floor(tonumber(emt[i].u2)*x+0.5)
89 | local v1 =math.floor(x-tonumber(emt[i].v1)*x+0.5)
90 | local v2 =math.floor(x-tonumber(emt[i].v2)*x)
91 | print(name,u1,u2,v1,v2)
92 | local zsjx=u1
93 | local zsjy=v2
94 | local yxjx=u2
95 | local yxjy=v1
96 | local h=yxjy-zsjy
97 | local w=yxjx-zsjx
98 | local outim = im:GetSubImage (wx.wxRect(zsjx, zsjy,w,h))
99 | --outim:createPaletteFromTrueColor(false, 1)
100 | --outim:copyResampled(im,0,0,zsjx, zsjy,h,w,h,w)
101 | print(name,zsjx, zsjy,h,w,h,w)
102 | outim:SaveFile(path..name..".png")
103 | end
104 | else
105 | print("Error:"..filen)
106 | end
107 | end
108 | end
109 |
110 |
111 |
112 |
113 | function attrdir (path)
114 | for file in lfs.dir(path) do
115 | if file ~= "." and file ~= ".." then
116 | local f = path..sep..file
117 |
118 | local attr = lfs.attributes (f)
119 | assert (type(attr) == "table")
120 | if attr.mode == "directory" then
121 | attrdir (f)
122 | elseif attr.mode == "file" then
123 | ext=f:sub(-3,-1)
124 | --print(f,ext)
125 | if ext=="xml" then
126 | xml2png(f,path..sep)
127 | end
128 | end
129 | end
130 | end
131 | end
132 |
133 | attrdir(ds_dir)
134 |
--------------------------------------------------------------------------------
/tool/批量动画--linux/README.md:
--------------------------------------------------------------------------------
1 | 饥荒动画批量转换工具
2 | ===========================
3 | 本工具用来批量转换饥荒动画文件为scml格式,用spriter就能打开编辑。
4 |
5 |
6 | 依赖相关
7 | ============================
8 | 依赖外部`ktools`工具,需要`lfs` 库。
9 |
10 | 在bin/spriter/目录里有免费版的`Spriter`(win32 与 linux32版)
11 | 软件,用来编辑scml文件。
12 |
13 | 注:linux下spriter需要安装依赖库
14 |
15 |
16 | 64位
17 | ```sh
18 | sudo apt-get install libqt4-webkit libqt4-help phonon
19 | ```
20 |
21 | 32位
22 | ```sh
23 | sudo apt-get install libqt4-webkit libqt4-help phonon
24 | ```
25 |
26 |
27 |
28 | 说明:
29 | ================================
30 |
31 | ## getrequire.lua ##
32 | `getrequire.lua`文件用来分析动画依赖的,比如有的动画zip压缩包里
33 | 只有`anim.bin`文件,而有的zip里只有`build.bin`文件。
34 | 两者都不能独立转换成scml动画,必须分析它的依赖条件。
35 |
36 | 例如:
37 |
38 | 文件名 |拥有文件
39 | ------------------------|---------
40 | player_actions_eat.zip |anim.bin
41 | wx78.zip |build.bin
42 | mole_basic.zip |anim.zip
43 | mole_build.zip |build.zip
44 |
45 | 现在wx78只有build,缺少一个anim,可是现在player_actions_eat和mole_basic都有anim,到底是用前者的还是后者的?
46 |
47 | 这个脚本就是用来分析这些关系的。
48 |
49 | 生成两个文件`re.lua`与`zip.lua`
50 |
51 |
52 | ## unallzip.lua ##
53 |
54 | 利用系统的`7z`命令,解压所有zip到对应的目录,如果没有7z,请自行更换命令。
55 |
56 | ## copyall.lua ##
57 |
58 | 通过`getrequire`生成的文件,根据依赖关系,将对应的build与anim放入`build+animname`的文件夹里。
59 |
60 | ## main.lua ##
61 |
62 | 利用`ktools`将所有的动画转换到当前的`anim`目录里,这个脚本比较费时,我用了5分钟才执行完成。所有的饥荒动画转换后大约2G,请预留空间,我没有做错误处理的哦。
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/tool/批量动画--linux/copyall.lua:
--------------------------------------------------------------------------------
1 | -------------------------------------------------------
2 | require "tablesave"
3 | -------------------------------------------------------
4 | ziptable=table.load("zip.lua")
5 | retable=table.load("re.lua")
6 |
7 | -------------------------------------------------------------------
8 | animpath="E:\\ds\\data\\anim"
9 |
10 | local tmp = "/tmp"
11 | local sep = "\\"
12 | local upper = ".."
13 |
14 | require"lfs"
15 | print (lfs._VERSION)
16 |
17 | function attrdir (path)
18 | for file in lfs.dir(path) do
19 | if file ~= "." and file ~= ".." then
20 | local f = path..sep..file
21 |
22 | local attr = lfs.attributes (f)
23 | assert (type(attr) == "table")
24 | if attr.mode == "directory" then
25 |
26 | if hasanimnotbuild(f) then
27 | --print(file)
28 | getanim(file,f,path)
29 | end
30 |
31 |
32 | end
33 | end
34 | end
35 | end
36 |
37 | function hasanimnotbuild(path)
38 |
39 | animf=io.open(path..sep.."anim.bin")
40 | buildf=io.open(path..sep.."build.bin")
41 |
42 | if animf and not buildf then
43 | return true
44 | end
45 |
46 | if animf then
47 | animf:close()
48 | end
49 | if buildf then
50 | buildf:close()
51 | end
52 |
53 | end
54 |
55 | function hasbuildnotanim(path)
56 |
57 | animf=io.open(path..sep.."anim.bin")
58 | buildf=io.open(path..sep.."build.bin")
59 |
60 | if buildf and not animf then
61 | return true
62 | end
63 |
64 | if animf then
65 | animf:close()
66 | end
67 | if buildf then
68 | buildf:close()
69 | end
70 |
71 | end
72 |
73 |
74 |
75 |
76 | function getanim(file,f,path)
77 | local zipfilename2="anim/"..file..".zip"
78 |
79 | for k,v in pairs(ziptable) do
80 | for kk,vv in pairs(v) do
81 | --print(k,v,kk,vv)
82 | if vv==zipfilename2 then
83 |
84 | local animname=file
85 |
86 | for kkk,vvv in pairs(ziptable[k]) do
87 |
88 | if hasbuildnotanim(path..sep..vvv:sub(6,-5)) then
89 |
90 | buildname=vvv:sub(6,-5)
91 |
92 | print(animname.."_"..buildname)
93 |
94 | lfs.mkdir(path..sep..animname.."_"..buildname..sep)
95 | print("cp ".."\""..path..sep..animname..sep.."*.*\" \""..path..sep..animname.."_"..buildname..sep.."\"")
96 | os.execute("copy ".."\""..path..sep..buildname..sep.."*.*\" \""..path..sep..animname.."_"..buildname..sep.."\"")
97 | os.execute("copy ".."\""..path..sep..animname..sep.."*.*\" \""..path..sep..animname.."_"..buildname..sep.."\"")
98 |
99 |
100 | end
101 |
102 | end
103 |
104 | end
105 | end
106 | end
107 |
108 |
109 |
110 | end
111 |
112 |
113 | attrdir (animpath)
114 |
--------------------------------------------------------------------------------
/tool/批量动画--linux/getrequire.lua:
--------------------------------------------------------------------------------
1 | local tmp = "/tmp"
2 | local sep = "/"
3 | local upper = ".."
4 |
5 | require"lfs"
6 | print (lfs._VERSION)
7 |
8 | function attrdir (path)
9 | for file in lfs.dir(path) do
10 | if file ~= "." and file ~= ".." then
11 | local f = path..sep..file
12 |
13 | local attr = lfs.attributes (f)
14 | assert (type(attr) == "table")
15 | if attr.mode == "directory" then
16 | attrdir (f)
17 | elseif attr.mode == "file" then
18 | ext=f:sub(-3,-1)
19 | --print(f,ext)
20 | if ext=="lua" then
21 | filestr=io.open(f,"rb"):read("*a")
22 |
23 | print(f)
24 |
25 | if haszip(filestr) then
26 | requiretable(filestr,file)
27 |
28 | end
29 | print("lll")
30 |
31 | end
32 | end
33 | end
34 | end
35 | end
36 |
37 | function haszip(str)
38 |
39 | if str:find("zip") then
40 | return true
41 | end
42 | end
43 |
44 | function getzip(str)
45 | local t={}
46 | str:gsub("Asset%(\"ANIM\", \"(.-)\"",function (n)
47 | table.insert(t,n)
48 | end)
49 | for k,v in pairs(t) do
50 | print(k,v)
51 | end
52 | return t
53 | end
54 |
55 | function getrequire(str)
56 | local t={}
57 | str:gsub("require%s+\"(.-)\"",function (n)
58 | table.insert(t,n)
59 | end)
60 | return t
61 | end
62 |
63 | require "tablesave"
64 | retable={}
65 | ziptable={}
66 |
67 | function requiretable(str,filename)
68 | local ttt=getzip(str)
69 | print(#ttt)
70 | ziptable[filename:sub(1,-5)]=ttt
71 | local tttt=getrequire(str)
72 | print(#tttt)
73 | print(filename:sub(1,-5))
74 | retable[filename:sub(1,-5)]=tttt
75 | end
76 |
77 | attrdir ("E:\\ds\\")
78 | table.save( retable ,"re.lua" )
79 | table.save( ziptable ,"zip.lua" )
80 |
81 |
82 |
--------------------------------------------------------------------------------
/tool/批量动画--linux/main.lua:
--------------------------------------------------------------------------------
1 | local tmp = "/tmp"
2 | local sep = "\\"
3 | local upper = ".."
4 |
5 | require"lfs"
6 | print (lfs._VERSION)
7 |
8 | animpath="E:\\ds\\data\\anim"
9 |
10 | lfs.mkdir("anim")
11 | function attrdir (path)
12 | for file in lfs.dir(path) do
13 | if file ~= "." and file ~= ".." then
14 | local f = path..sep..file
15 |
16 | local attr = lfs.attributes (f)
17 | assert (type(attr) == "table")
18 | if attr.mode == "directory" then
19 |
20 | hastwo(f,file)
21 | end
22 | end
23 | end
24 | end
25 |
26 |
27 | function hastwo(path,name)
28 |
29 | local animfile=io.open(path..sep.."anim.bin")
30 | local buildfile=io.open(path..sep.."build.bin")
31 |
32 | if animfile and buildfile then
33 |
34 | print(path,name)
35 | lfs.mkdir("anim"..sep..name)
36 |
37 | os.execute("krane ".."\""..path..sep.."anim.bin".."\" \""..path..sep.."build.bin".."\" ".."anim"..sep..name.."\\")
38 |
39 | end
40 |
41 | end
42 | attrdir (animpath)
43 |
--------------------------------------------------------------------------------
/tool/批量动画--linux/tablesave.lua:
--------------------------------------------------------------------------------
1 | -- coding: UTF-8-----------------
2 | --将table 保存进文件,与读取保存文件
3 | ---------------------------------
4 | --[[
5 | Save Table to File
6 | Load Table from File
7 | v 1.0
8 |
9 | Lua 5.2 compatible
10 |
11 | Only Saves Tables, Numbers and Strings
12 | Insides Table References are saved
13 | Does not save Userdata, Metatables, Functions and indices of these
14 | ----------------------------------------------------
15 | table.save( table , filename )
16 |
17 | on failure: returns an error msg
18 |
19 | ----------------------------------------------------
20 | table.load( filename or stringtable )
21 |
22 | Loads a table that has been saved via the table.save function
23 |
24 | on success: returns a previously saved table
25 | on failure: returns as second argument an error msg
26 | ----------------------------------------------------
27 |
28 | Licensed under the same terms as Lua itself.
29 | ]]--
30 | do
31 | -- declare local variables
32 | --// exportstring( string )
33 | --// returns a "Lua" portable version of the string
34 | local function exportstring( s )
35 | return string.format("%q", s)
36 | end
37 |
38 | --// The Save Function
39 | function table.save( tbl,filename )
40 | local charS,charE = " ","\n"
41 | local file,err = io.open( filename, "wb" )
42 | if err then return err end
43 |
44 | -- initiate variables for save procedure
45 | local tables,lookup = { tbl },{ [tbl] = 1 }
46 | file:write( "return {"..charE )
47 |
48 | for idx,t in ipairs( tables ) do
49 | file:write( "-- Table: {"..idx.."}"..charE )
50 | file:write( "{"..charE )
51 | local thandled = {}
52 |
53 | for i,v in ipairs( t ) do
54 | thandled[i] = true
55 | local stype = type( v )
56 | -- only handle value
57 | if stype == "table" then
58 | if not lookup[v] then
59 | table.insert( tables, v )
60 | lookup[v] = #tables
61 | end
62 | file:write( charS.."{"..lookup[v].."},"..charE )
63 | elseif stype == "string" then
64 | file:write( charS..exportstring( v )..","..charE )
65 | elseif stype == "number" then
66 | file:write( charS..tostring( v )..","..charE )
67 | end
68 | end
69 |
70 | for i,v in pairs( t ) do
71 | -- escape handled values
72 | if (not thandled[i]) then
73 |
74 | local str = ""
75 | local stype = type( i )
76 | -- handle index
77 | if stype == "table" then
78 | if not lookup[i] then
79 | table.insert( tables,i )
80 | lookup[i] = #tables
81 | end
82 | str = charS.."[{"..lookup[i].."}]="
83 | elseif stype == "string" then
84 | str = charS.."["..exportstring( i ).."]="
85 | elseif stype == "number" then
86 | str = charS.."["..tostring( i ).."]="
87 | end
88 |
89 | if str ~= "" then
90 | stype = type( v )
91 | -- handle value
92 | if stype == "table" then
93 | if not lookup[v] then
94 | table.insert( tables,v )
95 | lookup[v] = #tables
96 | end
97 | file:write( str.."{"..lookup[v].."},"..charE )
98 | elseif stype == "string" then
99 | file:write( str..exportstring( v )..","..charE )
100 | elseif stype == "number" then
101 | file:write( str..tostring( v )..","..charE )
102 | end
103 | end
104 | end
105 | end
106 | file:write( "},"..charE )
107 | end
108 | file:write( "}" )
109 | file:close()
110 | end
111 |
112 | --// The Load Function
113 | function table.load( sfile )
114 | local ftables,err = loadfile( sfile )
115 | if err then return _,err end
116 | local tables = ftables()
117 | for idx = 1,#tables do
118 | local tolinki = {}
119 | for i,v in pairs( tables[idx] ) do
120 | if type( v ) == "table" then
121 | tables[idx][i] = tables[v[1]]
122 | end
123 | if type( i ) == "table" and tables[i[1]] then
124 | table.insert( tolinki,{ i,tables[i[1]] } )
125 | end
126 | end
127 | -- link indices
128 | for _,v in ipairs( tolinki ) do
129 | tables[idx][v[2]],tables[idx][v[1]] = tables[idx][v[1]],nil
130 | end
131 | end
132 | return tables[1]
133 | end
134 | -- close do
135 | end
136 |
137 | -- ChillCode
--------------------------------------------------------------------------------
/tool/批量动画--linux/unallzip.lua:
--------------------------------------------------------------------------------
1 | local tmp = "/tmp"
2 | local sep = "/"
3 | local upper = ".."
4 |
5 | require"lfs"
6 | print (lfs._VERSION)
7 |
8 | function attrdir (path)
9 | for file in lfs.dir(path) do
10 | if file ~= "." and file ~= ".." then
11 | local f = path..sep..file
12 |
13 | local attr = lfs.attributes (f)
14 | assert (type(attr) == "table")
15 | if attr.mode == "directory" then
16 | attrdir (f)
17 | elseif attr.mode == "file" then
18 | ext=f:sub(-3,-1)
19 | pp=f:sub(1,-5)
20 | --print(f,ext)
21 | if ext=="zip" then
22 | print(f)
23 | lfs.mkdir(pp..sep)
24 | os.execute("7z x \""..f.."\" -y -aos -o\""..pp..sep.."\"")
25 |
26 | end
27 | end
28 | end
29 | end
30 | end
31 | attrdir ("e:\\ds\\")
32 |
--------------------------------------------------------------------------------
/tool/批量动画/README.md:
--------------------------------------------------------------------------------
1 | 饥荒动画批量转换工具
2 | ===========================
3 | 本工具用来批量转换饥荒动画文件为scml格式,用spriter就能打开编辑。
4 |
5 |
6 | 依赖相关
7 | ============================
8 | 依赖外部`ktools`工具,需要`lfs` 库。
9 |
10 | 在bin/spriter/目录里有免费版的`Spriter`(win32 与 linux32版)
11 | 软件,用来编辑scml文件。
12 |
13 | 注:linux下spriter需要安装依赖库
14 |
15 |
16 | 64位
17 | ```sh
18 | sudo apt-get install libqt4-webkit libqt4-help phonon
19 | ```
20 |
21 | 32位
22 | ```sh
23 | sudo apt-get install libqt4-webkit libqt4-help phonon
24 | ```
25 |
26 |
27 |
28 | 说明:
29 | ================================
30 |
31 | ## getrequire.lua ##
32 | `getrequire.lua`文件用来分析动画依赖的,比如有的动画zip压缩包里
33 | 只有`anim.bin`文件,而有的zip里只有`build.bin`文件。
34 | 两者都不能独立转换成scml动画,必须分析它的依赖条件。
35 |
36 | 例如:
37 |
38 | 文件名 |拥有文件
39 | ------------------------|---------
40 | player_actions_eat.zip |anim.bin
41 | wx78.zip |build.bin
42 | mole_basic.zip |anim.zip
43 | mole_build.zip |build.zip
44 |
45 | 现在wx78只有build,缺少一个anim,可是现在player_actions_eat和mole_basic都有anim,到底是用前者的还是后者的?
46 |
47 | 这个脚本就是用来分析这些关系的。
48 |
49 | 生成两个文件`re.lua`与`zip.lua`
50 |
51 |
52 | ## unallzip.lua ##
53 |
54 | 利用系统的`7z`命令,解压所有zip到对应的目录,如果没有7z,请自行更换命令。
55 |
56 | ## copyall.lua ##
57 |
58 | 通过`getrequire`生成的文件,根据依赖关系,将对应的build与anim放入`build+animname`的文件夹里。
59 |
60 | ## main.lua ##
61 |
62 | 利用`ktools`将所有的动画转换到当前的`anim`目录里,这个脚本比较费时,我用了5分钟才执行完成。所有的饥荒动画转换后大约2G,请预留空间,我没有做错误处理的哦。
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/tool/批量动画/copyall.lua:
--------------------------------------------------------------------------------
1 | --dofile("unallzip")
2 | --dofile("getrequire.lua")
3 |
4 | require"tablesave"
5 |
6 | ziptable=table.load("zip.lua")
7 | retable=table.load("re.lua")
8 | animpath="E:\\ds\\data\\anim"
9 | --animpath="E:\\ds\\data\\DLC0001\\anim"
10 | local tmp = "/tmp"
11 | local sep = "\\"
12 | local upper = ".."
13 |
14 | require"lfs"
15 | print (lfs._VERSION)
16 |
17 | function attrdir (path)
18 | for file in lfs.dir(path) do
19 | if file ~= "." and file ~= ".." then
20 | local f = path..sep..file
21 |
22 | local attr = lfs.attributes (f)
23 | assert (type(attr) == "table")
24 | if attr.mode == "directory" then
25 |
26 | if hasanimnotbuild(f) then
27 | --print(file)
28 | getanim(file,f,path)
29 | end
30 |
31 |
32 | end
33 | end
34 | end
35 | end
36 |
37 | function hasanimnotbuild(path)
38 |
39 | animf=io.open(path..sep.."anim.bin")
40 | buildf=io.open(path..sep.."build.bin")
41 |
42 | if animf and not buildf then
43 | return true
44 | end
45 |
46 | if animf then
47 | animf:close()
48 | end
49 | if buildf then
50 | buildf:close()
51 | end
52 |
53 | end
54 |
55 | function hasbuildnotanim(path)
56 |
57 | animf=io.open(path..sep.."anim.bin")
58 | buildf=io.open(path..sep.."build.bin")
59 |
60 | if buildf and not animf then
61 | return true
62 | end
63 |
64 | if animf then
65 | animf:close()
66 | end
67 | if buildf then
68 | buildf:close()
69 | end
70 |
71 | end
72 |
73 |
74 |
75 |
76 | function getanim(file,f,path)
77 | local zipfilename2="anim/"..file..".zip"
78 |
79 | for k,v in pairs(ziptable) do
80 | for kk,vv in pairs(v) do
81 | --print(k,v,kk,vv)
82 | if vv==zipfilename2 then
83 |
84 | local animname=file
85 |
86 | for kkk,vvv in pairs(ziptable[k]) do
87 |
88 | if hasbuildnotanim(path..sep..vvv:sub(6,-5)) then
89 |
90 | buildname=vvv:sub(6,-5)
91 |
92 | print(animname.."_"..buildname)
93 |
94 | lfs.mkdir(path..sep..animname.."_"..buildname..sep)
95 | print("cp ".."\""..path..sep..animname..sep.."*.*\" \""..path..sep..animname.."_"..buildname..sep.."\"")
96 | os.execute("copy ".."\""..path..sep..buildname..sep.."*.*\" \""..path..sep..animname.."_"..buildname..sep.."\"")
97 | os.execute("copy ".."\""..path..sep..animname..sep.."*.*\" \""..path..sep..animname.."_"..buildname..sep.."\"")
98 |
99 |
100 | end
101 |
102 | end
103 |
104 | end
105 | end
106 | end
107 |
108 |
109 |
110 | end
111 |
112 |
113 | attrdir (animpath)
114 |
--------------------------------------------------------------------------------
/tool/批量动画/getrequire.lua:
--------------------------------------------------------------------------------
1 | local tmp = "/tmp"
2 | local sep = "/"
3 | local upper = ".."
4 |
5 | require"lfs"
6 | print (lfs._VERSION)
7 |
8 | function attrdir (path)
9 | for file in lfs.dir(path) do
10 | if file ~= "." and file ~= ".." then
11 | local f = path..sep..file
12 |
13 | local attr = lfs.attributes (f)
14 | assert (type(attr) == "table")
15 | if attr.mode == "directory" then
16 | attrdir (f)
17 | elseif attr.mode == "file" then
18 | ext=f:sub(-3,-1)
19 | --print(f,ext)
20 | if ext=="lua" then
21 | filestr=io.open(f,"rb"):read("*a")
22 |
23 | print(f)
24 |
25 | if haszip(filestr) then
26 | requiretable(filestr,file)
27 |
28 | end
29 | print("lll")
30 |
31 | end
32 | end
33 | end
34 | end
35 | end
36 |
37 | function haszip(str)
38 |
39 | if str:find("zip") then
40 | return true
41 | end
42 | end
43 |
44 | function getzip(str)
45 | local t={}
46 | str:gsub("Asset%(\"ANIM\", \"(.-)\"",function (n)
47 | table.insert(t,n)
48 | end)
49 | for k,v in pairs(t) do
50 | print(k,v)
51 | end
52 | return t
53 | end
54 |
55 | function getrequire(str)
56 | local t={}
57 | str:gsub("require%s+\"(.-)\"",function (n)
58 | table.insert(t,n)
59 | end)
60 | return t
61 | end
62 |
63 | require "tablesave"
64 | retable={}
65 | ziptable={}
66 |
67 | function requiretable(str,filename)
68 | local ttt=getzip(str)
69 | print(#ttt)
70 | ziptable[filename:sub(1,-5)]=ttt
71 | local tttt=getrequire(str)
72 | print(#tttt)
73 | print(filename:sub(1,-5))
74 | retable[filename:sub(1,-5)]=tttt
75 | end
76 |
77 | attrdir ("E:\\ds\\")
78 | table.save( retable ,"re.lua" )
79 | table.save( ziptable ,"zip.lua" )
80 |
81 |
82 |
--------------------------------------------------------------------------------
/tool/批量动画/main.lua:
--------------------------------------------------------------------------------
1 | local tmp = "/tmp"
2 | local sep = "\\"
3 | local upper = ".."
4 |
5 | require"lfs"
6 | print (lfs._VERSION)
7 |
8 | animpath="E:\\ds\\data\\anim"
9 |
10 | lfs.mkdir("anim")
11 | function attrdir (path)
12 | for file in lfs.dir(path) do
13 | if file ~= "." and file ~= ".." then
14 | local f = path..sep..file
15 |
16 | local attr = lfs.attributes (f)
17 | assert (type(attr) == "table")
18 | if attr.mode == "directory" then
19 |
20 | hastwo(f,file)
21 | end
22 | end
23 | end
24 | end
25 |
26 |
27 | function hastwo(path,name)
28 |
29 | local animfile=io.open(path..sep.."anim.bin")
30 | local buildfile=io.open(path..sep.."build.bin")
31 |
32 | if animfile and buildfile then
33 |
34 | print(path,name)
35 | lfs.mkdir("anim"..sep..name)
36 |
37 | os.execute("krane ".."\""..path..sep.."anim.bin".."\" \""..path..sep.."build.bin".."\" ".."anim"..sep..name.."\\")
38 |
39 | end
40 |
41 | end
42 | attrdir (animpath)
43 |
--------------------------------------------------------------------------------
/tool/批量动画/tablesave.lua:
--------------------------------------------------------------------------------
1 | -- coding: UTF-8-----------------
2 | --将table 保存进文件,与读取保存文件
3 | ---------------------------------
4 | --[[
5 | Save Table to File
6 | Load Table from File
7 | v 1.0
8 |
9 | Lua 5.2 compatible
10 |
11 | Only Saves Tables, Numbers and Strings
12 | Insides Table References are saved
13 | Does not save Userdata, Metatables, Functions and indices of these
14 | ----------------------------------------------------
15 | table.save( table , filename )
16 |
17 | on failure: returns an error msg
18 |
19 | ----------------------------------------------------
20 | table.load( filename or stringtable )
21 |
22 | Loads a table that has been saved via the table.save function
23 |
24 | on success: returns a previously saved table
25 | on failure: returns as second argument an error msg
26 | ----------------------------------------------------
27 |
28 | Licensed under the same terms as Lua itself.
29 | ]]--
30 | do
31 | -- declare local variables
32 | --// exportstring( string )
33 | --// returns a "Lua" portable version of the string
34 | local function exportstring( s )
35 | return string.format("%q", s)
36 | end
37 |
38 | --// The Save Function
39 | function table.save( tbl,filename )
40 | local charS,charE = " ","\n"
41 | local file,err = io.open( filename, "wb" )
42 | if err then return err end
43 |
44 | -- initiate variables for save procedure
45 | local tables,lookup = { tbl },{ [tbl] = 1 }
46 | file:write( "return {"..charE )
47 |
48 | for idx,t in ipairs( tables ) do
49 | file:write( "-- Table: {"..idx.."}"..charE )
50 | file:write( "{"..charE )
51 | local thandled = {}
52 |
53 | for i,v in ipairs( t ) do
54 | thandled[i] = true
55 | local stype = type( v )
56 | -- only handle value
57 | if stype == "table" then
58 | if not lookup[v] then
59 | table.insert( tables, v )
60 | lookup[v] = #tables
61 | end
62 | file:write( charS.."{"..lookup[v].."},"..charE )
63 | elseif stype == "string" then
64 | file:write( charS..exportstring( v )..","..charE )
65 | elseif stype == "number" then
66 | file:write( charS..tostring( v )..","..charE )
67 | end
68 | end
69 |
70 | for i,v in pairs( t ) do
71 | -- escape handled values
72 | if (not thandled[i]) then
73 |
74 | local str = ""
75 | local stype = type( i )
76 | -- handle index
77 | if stype == "table" then
78 | if not lookup[i] then
79 | table.insert( tables,i )
80 | lookup[i] = #tables
81 | end
82 | str = charS.."[{"..lookup[i].."}]="
83 | elseif stype == "string" then
84 | str = charS.."["..exportstring( i ).."]="
85 | elseif stype == "number" then
86 | str = charS.."["..tostring( i ).."]="
87 | end
88 |
89 | if str ~= "" then
90 | stype = type( v )
91 | -- handle value
92 | if stype == "table" then
93 | if not lookup[v] then
94 | table.insert( tables,v )
95 | lookup[v] = #tables
96 | end
97 | file:write( str.."{"..lookup[v].."},"..charE )
98 | elseif stype == "string" then
99 | file:write( str..exportstring( v )..","..charE )
100 | elseif stype == "number" then
101 | file:write( str..tostring( v )..","..charE )
102 | end
103 | end
104 | end
105 | end
106 | file:write( "},"..charE )
107 | end
108 | file:write( "}" )
109 | file:close()
110 | end
111 |
112 | --// The Load Function
113 | function table.load( sfile )
114 | local ftables,err = loadfile( sfile )
115 | if err then return _,err end
116 | local tables = ftables()
117 | for idx = 1,#tables do
118 | local tolinki = {}
119 | for i,v in pairs( tables[idx] ) do
120 | if type( v ) == "table" then
121 | tables[idx][i] = tables[v[1]]
122 | end
123 | if type( i ) == "table" and tables[i[1]] then
124 | table.insert( tolinki,{ i,tables[i[1]] } )
125 | end
126 | end
127 | -- link indices
128 | for _,v in ipairs( tolinki ) do
129 | tables[idx][v[2]],tables[idx][v[1]] = tables[idx][v[1]],nil
130 | end
131 | end
132 | return tables[1]
133 | end
134 | -- close do
135 | end
136 |
137 | -- ChillCode
--------------------------------------------------------------------------------
/tool/批量动画/unallzip.lua:
--------------------------------------------------------------------------------
1 | local tmp = "/tmp"
2 | local sep = "/"
3 | local upper = ".."
4 |
5 | require"lfs"
6 | print (lfs._VERSION)
7 |
8 | function attrdir (path)
9 | for file in lfs.dir(path) do
10 | if file ~= "." and file ~= ".." then
11 | local f = path..sep..file
12 |
13 | local attr = lfs.attributes (f)
14 | assert (type(attr) == "table")
15 | if attr.mode == "directory" then
16 | attrdir (f)
17 | elseif attr.mode == "file" then
18 | ext=f:sub(-3,-1)
19 | pp=f:sub(1,-5)
20 | --print(f,ext)
21 | if ext=="zip" then
22 | print(f)
23 | lfs.mkdir(pp..sep)
24 | os.execute("7z x \""..f.."\" -y -aos -o\""..pp..sep.."\"")
25 |
26 | end
27 | end
28 | end
29 | end
30 | end
31 | attrdir ("e:\\ds\\")
32 |
--------------------------------------------------------------------------------
/tool/饥荒字体/fnt2xml.lua:
--------------------------------------------------------------------------------
1 |
2 | function xyhw2uv12(x,y,h,w)
3 | local u1,u2,v1,v2
4 | u1=x
5 | v2=y
6 | v1=v2+h
7 | u2=u1+w
8 | return u1,u2,v1,v2
9 | end
10 |
11 |
12 | function id2ment(id,u1,u2,v1,v2)
13 | return "\n"
14 |
15 | end
16 |
17 | require "luaxml"
18 |
19 | xmlfile=xml.load("sc.fnt")
20 | font=xmlfile:find("font")
21 | chars=font:find("chars")
22 | print(chars.count)
23 | emt=chars:find("char")
24 | scaleW=4096 scaleH=2096
25 |
26 | outfile=io.open("fontcn.xml","wb")
27 | outfile:write([[
28 |
29 |
30 |
31 | ]])
32 |
33 |
34 | for i=1,#chars do
35 |
36 | local ID=chars[i].id
37 | local X=chars[i].x/scaleW
38 | local Y=chars[i].y/scaleH
39 | local H=chars[i].height/scaleH
40 | local W=chars[i].width/scaleW
41 |
42 | outfile:write(id2ment(ID,xyhw2uv12(X,Y,H,W)))
43 |
44 | end
45 |
46 | outfile:write([[
47 |
48 | ]])
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/tool/饥荒字体/sc.fnt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/tool/饥荒字体/sc.fnt
--------------------------------------------------------------------------------
/tool/饥荒字体/sc_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/tool/饥荒字体/sc_0.png
--------------------------------------------------------------------------------
/win32run.bat:
--------------------------------------------------------------------------------
1 | bin\lua.exe src\main.lua
2 |
3 | pause
--------------------------------------------------------------------------------
/wxlua相关/代码区/1.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/代码区/1.lua
--------------------------------------------------------------------------------
/wxlua相关/代码区/aui教程 2.wlua:
--------------------------------------------------------------------------------
1 | --wxaui two
2 | --new two text into aui
3 | --by:czfshine
4 | --time:2014-12-8 19:14
5 |
6 | package.cpath = package.cpath..";./?.dll;./?.wxlua;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
7 | require("wx")
8 |
9 | frame=wx.wxFrame(wx.NULL,
10 | wx.wxID_ANY,
11 | "wxAUI Sample Application",
12 | wx.wxDefaultPosition,
13 | wx.wxSize(800, 600));
14 | frame:SetMinSize(wx.wxSize(400,300));
15 |
16 |
17 | m_mgr = wxaui.wxAuiManager()
18 | m_mgr:SetManagedWindow(frame);
19 |
20 | text1=wx.wxTextCtrl(frame, -1,"text1")
21 | --text2=wx.wxTextCtrl(frame, -1,"text2")
22 |
23 |
24 | require("editor")
25 | api1=wxaui.wxAuiPaneInfo()
26 | api1:Name("test7")
27 | api1:Caption("Client Size Reporter")
28 | api1:Right()
29 |
30 | api1:FloatingSize(100,100)
31 | api1:Layer(1)
32 | api1:CloseButton(false) --is require
33 | api1:MaximizeButton(true)
34 | --[[<=>
35 | api1= wxaui.wxAuiPaneInfo():
36 | Name("test7"):Caption("Client Size Reporter"):
37 | Left():Layer(1):
38 | CloseButton(false):MaximizeButton(true)]]
39 |
40 |
41 | m_mgr:AddPane(text1,api1)
42 | m_mgr:AddPane(newf(frame), wxaui.wxAuiPaneInfo():
43 | Name("test7"):Caption("Client Size Reporter"):
44 | Left():Layer(2):
45 | CloseButton(true):MaximizeButton(true));
46 |
47 |
48 | m_mgr:Update() --is require
49 |
50 | frame:Show()
51 | wx.wxGetApp():MainLoop()
52 |
--------------------------------------------------------------------------------
/wxlua相关/代码区/aui教程 3.wlua:
--------------------------------------------------------------------------------
1 | --wxaui one
2 | --new two text into aui
3 | --by:czfshine
4 | --time:2014-12-8 19:14
5 |
6 | package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
7 | require("wx")
8 | local sample_xpm = {
9 | "32 32 6 1",
10 | " c black",
11 | ". c navy",
12 | "X c red",
13 | "o c yellow",
14 | "O c gray100",
15 | "+ c None",
16 | "++++++++++++++++++++++++++++++++",
17 | "++++++++++++++++++++++++++++++++",
18 | "++++++++++++++++++++++++++++++++",
19 | "++++++++++++++++++++++++++++++++",
20 | "++++++++++++++++++++++++++++++++",
21 | "++++++++ ++++++++++",
22 | "++++++++ ............ ++++++++++",
23 | "++++++++ ............ ++++++++++",
24 | "++++++++ .OO......... ++++++++++",
25 | "++++++++ .OO......... ++++++++++",
26 | "++++++++ .OO......... ++++++++++",
27 | "++++++++ .OO...... ",
28 | "++++++++ .OO...... oooooooooooo ",
29 | " .OO...... oooooooooooo ",
30 | " XXXXXXX .OO...... oOOooooooooo ",
31 | " XXXXXXX .OO...... oOOooooooooo ",
32 | " XOOXXXX ......... oOOooooooooo ",
33 | " XOOXXXX ......... oOOooooooooo ",
34 | " XOOXXXX oOOooooooooo ",
35 | " XOOXXXXXXXXX ++++ oOOooooooooo ",
36 | " XOOXXXXXXXXX ++++ oOOooooooooo ",
37 | " XOOXXXXXXXXX ++++ oOOooooooooo ",
38 | " XOOXXXXXXXXX ++++ oooooooooooo ",
39 | " XOOXXXXXXXXX ++++ oooooooooooo ",
40 | " XXXXXXXXXXXX ++++ ",
41 | " XXXXXXXXXXXX ++++++++++++++++++",
42 | " ++++++++++++++++++",
43 | "++++++++++++++++++++++++++++++++",
44 | "++++++++++++++++++++++++++++++++",
45 | "++++++++++++++++++++++++++++++++",
46 | "++++++++++++++++++++++++++++++++",
47 | "++++++++++++++++++++++++++++++++"
48 | };
49 |
50 | data={
51 | root={
52 | type="treeitem",
53 | name="name",
54 | colour={R=255,G=255,B=125},
55 | colourbg={R=255,G=255,B=125},
56 | imagename="lua",
57 | data="string",
58 |
59 | child={
60 | {type="treeitem",
61 | name="name1",
62 | colour={R=255,G=255,B=125},
63 | colourbg={R=255,G=255,B=125},
64 | imagename="lua",
65 | data="string",
66 |
67 | child={
68 | type="treeitem",
69 | name="name",
70 | colour={R=255,G=255,B=125},
71 | colourbg={R=255,G=255,B=125},
72 | imagename="lua",
73 | data="string"
74 | },
75 | },
76 |
77 | {
78 | type="treeitem",
79 | name="name2",
80 | colour={R=255,G=255,B=125},
81 | colourbg={R=255,G=255,B=125},
82 | imagename="lua",
83 | data="string",
84 | },
85 |
86 | },
87 | image={x=32,y=32},
88 | imagelist={
89 | ["lua"]=wx.wxBitmap(sample_xpm),
90 | ["wlua"]=wx.wxBitmap(sample_xpm),
91 | }
92 | }
93 | }
94 |
95 |
96 | frame=wx.wxFrame(wx.NULL,
97 | wx.wxID_ANY,
98 | "wxAUI Sample Application",
99 | wx.wxDefaultPosition,
100 | wx.wxSize(800, 600));
101 | frame:SetMinSize(wx.wxSize(400,300));
102 | bitmap = wx.wxBitmap(sample_xpm)
103 | ps=wx.wxSplashScreen(bitmap,
104 | wx.wxSPLASH_CENTRE_ON_SCREEN+wx.wxSPLASH_TIMEOUT,
105 | 6000, wx.NULL, -1, wx.wxDefaultPosition, wx.wxDefaultSize,
106 | wx.wxSIMPLE_BORDER+wx.wxSTAY_ON_TOP)
107 |
108 | m_mgr = wxaui.wxAuiManager()
109 | m_mgr:SetManagedWindow(frame);
110 |
111 | text1=wx.wxTextCtrl(frame, -1,"text1")
112 | --text2=wx.wxTextCtrl(frame, -1,"text2")
113 |
114 | require "wxtree"
115 | --tree=NewTree(frame,data)
116 |
117 | api1=wxaui.wxAuiPaneInfo()
118 | api1:Name("test7")
119 | api1:Caption("Client Size Reporter")
120 | api1:Left()
121 | api1:Layer(1)
122 | api1:CloseButton(true)
123 | api1:MaximizeButton(true)
124 | --[[<=>
125 | api1= wxaui.wxAuiPaneInfo():
126 | Name("test7"):Caption("Client Size Reporter"):
127 | Left():Layer(1):
128 | CloseButton(true):MaximizeButton(true)]]
129 |
130 |
131 | m_mgr:AddPane(text1,api1)
132 | tree=wxaui.wxAuiNotebook(frame,wx.wxID_ANY)
133 |
134 | m_mgr:AddPane(tree, wxaui.wxAuiPaneInfo():
135 | Name("test7"):Caption("Client Size Reporter"):
136 | Left():Layer(2):
137 | CloseButton(true):MaximizeButton(true));
138 |
139 |
140 | m_mgr:Update() --is require
141 |
142 | frame:Show()
143 | wx.wxGetApp():MainLoop()
144 |
--------------------------------------------------------------------------------
/wxlua相关/代码区/aui教程.wlua:
--------------------------------------------------------------------------------
1 | --wxaui one
2 | --new two text into aui
3 | --by:czfshine
4 | --time:2014-12-8 19:14
5 |
6 | package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
7 | require("wx")
8 |
9 | frame=wx.wxFrame(wx.NULL,
10 | wx.wxID_ANY,
11 | "wxAUI Sample Application",
12 | wx.wxDefaultPosition,
13 | wx.wxSize(800, 600));
14 | frame:SetMinSize(wx.wxSize(400,300));
15 |
16 |
17 | m_mgr = wxaui.wxAuiManager()
18 | m_mgr:SetManagedWindow(frame);
19 |
20 | text1=wx.wxTextCtrl(frame, -1,"text1")
21 | text2=wx.wxTextCtrl(frame, -1,"text2")
22 |
23 | api1=wxaui.wxAuiPaneInfo()
24 | api1:Name("test7")
25 | api1:Caption("Client Size Reporter")
26 | api1:Left()
27 | api1:Layer(1)
28 | api1:CloseButton(true)
29 | api1:MaximizeButton(true)
30 | --[[<=>
31 | api1= wxaui.wxAuiPaneInfo():
32 | Name("test7"):Caption("Client Size Reporter"):
33 | Left():Layer(1):
34 | CloseButton(true):MaximizeButton(true)]]
35 |
36 |
37 | m_mgr:AddPane(text1,api1)
38 | m_mgr:AddPane(text2, wxaui.wxAuiPaneInfo():
39 | Name("test7"):Caption("Client Size Reporter"):
40 | Left():Layer(2):
41 | CloseButton(true):MaximizeButton(true));
42 |
43 |
44 | m_mgr:Update() --is require
45 |
46 | frame:Show()
47 | wx.wxGetApp():MainLoop()
48 |
--------------------------------------------------------------------------------
/wxlua相关/代码区/wxtree.lua:
--------------------------------------------------------------------------------
1 | local sample_xpm = {
2 | "32 32 6 1",
3 | " c black",
4 | ". c navy",
5 | "X c red",
6 | "o c yellow",
7 | "O c gray100",
8 | "+ c None",
9 | "++++++++++++++++++++++++++++++++",
10 | "++++++++++++++++++++++++++++++++",
11 | "++++++++++++++++++++++++++++++++",
12 | "++++++++++++++++++++++++++++++++",
13 | "++++++++++++++++++++++++++++++++",
14 | "++++++++ ++++++++++",
15 | "++++++++ ............ ++++++++++",
16 | "++++++++ ............ ++++++++++",
17 | "++++++++ .OO......... ++++++++++",
18 | "++++++++ .OO......... ++++++++++",
19 | "++++++++ .OO......... ++++++++++",
20 | "++++++++ .OO...... ",
21 | "++++++++ .OO...... oooooooooooo ",
22 | " .OO...... oooooooooooo ",
23 | " XXXXXXX .OO...... oOOooooooooo ",
24 | " XXXXXXX .OO...... oOOooooooooo ",
25 | " XOOXXXX ......... oOOooooooooo ",
26 | " XOOXXXX ......... oOOooooooooo ",
27 | " XOOXXXX oOOooooooooo ",
28 | " XOOXXXXXXXXX ++++ oOOooooooooo ",
29 | " XOOXXXXXXXXX ++++ oOOooooooooo ",
30 | " XOOXXXXXXXXX ++++ oOOooooooooo ",
31 | " XOOXXXXXXXXX ++++ oooooooooooo ",
32 | " XOOXXXXXXXXX ++++ oooooooooooo ",
33 | " XXXXXXXXXXXX ++++ ",
34 | " XXXXXXXXXXXX ++++++++++++++++++",
35 | " ++++++++++++++++++",
36 | "++++++++++++++++++++++++++++++++",
37 | "++++++++++++++++++++++++++++++++",
38 | "++++++++++++++++++++++++++++++++",
39 | "++++++++++++++++++++++++++++++++",
40 | "++++++++++++++++++++++++++++++++"
41 | };
42 |
43 |
44 | data={
45 | root={
46 | type="treeitem",
47 | name="name",
48 | colour={R=255,G=255,B=125},
49 | colourbg={R=255,G=255,B=125},
50 | imagename="lua",
51 | data="string",
52 |
53 | child={
54 | {type="treeitem",
55 | name="name1",
56 | colour={R=255,G=255,B=125},
57 | colourbg={R=255,G=255,B=125},
58 | imagename="lua",
59 | data="string",
60 |
61 | child={
62 | type="treeitem",
63 | name="name",
64 | colour={R=255,G=255,B=125},
65 | colourbg={R=255,G=255,B=125},
66 | imagename="lua",
67 | data="string"
68 | },
69 | },
70 |
71 | {
72 | type="treeitem",
73 | name="name2",
74 | colour={R=255,G=255,B=125},
75 | colourbg={R=255,G=255,B=125},
76 | imagename="lua",
77 | data="string",
78 | },
79 |
80 | },
81 |
82 | },
83 |
84 | image={x=32,y=32},
85 | imagelist={
86 | ["lua"]=wx.wxBitmap(sample_xpm),
87 | ["wlua"]=wx.wxBitmap(sample_xpm),
88 | },
89 | }
90 |
91 |
92 | function pairsdataroot(tree,parent_id,t,data)
93 |
94 | local child_id2=tree:PrependItem ( parent_id,t.name..data.imagenamelist[t.imagename])
95 |
96 | for k,v in pairs(t.child) do
97 | if type(v)=="table" then
98 | pairsdataroot(tree,parent_id,v,data)
99 | end
100 | end
101 | end
102 |
103 |
104 |
105 | function data2tree(tree,data)
106 | if not data then
107 | return nil,1,"tree data is nil"
108 | end
109 |
110 | local imagelist=wx.wxImageList(data.image.x,data.image.y)
111 |
112 | data.imagenamelist={}
113 | local imgindex=0
114 | for k,v in pairs(data.imagelist) do
115 | imagelist:Add(v)
116 | data.imagenamelist[k]=imgindex
117 | imgindex=imgindex+1
118 | end
119 | tree:AssignImageList(imagelist)
120 |
121 | local root_id = tree:AddRoot( "Root" )
122 |
123 | pairsdataroot(tree,root_id,data.root,data)
124 |
125 |
126 | end
127 |
128 |
129 |
130 | --------------------------------
131 |
132 | function NewTree(frame,data)
133 |
134 | local tree = wx.wxTreeCtrl( frame, wx.wxID_ANY,
135 | wx.wxDefaultPosition, wx.wxSize(-1, 200),
136 | wx.wxTR_LINES_AT_ROOT + wx.wxTR_HAS_BUTTONS )
137 |
138 | --[[
139 | local root_id = tree:AddRoot( "Root" )
140 | local parent_id = tree:AppendItem( root_id, "Parent " )
141 | local child_id = tree:AppendItem( parent_id, "Child " )
142 |
143 | local imagelist=wx.wxImageList(32,32)
144 | local bitmap = wx.wxBitmap(sample_xpm)
145 | imagelist:Add(bitmap) --index is 0 no 1
146 | tree:AssignImageList(imagelist)
147 | tree:SetItemImage(root_id,0,wx.wxTreeItemIcon_Normal)
148 | tree:SetItemTextColour(root_id,wx.wxColour("0xFF0000"))
149 | tree:SetItemBackgroundColour(root_id,wx.wxColour("0xFF0000"))
150 | tree:SetIndent(32)
151 | tree:SetItemDropHighlight(root_id,true)
152 |
153 |
154 | child_id2=tree:PrependItem ( root_id,"string",0)
155 | ]]
156 |
157 | data2tree(tree,data)
158 |
159 |
160 | return tree
161 | end
162 |
--------------------------------------------------------------------------------
/wxlua相关/自带例程/auidemo.wx - 复制.wlua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/auidemo.wx - 复制.wlua
--------------------------------------------------------------------------------
/wxlua相关/自带例程/auidemo.wx.wlua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/auidemo.wx.wlua
--------------------------------------------------------------------------------
/wxlua相关/自带例程/grid.wx.wlua:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------
2 | -- Name: grid.wx.lua
3 | -- Purpose: wxGrid wxLua sample
4 | -- Author: J Winwood
5 | -- Created: January 2002
6 | -- Copyright: (c) 2002 Lomtick Software. All rights reserved.
7 | -- Licence: wxWidgets licence
8 | -----------------------------------------------------------------------------
9 |
10 | -- Load the wxLua module, does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit
11 | package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
12 | require("wx")
13 |
14 | local frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxLua wxGrid Sample",
15 | wx.wxPoint(25, 25), wx.wxSize(350, 250))
16 |
17 | local fileMenu = wx.wxMenu("", wx.wxMENU_TEAROFF)
18 | fileMenu:Append(wx.wxID_EXIT, "E&xit\tCtrl-X", "Quit the program")
19 |
20 | local helpMenu = wx.wxMenu("", wx.wxMENU_TEAROFF)
21 | helpMenu:Append(wx.wxID_ABOUT, "&About\tCtrl-A", "About the Grid wxLua Application")
22 |
23 | local menuBar = wx.wxMenuBar()
24 | menuBar:Append(fileMenu, "&File")
25 | menuBar:Append(helpMenu, "&Help")
26 |
27 | frame:SetMenuBar(menuBar)
28 |
29 | frame:CreateStatusBar(1)
30 | frame:SetStatusText("Welcome to wxLua.")
31 |
32 | frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED,
33 | function (event)
34 | frame:Close()
35 | end )
36 |
37 | frame:Connect(wx.wxID_ABOUT, wx.wxEVT_COMMAND_MENU_SELECTED,
38 | function (event)
39 | wx.wxMessageBox('This is the "About" dialog of the wxGrid wxLua sample.\n'..
40 | wxlua.wxLUA_VERSION_STRING.." built with "..wx.wxVERSION_STRING,
41 | "About wxLua",
42 | wx.wxOK + wx.wxICON_INFORMATION,
43 | frame )
44 | end )
45 |
46 | grid = wx.wxGrid(frame, wx.wxID_ANY)
47 |
48 | grid:CreateGrid(10, 8)
49 | grid:SetColSize(3, 200)
50 | grid:SetRowSize(4, 45)
51 | grid:SetCellValue(0, 0, "First cell")
52 | grid:SetCellValue(1, 1, "Another cell")
53 | grid:SetCellValue(2, 2, "Yet another cell")
54 | grid:SetCellFont(0, 0, wx.wxFont(10, wx.wxROMAN, wx.wxITALIC, wx.wxNORMAL))
55 | grid:SetCellTextColour(1, 1, wx.wxRED)
56 | grid:SetCellBackgroundColour(2, 2, wx.wxCYAN)
57 |
58 | frame:Show(true)
59 |
60 | -- Call wx.wxGetApp():MainLoop() last to start the wxWidgets event loop,
61 | -- otherwise the wxLua program will exit immediately.
62 | -- Does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit since the
63 | -- MainLoop is already running or will be started by the C++ program.
64 | wx.wxGetApp():MainLoop()
65 |
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/cmyk.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/cmyk.jpg
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.bmp
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.cur:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.cur
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.gif
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.ico
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.jpg
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.pcx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.pcx
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.png
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.pnm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.pnm
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.tga:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.tga
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse.tif
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse3.ani:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse3.ani
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/horse_rg.pnm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/horse_rg.pnm
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/smile.xbm:
--------------------------------------------------------------------------------
1 | #define smile_width 32
2 | #define smile_height 32
3 | static unsigned char smile_bits[] = {
4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x1c, 0x1c, 0x00,
5 | 0x00, 0x03, 0x60, 0x00, 0x80, 0x00, 0x80, 0x00, 0x60, 0x00, 0x00, 0x03,
6 | 0x20, 0x00, 0x00, 0x04, 0x10, 0x08, 0x08, 0x04, 0x08, 0x14, 0x14, 0x08,
7 | 0x08, 0x22, 0x22, 0x10, 0x04, 0x01, 0x40, 0x10, 0x04, 0x08, 0x08, 0x10,
8 | 0x04, 0x08, 0x08, 0x10, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x20,
9 | 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x20, 0x02, 0x02, 0x20, 0x20,
10 | 0x04, 0x0e, 0x38, 0x10, 0x04, 0x3e, 0x3e, 0x10, 0x04, 0xf4, 0x1b, 0x10,
11 | 0x08, 0xd8, 0x0a, 0x10, 0x08, 0xb0, 0x07, 0x08, 0x10, 0xc0, 0x01, 0x04,
12 | 0x20, 0x00, 0x00, 0x04, 0x60, 0x00, 0x00, 0x03, 0x80, 0x00, 0x80, 0x00,
13 | 0x00, 0x03, 0x60, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0xe0, 0x03, 0x00,
14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
15 |
16 |
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/smile.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char *smile_xpm[] = {
3 | /* columns rows colors chars-per-pixel */
4 | "32 32 4 1",
5 | ". c Black",
6 | "X c #FFFF00",
7 | " c None",
8 | "o c #C00000",
9 | /* pixels */
10 | " ",
11 | " ..... ",
12 | " ...XXXXX... ",
13 | " ..XXXXXXXXXXX.. ",
14 | " .XXXXXXXXXXXXXXX. ",
15 | " ..XXXXXXXXXXXXXXXXX.. ",
16 | " .XXXXXXXXXXXXXXXXXXXX. ",
17 | " .XXXXXX.XXXXXXX.XXXXXX. ",
18 | " .XXXXXX.X.XXXXX.X.XXXXXX. ",
19 | " .XXXXX.XXX.XXX.XXX.XXXXXX. ",
20 | " .XXXXX.XXXXXXXXXXXXX.XXXXX. ",
21 | " .XXXXXXXX.XXXXXXX.XXXXXXXX. ",
22 | " .XXXXXXXX.XXXXXXX.XXXXXXXX. ",
23 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
24 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
25 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
26 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
27 | " .XXXXXXX.XXXXXXXXXXX.XXXXXXX. ",
28 | " .XXXXXX...XXXXXXX...XXXXXX. ",
29 | " .XXXXXX.oo..XXX..oo.XXXXXX. ",
30 | " .XXXXXXX.ooo...ooo.XXXXXXX. ",
31 | " .XXXXXXX.ooooooo.XXXXXXXX. ",
32 | " .XXXXXXXX..ooo..XXXXXXXX. ",
33 | " .XXXXXXXXX...XXXXXXXXX. ",
34 | " .XXXXXXXXXXXXXXXXXXXX. ",
35 | " ..XXXXXXXXXXXXXXXXX.. ",
36 | " .XXXXXXXXXXXXXXX. ",
37 | " ..XXXXXXXXXXX.. ",
38 | " ...XXXXX... ",
39 | " ..... ",
40 | " ",
41 | " "
42 | };
43 |
--------------------------------------------------------------------------------
/wxlua相关/自带例程/image/toucan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/czfshine-self/ds_mod_creator/bd79cd556f4d3d3b6b4a2ecc900a9faf982e27a6/wxlua相关/自带例程/image/toucan.png
--------------------------------------------------------------------------------
/wxlua相关/自带例程/luamodule.wx.wlua:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------
2 | -- Name: luamodule.wx.lua
3 | -- Purpose: Minimal wxLua sample for use as a lua module using require
4 | -- Author: John Labenski
5 | -- Modified by:
6 | -- Created: 05/13/2006
7 | -- RCS-ID:
8 | -- Copyright: (c) 2001 John Labenski. All rights reserved.
9 | -- Licence: wxWidgets licence
10 | -----------------------------------------------------------------------------
11 |
12 | -- to make this sample script work out-of-the-box, we need to add
13 | -- to the paths looked by require() all possible locations of the
14 | -- wx.dll/.so module when this script is run from the samples dir.
15 | -- Please also note that this sample can be executed only when
16 | -- wxLua has been compiled in shared mode (--enable-shared on Unix,
17 | -- SHARED=1 on Windows)
18 | package.cpath = package.cpath..";;./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
19 | require("wx")
20 |
21 | -- simple test of Non GUI elements
22 | p = wx.wxPoint(1,2)
23 | print("The point is", p:GetX(), p:GetY())
24 |
25 | frame = wx.wxFrame(wx.NULL, -1, "wxLua module sample")
26 |
27 | -- create a simple file menu so you can exit the program nicely
28 | local fileMenu = wx.wxMenu()
29 | fileMenu:Append(wx.wxID_EXIT, "E&xit", "Quit the program")
30 | local menuBar = wx.wxMenuBar()
31 | menuBar:Append(fileMenu, "&File")
32 | frame:SetMenuBar(menuBar)
33 | frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED,
34 | function (event) frame:Close(true) end )
35 |
36 | frame:Show(true)
37 |
38 | -- Call wx.wxGetApp():MainLoop() last to start the wxWidgets event loop,
39 | -- otherwise the wxLua program will exit immediately.
40 | -- Does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit since the
41 | -- MainLoop is already running or will be started by the C++ program.
42 | wx.wxGetApp():MainLoop()
43 |
44 |
--------------------------------------------------------------------------------
/wxlua相关/自带例程/mdi.wx.wlua:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------
2 | -- Name: mdi.wx.lua
3 | -- Purpose: wxMdi wxLua sample
4 | -- Author: J Winwood
5 | -- Modified by:
6 | -- Created: 16/11/2001
7 | -- RCS-ID: $Id: mdi.wx.lua,v 1.15 2008/01/22 04:45:39 jrl1 Exp $
8 | -- Copyright: (c) 2001 Lomtick Software. All rights reserved.
9 | -- Licence: wxWidgets licence
10 | -----------------------------------------------------------------------------
11 |
12 | -- Load the wxLua module, does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit
13 | package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
14 | require("wx")
15 |
16 | frame = nil
17 | childList = {}
18 | numChildren = 0
19 |
20 | function CreateChild()
21 | local child = wx.wxMDIChildFrame( frame, wx.wxID_ANY, "" )
22 | child:SetSize(330,340)
23 | childList[child:GetId()] = child
24 | numChildren = numChildren + 1
25 | child:SetTitle("Child "..numChildren)
26 |
27 | function OnPaint(event)
28 | local id = event:GetId()
29 | local win = event:GetEventObject():DynamicCast("wxWindow")
30 | local dc = wx.wxPaintDC(win) -- or can use childList[id]
31 | dc:DrawRectangle(10, 10, 300, 300);
32 | dc:DrawRoundedRectangle(20, 20, 280, 280, 20);
33 | dc:DrawEllipse(30, 30, 260, 260);
34 | dc:DrawText("A test string for window Id "..tostring(win:GetId()), 50, 150);
35 | dc:delete() -- ALWAYS delete() any wxDCs created when done
36 | end
37 | child:Connect(wx.wxEVT_PAINT, OnPaint)
38 | child:Show(true)
39 | end
40 |
41 |
42 | frame = wx.wxMDIParentFrame( wx.NULL, wx.wxID_ANY, "wxLua MDI Demo",
43 | wx.wxDefaultPosition, wx.wxSize(450, 450),
44 | wx.wxDEFAULT_FRAME_STYLE )
45 |
46 |
47 | local fileMenu = wx.wxMenu()
48 | fileMenu:Append(wx.wxID_NEW, "&New", "Create a new child window")
49 | fileMenu:Append(wx.wxID_EXIT, "E&xit", "Quit the program")
50 |
51 | local helpMenu = wx.wxMenu()
52 | helpMenu:Append(wx.wxID_ABOUT, "&About", "About the wxLua MDI Application")
53 |
54 | local menuBar = wx.wxMenuBar()
55 | menuBar:Append(fileMenu, "&File")
56 | menuBar:Append(helpMenu, "&Help")
57 |
58 | frame:SetMenuBar(menuBar)
59 |
60 | frame:CreateStatusBar(1)
61 | frame:SetStatusText("Welcome to wxLua.")
62 |
63 | frame:Connect(wx.wxID_NEW, wx.wxEVT_COMMAND_MENU_SELECTED,
64 | function (event) CreateChild() end )
65 |
66 | frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED,
67 | function (event) frame:Close() end )
68 |
69 | frame:Connect(wx.wxID_ABOUT, wx.wxEVT_COMMAND_MENU_SELECTED,
70 | function (event)
71 | wx.wxMessageBox('This is the "About" dialog of the MDI wxLua sample.\n'..
72 | wxlua.wxLUA_VERSION_STRING.." built with "..wx.wxVERSION_STRING,
73 | "About wxLua",
74 | wx.wxOK + wx.wxICON_INFORMATION,
75 | frame )
76 | end )
77 |
78 | frame:Show(true)
79 |
80 | -- Call wx.wxGetApp():MainLoop() last to start the wxWidgets event loop,
81 | -- otherwise the wxLua program will exit immediately.
82 | -- Does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit since the
83 | -- MainLoop is already running or will be started by the C++ program.
84 | wx.wxGetApp():MainLoop()
85 |
--------------------------------------------------------------------------------
/wxlua相关/自带例程/minimal.wx.wlua:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------
2 | -- Name: minimal.wx.lua
3 | -- Purpose: Minimal wxLua sample
4 | -- Author: J Winwood
5 | -- Modified by:
6 | -- Created: 16/11/2001
7 | -- RCS-ID: $Id: minimal.wx.lua,v 1.11 2008/01/22 04:45:39 jrl1 Exp $
8 | -- Copyright: (c) 2001 J Winwood. All rights reserved.
9 | -- Licence: wxWidgets licence
10 | -----------------------------------------------------------------------------
11 |
12 | -- Load the wxLua module, does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit
13 | package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
14 | require("wx")
15 |
16 | frame = nil
17 |
18 | -- paint event handler for the frame that's called by wxEVT_PAINT
19 | function OnPaint(event)
20 | -- must always create a wxPaintDC in a wxEVT_PAINT handler
21 | local dc = wx.wxPaintDC(panel)
22 | -- call some drawing functions
23 | dc:DrawRectangle(10, 10, 300, 300);
24 | dc:DrawRoundedRectangle(20, 20, 280, 280, 20);
25 | dc:DrawEllipse(30, 30, 260, 260);
26 | dc:DrawText("A test string", 50, 150);
27 | -- the paint DC will be automatically destroyed by the garbage collector,
28 | -- however on Windows 9x/Me this may be too late (DC's are precious resource)
29 | -- so delete it here
30 | dc:delete() -- ALWAYS delete() any wxDCs created when done
31 | end
32 |
33 | -- Create a function to encapulate the code, not necessary, but it makes it
34 | -- easier to debug in some cases.
35 | function main()
36 |
37 | -- create the wxFrame window
38 | frame = wx.wxFrame( wx.NULL, -- no parent for toplevel windows
39 | wx.wxID_ANY, -- don't need a wxWindow ID
40 | "wxLua Minimal Demo", -- caption on the frame
41 | wx.wxDefaultPosition, -- let system place the frame
42 | wx.wxSize(450, 450), -- set the size of the frame
43 | wx.wxDEFAULT_FRAME_STYLE ) -- use default frame styles
44 |
45 | -- create a single child window, wxWidgets will set the size to fill frame
46 | panel = wx.wxPanel(frame, wx.wxID_ANY)
47 |
48 | -- connect the paint event handler function with the paint event
49 | panel:Connect(wx.wxEVT_PAINT, OnPaint)
50 |
51 | -- create a simple file menu
52 | local fileMenu = wx.wxMenu()
53 | fileMenu:Append(wx.wxID_EXIT, "E&xit", "Quit the program")
54 |
55 | -- create a simple help menu
56 | local helpMenu = wx.wxMenu()
57 | helpMenu:Append(wx.wxID_ABOUT, "&About", "About the wxLua Minimal Application")
58 |
59 | -- create a menu bar and append the file and help menus
60 | local menuBar = wx.wxMenuBar()
61 | menuBar:Append(fileMenu, "&File")
62 | menuBar:Append(helpMenu, "&Help")
63 |
64 | -- attach the menu bar into the frame
65 | frame:SetMenuBar(menuBar)
66 |
67 | -- create a simple status bar
68 | frame:CreateStatusBar(1)
69 | frame:SetStatusText("Welcome to wxLua.")
70 |
71 | -- connect the selection event of the exit menu item to an
72 | -- event handler that closes the window
73 | frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED,
74 | function (event) frame:Close(true) end )
75 |
76 | -- connect the selection event of the about menu item
77 | frame:Connect(wx.wxID_ABOUT, wx.wxEVT_COMMAND_MENU_SELECTED,
78 | function (event)
79 | wx.wxMessageBox('This is the "About" dialog of the Minimal wxLua sample.\n'..
80 | wxlua.wxLUA_VERSION_STRING.." built with "..wx.wxVERSION_STRING,
81 | "About wxLua",
82 | wx.wxOK + wx.wxICON_INFORMATION,
83 | frame)
84 | end )
85 |
86 | -- show the frame window
87 | frame:Show(true)
88 | end
89 |
90 | main()
91 |
92 | -- Call wx.wxGetApp():MainLoop() last to start the wxWidgets event loop,
93 | -- otherwise the wxLua program will exit immediately.
94 | -- Does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit since the
95 | -- MainLoop is already running or will be started by the C++ program.
96 | wx.wxGetApp():MainLoop()
97 |
--------------------------------------------------------------------------------
/wxlua相关/自带例程/sizer.wx.wlua:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------
2 | -- Name: sizer.wx.lua
3 | -- Purpose: Shows using sizers in wxLua
4 | -- Author: Francis Irving
5 | -- Created: 23/01/2002
6 | -- RCS-ID: $Id: sizer.wx.lua,v 1.8 2008/01/22 04:45:39 jrl1 Exp $
7 | -- Copyright: (c) 2002 Creature Labs. All rights reserved.
8 | -- Licence: wxWidgets licence
9 | -----------------------------------------------------------------------------
10 |
11 | -- Load the wxLua module, does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit
12 | package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
13 | require("wx")
14 |
15 | frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxLua sizer test frame")
16 |
17 | -- Create two controls (note that their parents are the _frame_ (not the sizer))
18 | textEntry = wx.wxTextCtrl(frame, wx.wxID_ANY, "Enter URL");
19 | button = wx.wxButton(frame, wx.wxID_ANY, "test")
20 |
21 | -- Put them in a vertical sizer, with ratio 3 units for the text entry, 5 for button
22 | -- and padding of 6 pixels.
23 | sizerTop = wx.wxBoxSizer(wx.wxVERTICAL)
24 | sizerTop:Add(textEntry, 3, wx.wxGROW + wx.wxALL, 6)
25 | sizerTop:Add(button, 5, wx.wxGROW + wx.wxALL, 6)
26 |
27 | -- Set up the frame to use that sizer to move/resize its children controls
28 | frame:SetAutoLayout(true)
29 | frame:SetSizer(sizerTop)
30 |
31 | -- Optional - these will set an initial minimal size, just enough to hold the
32 | -- controls (more useful for dialogs than a frame)
33 | sizerTop:SetSizeHints(frame)
34 | sizerTop:Fit(frame)
35 |
36 | -- Start the application
37 | wx.wxGetApp():SetTopWindow(frame)
38 | frame:Show(true)
39 |
40 | -- Call wx.wxGetApp():MainLoop() last to start the wxWidgets event loop,
41 | -- otherwise the wxLua program will exit immediately.
42 | -- Does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit since the
43 | -- MainLoop is already running or will be started by the C++ program.
44 | wx.wxGetApp():MainLoop()
45 |
--------------------------------------------------------------------------------
/wxlua相关/自带例程/veryminimal.wx.wlua:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------
2 | -- Name: minimal.wx.lua
3 | -- Purpose: 'Minimal' wxLua sample
4 | -- Author: J Winwood
5 | -- Modified by:
6 | -- Created: 16/11/2001
7 | -- RCS-ID: $Id: veryminimal.wx.lua,v 1.7 2008/01/22 04:45:39 jrl1 Exp $
8 | -- Copyright: (c) 2001 J Winwood. All rights reserved.
9 | -- Licence: wxWidgets licence
10 | -----------------------------------------------------------------------------
11 |
12 | -- Load the wxLua module, does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit
13 | package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
14 | require("wx")
15 |
16 | frame = nil
17 |
18 | function main()
19 |
20 | -- create the frame window
21 | frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "wxLua Very Minimal Demo",
22 | wx.wxDefaultPosition, wx.wxSize(450, 450),
23 | wx.wxDEFAULT_FRAME_STYLE )
24 |
25 | -- show the frame window
26 | frame:Show(true)
27 | end
28 |
29 | main()
30 |
31 | -- Call wx.wxGetApp():MainLoop() last to start the wxWidgets event loop,
32 | -- otherwise the wxLua program will exit immediately.
33 | -- Does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit since the
34 | -- MainLoop is already running or will be started by the C++ program.
35 | wx.wxGetApp():MainLoop()
36 |
--------------------------------------------------------------------------------
/待办事宜.md:
--------------------------------------------------------------------------------
1 | 待办事宜
2 | ===================================
3 |
4 | ## 增加时间:2014-12-9 ##
5 |
6 | 事情|需要|类型|重要度| 完成者|完成时间
7 | ----|----|----|------|------|--------|
8 | 建立主框架|wxlua|界面|1|
9 | 封装树形框|wxlua|代码封装|2|
10 | 封装文本框|wxlua| 代码封装| 2|
11 | 风格文本框 | wxlua | 代码封装| 2|
12 | DMT绑定 | C++ | 扩展库 | 4|
13 | ktools绑定 | C++| 扩展库 | 4|
14 | 设计菜单栏 | wxlua | 界面设计| 1.5
15 | 设计工具栏 | wxlua | 界面设计| 1.5
16 | 设计新建项目| wxlua | 界面设计| 3
17 | 设计新建动画 |wxlua | 界面设计| 3
18 | 设计脚本 | wxlua | 界面设计| 3
19 | 脚本注释模块| lua | 逻辑处理| 6
20 | 设计模板| 饥荒+lua| 模板设计| 6
21 | 建立帮助系统| chm+lua | 文档管理| 5
22 | 构建事件系统| wxlua | 事件处理| 2
23 | 绘画图标 | ps | CG设计 | 6
24 | 封装外部程序| 系统+lua| 逻辑处理| 4
25 | 设计工具栏 | 饥荒+lua| 逻辑处理 |3
26 | 增加代码片模块 |饥荒+lua |逻辑处理 |6
27 |
--------------------------------------------------------------------------------