ofs | hex dump | ascii |
---|
0000 | 42 42 33 44 1d 33 00 00 01 00 00 00 54 45 58 53 36 00 00 00 61 64 76 74 72 61 69 6e 73 5f 72 65 | BB3D.3......TEXS6...advtrains_re |
0020 | 74 72 6f 73 69 67 6e 61 6c 2e 70 6e 67 00 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 | trosignal.png................... |
0040 | 80 3f 00 00 80 3f 00 00 00 00 42 52 55 53 2e 00 00 00 01 00 00 00 42 72 75 73 68 2e 30 30 31 00 | .?...?....BRUS........Brush.001. |
0060 | 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 | ...?...?...?...?................ |
0080 | 4e 4f 44 45 9d 32 00 00 43 75 62 65 2e 30 30 31 00 00 00 80 b0 00 00 00 00 00 00 00 00 00 00 80 | NODE.2..Cube.001................ |
00a0 | 3f 00 00 80 3f 00 00 80 3f b4 d3 e9 3e 33 9e 2f be 59 28 4f bf 84 a2 a7 3e 4d 45 53 48 64 32 00 | ?...?...?...>3./.Y(O....>MESHd2. |
00c0 | 00 ff ff ff ff 56 52 54 53 8c 2b 00 00 01 00 00 00 01 00 00 00 02 00 00 00 ae 3e cd bd bd b9 f1 | .....VRTS.+...............>..... |
--Minetest
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------------
local function rename_modpack_formspec(dialogdata)
dialogdata.mod = modmgr.global_mods:get_list()[dialogdata.selected]
local retval =
"size[12.4,5,true]" ..
"label[1.75,1;".. fgettext("Rename Modpack:") .. "]"..
"field[4.5,1.4;6,0.5;te_modpack_name;;" ..
dialogdata.mod.name ..
"]" ..
"button[5,4.2;2.6,0.5;dlg_rename_modpack_confirm;"..
fgettext("Accept") .. "]" ..
"button[7.5,4.2;2.8,0.5;dlg_rename_modpack_cancel;"..
fgettext("Cancel") .. "]"
return retval
end
--------------------------------------------------------------------------------
local function rename_modpack_buttonhandler(this, fields)
if fields["dlg_rename_modpack_confirm"] ~= nil then
local oldpath = core.get_modpath() .. DIR_DELIM .. this.data.mod.name
local targetpath = core.get_modpath() .. DIR_DELIM .. fields["te_modpack_name"]
core.copy_dir(oldpath,targetpath,false)
modmgr.refresh_globals()
modmgr.selected_mod = modmgr.global_mods:get_current_index(
modmgr.global_mods:raw_index_by_uid(fields["te_modpack_name"]))
this:delete()
return true
end
if fields["dlg_rename_modpack_cancel"] then
this:delete()
return true
end
return false
end
--------------------------------------------------------------------------------
function create_rename_modpack_dlg(selected_index)
local retval = dialog_create("dlg_delete_mod",
rename_modpack_formspec,
rename_modpack_buttonhandler,
nil)
retval.data.selected = selected_index
return retval
end
|