summaryrefslogtreecommitdiff
path: root/src/client
Commit message (Expand)AuthorAge
...
* Fix movement in random_input mode (#11592)NeroBurner2021-09-05
* Joystick sensitivity for player movement (#11262)NeroBurner2021-08-27
* Fix 6th line of infotext being cut off in half (#11456)Wuzzy2021-08-23
* Show status message when changing block bounds (#11556)Wuzzy2021-08-21
* Fix scaled world-aligned textures being aligned inconsistently for non-normal...Wuzzy2021-08-19
* Add fwgettext util functionrubenwardy2021-08-19
* Fix inconsistent integer comparison warningsSmallJoker2021-08-17
* Start sprite animation at the beginning (#11509)Lean Rada2021-08-16
* Cap iterations of imageCleanTransparent sanelysfan52021-08-16
* Fix segfault caused by shadow map on exitSmallJoker2021-08-12
* Move updating shadows outside of RenderingCore::drawAll. (#11491)x20482021-08-12
* OpenAL: Free buffers on quitSmallJoker2021-08-03
* Mods: Combine mod loading checks and deprection logging (#11503)SmallJoker2021-07-31
* Remove unsupported extensions from list in tile.cpphecktest2021-07-29
* Add bold, italic and monospace font styling for HUD text elements (#11478)sfan52021-07-27
* Distribute shadow map update over multiple frames to reduce stutter (#11422)x20482021-07-25
* Remove unused ITextSceneNode header (#11476)hecks2021-07-22
* Remove unused header includeshecks2021-07-21
* CSM: Do not index files within hidden directoriesSmallJoker2021-07-17
* Add wallmounted support for plantlike and plantlike_rooted nodes (#11379)Wuzzy2021-07-15
* Fix revoke debug privs not reliably turn off stuff (#11409)Wuzzy2021-07-12
* Fix build on Ubuntu 16.04 and macOSsfan52021-07-12
* Avoid draw list and shadow map update in the same frame to reduce dtime jitte...x20482021-07-11
* Improve shadow rendering with non-default camera FOV (#11385)x20482021-07-11
* Refactor video driver name retrieval (#11413)hecks2021-07-11
* Remove unsupported video drivers (#11395)hecks2021-06-30
* Require 'basic_debug' priv to view gameplay-relevant debug info, require 'deb...Wuzzy2021-06-24
* Perform some quality assurance for translation strings (#11375)Wuzzy2021-06-23
* Drop --videomodes, fullscreen_bpp and high_precision_fpu settingssfan52021-06-16
* Shadow mapping render pass (#11244)Liso2021-06-06
* fontengine: Fix crash loading PNG/XML fonts from paths without dotsfan52021-06-01
* Fix procession ordering issue in content_caosfan52021-05-30
* Fix cloud fog being broken for high cloudsWuzzy2021-05-29
* Fix client crash on when con::PeerNotFoundException is thrown (#11286)savilli2021-05-24
* Fix overlays for 2D-drawn itemssfan52021-05-08
* fix: extractZipFile is not part of Client but more generic.Loic Blot2021-05-06
* Use Irrlicht functions to query npot texture supportsfan52021-05-05
* fix: some code tidy about includes & irr namespacesLoic Blot2021-05-03
* refacto: remove get_gui_env & draw_load_screen from RenderingEngine singletonLoic Blot2021-05-03
* fix: don't use RenderingEngine singleton when it's possibleLoic Blot2021-05-03
* refacto: RenderingEngine::get_scene_manager() is now not callable from singletonLoic Blot2021-05-03
* refacto: Hud: make driver, client, player, inventory, tsrc private & drop unu...Loic Blot2021-05-03
* refacto: drop unused Hud::smgrLoic Blot2021-05-03
* refacto: don't use RenderingEngine singleton on CAOLoic Blot2021-05-03
* refacto: protect some RenderingEngine::get_scene_managerLoic Blot2021-05-03
* refacto: RenderingEngine is now better hiddenLoic Blot2021-05-03
* refacto: hide mesh_cache inside the rendering engineLoic Blot2021-05-03
* refacto: add RenderingEngine::cleanupMeshCacheLoic Blot2021-05-03
* refacto: rendering engine singleton removal step 1 (filesystem)Loic Blot2021-05-03
* fix: drop old irrlicht <1.8 compat on Client::loadMediaLoic Blot2021-05-03
lass="hl kwa">if atc.controllers[pts].arrowconn then atlog("ATC controller at",pts,": This controller had an arrowconn of", atc.controllers[pts].arrowconn, "set. Since this field is now deprecated, it was removed.") atc.controllers[pts].arrowconn = nil end local train = advtrains.trains[train_id] local index = advtrains.path_lookup(train, pos) local iconnid = 1 if index then iconnid = train.path_cn[index] else atwarn("ATC rail at", pos, ": Rail not on train's path! Can't determine arrow direction. Assuming +!") end atc.train_set_command(train, atc.controllers[pts].command, iconnid==1) atprint("Sending ATC Command to", train_id, ":", atc.controllers[pts].command, "iconnid=",iconnid) return true else atwarn("ATC rail at", pos, ": Sending command failed: The train",train_id,"does not exist. This seems to be a bug.") end else atwarn("ATC rail at", pos, ": Sending command failed: There's no train at this position. This seems to be a bug.") end else atwarn("ATC rail at", pos, ": Sending command failed: Entry for controller not found.") atwarn("ATC rail at", pos, ": Please visit controller and click 'Save'") end return false end function atc.train_reset_command(train) train.atc_command=nil train.atc_delay=nil train.atc_brake_target=nil train.atc_wait_finish=nil train.atc_arrow=nil train.tarvelocity=nil end --nodes local idxtrans={static=1, mesecon=2, digiline=3} local apn_func=function(pos) -- FIX for long-persisting ndb bug: there's no node in parameter 2 of this function! local meta=minetest.get_meta(pos) if meta then meta:set_string("infotext", attrans("ATC controller, unconfigured.")) meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) end end advtrains.atc_function = function(def, preset, suffix, rotation) return { after_place_node=apn_func, after_dig_node=function(pos) return advtrains.pcall(function() advtrains.invalidate_all_paths(pos) advtrains.ndb.clear(pos) local pts=minetest.pos_to_string(pos) atc.controllers[pts]=nil end) end, on_receive_fields = function(pos, formname, fields, player) return advtrains.pcall(function() if advtrains.is_protected(pos, player:get_player_name()) then minetest.record_protection_violation(pos, player:get_player_name()) return end local meta=minetest.get_meta(pos) if meta then if not fields.save then --maybe only the dropdown changed if fields.mode then meta:set_string("mode", idxtrans[fields.mode]) if fields.mode=="digiline" then meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) else meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) end meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) end return end meta:set_string("mode", idxtrans[fields.mode]) meta:set_string("command", fields.command) meta:set_string("command_on", fields.command_on) meta:set_string("channel", fields.channel) if fields.mode=="digiline" then meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) else meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) end meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) local pts=minetest.pos_to_string(pos) local _, conns=advtrains.get_rail_info_at(pos, advtrains.all_tracktypes) atc.controllers[pts]={command=fields.command} if #advtrains.occ.get_trains_at(pos) > 0 then atc.send_command(pos) end end end) end, advtrains = { on_train_enter = function(pos, train_id) atc.send_command(pos) end, }, } end function atc.get_atc_controller_formspec(pos, meta) local mode=tonumber(meta:get_string("mode")) or 1 local command=meta:get_string("command") local command_on=meta:get_string("command_on") local channel=meta:get_string("channel") local formspec="size[8,6]" -- "dropdown[0,0;3;mode;static,mesecon,digiline;"..mode.."]" if mode<3 then formspec=formspec.."field[0.5,1.5;7,1;command;"..attrans("Command")..";"..minetest.formspec_escape(command).."]" if tonumber(mode)==2 then formspec=formspec.."field[0.5,3;7,1;command_on;"..attrans("Command (on)")..";"..minetest.formspec_escape(command_on).."]" end else formspec=formspec.."field[0.5,1.5;7,1;channel;"..attrans("Digiline channel")..";"..minetest.formspec_escape(channel).."]" end return formspec.."button_exit[0.5,4.5;7,1;save;"..attrans("Save").."]" end --from trainlogic.lua train step local matchptn={ ["SM"]=function(id, train) train.tarvelocity=train.max_speed return 2 end, ["S([0-9]+)"]=function(id, train, match) train.tarvelocity=tonumber(match) return #match+1 end, ["B([0-9B]+)"]=function(id, train, match) if match=="B" then train.atc_brake_target = -1 train.tarvelocity = 0 elseif train.velocity>tonumber(match) then train.atc_brake_target=tonumber(match) if not train.tarvelocity or train.tarvelocity>train.atc_brake_target then train.tarvelocity=train.atc_brake_target end end return #match+1 end, ["W"]=function(id, train) train.atc_wait_finish=true return 1 end, ["D([0-9]+)"]=function(id, train, match) train.atc_delay=tonumber(match) return #match+1 end, ["R"]=function(id, train) if train.velocity<=0 then advtrains.invert_train(id) advtrains.train_ensure_init(id, train) -- no one minds if this failed... this shouldn't even be called without train being initialized... else atwarn(sid(id), attrans("ATC Reverse command warning: didn't reverse train, train moving!")) end return 1 end, ["O([LRC])"]=function(id, train, match) local tt={L=-1, R=1, C=0} local arr=train.atc_arrow and 1 or -1 train.door_open = tt[match]*arr return 2 end, } function atc.execute_atc_command(id, train) --strip whitespaces local command=string.match(train.atc_command, "^%s*(.*)$") if string.match(command, "^%s*$") then train.atc_command=nil return end --conditional statement? local is_cond, cond_applies, compare local cond, rest=string.match(command, "^I([%+%-])(.+)$") if cond then is_cond=true if cond=="+" then cond_applies=train.atc_arrow end if cond=="-" then cond_applies=not train.atc_arrow end else cond, compare, rest=string.match(command, "^I([<>]=?)([0-9]+)(.+)$") if cond and compare then is_cond=true if cond=="<" then cond_applies=train.velocity<tonumber(compare) end if cond==">" then cond_applies=train.velocity>tonumber(compare) end if cond=="<=" then cond_applies=train.velocity<=tonumber(compare) end if cond==">=" then cond_applies=train.velocity>=tonumber(compare) end end end if is_cond then atprint("Evaluating if statement: "..command) atprint("Cond: "..(cond or "nil")) atprint("Applies: "..(cond_applies and "true" or "false")) atprint("Rest: "..rest) --find end of conditional statement local nest, pos, elsepos=0, 1 while nest>=0 do if pos>#rest then atwarn(sid(id), attrans("ATC command syntax error: I statement not closed: @1",command)) atc.train_reset_command(train) return end local char=string.sub(rest, pos, pos) if char=="I" then nest=nest+1 end if char==";" then nest=nest-1 end if nest==0 and char=="E" then elsepos=pos+0 end pos=pos+1 end if not elsepos then elsepos=pos-1 end if cond_applies then command=string.sub(rest, 1, elsepos-1)..string.sub(rest, pos) else command=string.sub(rest, elsepos+1, pos-2)..string.sub(rest, pos) end atprint("Result: "..command) train.atc_command=command atc.execute_atc_command(id, train) return else for pattern, func in pairs(matchptn) do local match=string.match(command, "^"..pattern) if match then local patlen=func(id, train, match) atprint("Executing: "..string.sub(command, 1, patlen)) train.atc_command=string.sub(command, patlen+1) if train.atc_delay<=0 and not train.atc_wait_finish then --continue (recursive, cmds shouldn't get too long, and it's a end-recursion.) atc.execute_atc_command(id, train) end return end end end atwarn(sid(id), attrans("ATC command parse error: Unknown command: @1", command)) atc.train_reset_command(train) end --move table to desired place advtrains.atc=atc