summaryrefslogtreecommitdiff
path: root/src/chat.cpp
Commit message (Expand)AuthorAge
* Fix last performance-type-promotion-in-math-fn problemsLoic Blot2018-04-04
* Fix many issues reported by clang-tidy (#7189)Loïc Blot2018-04-02
* GameUI refactor (part 5/X): Move Game::guitext_chat to GameUI classLoic Blot2018-01-05
* Chat: Remove prompt history duplicates (#6762)SmallJoker2017-12-14
* don't pass g_settings around, and use it directlyEsteban I. RM2017-10-17
* Implement #6096Esteban I. RM2017-10-17
* Add clientside translations.Ekdohibs2017-08-24
* Modernize source code: last part (#6285)Loïc Blot2017-08-20
* cavegen.cpp, chat.cpp: modernize codeLoic Blot2017-08-16
* C++11 patchset 9: move hardcoded init parameters to class definitions (part 1...Loïc Blot2017-06-16
* chat.cpp fix wchar_t isspace -> iswspace & wrong isspace on an index (#5783)Loïc Blot2017-05-20
* this might fix #5661, needs testing (#5775)red-0012017-05-20
* Various code cleanup & little performance improvement on HTTP download (#5772)Loïc Blot2017-05-20
* Fix various copy instead of const ref reported by cppcheck (#5615)Loïc Blot2017-04-19
* Add colored text (not only colored chat).Ekdohibs2016-05-31
* Colored chat working as expected for both freetype and non-freetype builds. @...TriBlade92016-05-31
* Chat: Keep scroll position constant in ChatBuffer::deleteOldest()Kahrl2016-05-08
* Escape more strings: formspecs, item descriptions, infotexts...Ekdohibs2016-04-24
* Clean up StrfndShadowNinja2016-03-19
* Remove chat escape sequences from chat messages, for future colored chat.Ekdohibs2016-03-15
* Add text selection and copying to consoleShadowNinja2016-03-02
* Use the console instead of a dedicated window when pressing keymap_chat/cmdEsteban I. Ruiz Moreno2016-03-02
* Remove unneccessary space for tab completionNathaniel Olsen2015-06-16
* For usages of assert() that are meant to persist in Release builds (when NDEB...Craig Robbins2015-03-07
* Suppress MSVC warning in chat.cppgregorycu2015-01-25
* Add paste command (Ctrl-V) in GUIChatConsoleKahrl2014-12-10
* Fix typo in comment in chat.cppKahrl2014-09-14
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Fix nick completionPilzAdam2013-04-05
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Properly and efficiently use split utility headersPerttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* Chat console, including a number of rebases and modifications.Kahrl2012-03-10
en if train.velocity>0 then train.tarvelocity = math.max(train.tarvelocity - 1, 0) else train.movedir = -train.movedir end end if pc.left then if train.door_open ~= 0 then train.door_open = 0 else train.door_open = -train.movedir end end if pc.right then if train.door_open ~= 0 then train.door_open = 0 else train.door_open = train.movedir end end if train.brake_hold_state~=2 then train.brake = false end if pc.jump then train.brake = true end if pc.aux1 then --horn end end end function advtrains.update_driver_hud(pname, train, flip) local inside=train.text_inside or "" advtrains.set_trainhud(pname, inside.."\n"..advtrains.hud_train_format(train, flip)) end function advtrains.clear_driver_hud(pname) advtrains.set_trainhud(pname, "") end function advtrains.set_trainhud(name, text) local hud = advtrains.hud[name] local player=minetest.get_player_by_name(name) if not player then return end if not hud then hud = {} advtrains.hud[name] = hud hud.id = player:hud_add({ hud_elem_type = "text", name = "ADVTRAINS", number = 0xFFFFFF, position = {x=0.5, y=0.7}, offset = {x=0, y=0}, text = text, scale = {x=200, y=60}, alignment = {x=0, y=0}, }) hud.oldText=text return elseif hud.oldText ~= text then player:hud_change(hud.id, "text", text) hud.oldText=text end end function advtrains.hud_train_format(train, flip) local fct=flip and -1 or 1 if not train then return "" end local max=train.max_speed or 10 local vel=advtrains.abs_ceil(train.velocity) local tvel=advtrains.abs_ceil(train.tarvelocity) local topLine, firstLine, secondLine topLine=" ["..mletter[fct*train.movedir].."] "..doorstr[(train.door_open or 0) * train.movedir].." "..(train.brake and "="..( train.brake_hold_state==2 and "^" or "" ).."B=" or "") firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", max-vel)..">" secondLine=attrans("Target:").." |"..string.rep("+", tvel)..string.rep("_", max-tvel)..">" return topLine.."\n"..firstLine.."\n"..secondLine end