aboutsummaryrefslogtreecommitdiff
path: root/advtrains/models/advtrains_dtrack_swlcr_30.b3d
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-08-09 19:11:26 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-08-09 19:11:26 +0200
commitd074d3223ac87f617b28454ef0880c04ce89d53b (patch)
tree0d3f0e3612a8847dfc2171a977e9d9434263a127 /advtrains/models/advtrains_dtrack_swlcr_30.b3d
parent95fb122eca46c93c8a2545fe1baf4e1bea9d6e6b (diff)
downloadadvtrains-d074d3223ac87f617b28454ef0880c04ce89d53b.tar.gz
advtrains-d074d3223ac87f617b28454ef0880c04ce89d53b.tar.bz2
advtrains-d074d3223ac87f617b28454ef0880c04ce89d53b.zip
Change API to return the id of a newly created train when discoupling
Diffstat (limited to 'advtrains/models/advtrains_dtrack_swlcr_30.b3d')
0 files changed, 0 insertions, 0 deletions
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
--Minetest
--Copyright (C) 2013 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 enabled_all = false

local function modname_valid(name)
	return not name:find("[^a-z0-9_]")
end

local function get_formspec(data)
	local mod = data.list:get_list()[data.selected_mod]

	local retval =
		"size[11.5,7.5,true]" ..
		"label[0.5,0;" .. fgettext("World:") .. "]" ..
		"label[1.75,0;" .. data.worldspec.name .. "]"

	if mod == nil then
		mod = {name=""}
	end

	local hard_deps, soft_deps = modmgr.get_dependencies(mod.path)

	retval = retval ..
		"label[0,0.7;" .. fgettext("Mod:") .. "]" ..
		"label[0.75,0.7;" .. mod.name .. "]" ..
		"label[0,1.25;" .. fgettext("Dependencies:") .. "]" ..
		"textlist[0,1.75;5,2.125;world_config_depends;" ..
		hard_deps .. ";0]" ..
		"label[0,3.875;" .. fgettext("Optional dependencies:") .. "]" ..
		"textlist[0,4.375;5,1.8;world_config_optdepends;" ..
		soft_deps .. ";0]" ..
		"button[3.25,7;2.5,0.5;btn_config_world_save;" .. fgettext("Save") .. "]" ..
		"button[5.75,7;2.5,0.5;btn_config_world_cancel;" .. fgettext("Cancel") .. "]"

	if mod and mod.name ~= "" and mod.typ ~= "game_mod" then
		if mod.is_modpack then
			local rawlist = data.list:get_raw_list()

			local all_enabled = true
			for j = 1, #rawlist, 1 do
				if rawlist[j].modpack == mod.name and not rawlist[j].enabled then
					all_enabled = false
					break
				end
			end

			if all_enabled then
				retval = retval .. "button[5.5,0.125;2.5,0.5;btn_mp_disable;" ..
					fgettext("Disable MP") .. "]"
			else
				retval = retval .. "button[5.5,0.125;2.5,0.5;btn_mp_enable;" ..
					fgettext("Enable MP") .. "]"
			end
		else
			if mod.enabled then
				retval = retval .. "checkbox[5.5,-0.125;cb_mod_enable;" ..
					fgettext("enabled") .. ";true]"
			else
				retval = retval .. "checkbox[5.5,-0.125;cb_mod_enable;" ..
					fgettext("enabled") .. ";false]"
			end
		end
	end