aboutsummaryrefslogtreecommitdiff
path: root/src/guiTextInputMenu.cpp
Commit message (Collapse)AuthorAge
* Fix win32/msvc i18n (quite UGLY version, blame Microsoft)sapier2013-11-11
|
* Make freetype usage configureable by a settingPilzAdam2013-08-04
|
* Fix editbox default text being pre-selected in some casesMetaDucky2013-06-01
|
* fix memory leaks introduced by invalid gettext usagesapier2013-04-07
|
* Update Copyright YearsSfan52013-02-24
|
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
|
* Add Freetype supportIlya Zhuravlev2013-02-14
|
* Switch the license to be LGPLv2/later, with small parts still remaining as ↵Perttu Ahola2012-06-05
| | | | GPLv2/later, by agreement of major contributors
* Header file tweaking; mainly for speedPerttu Ahola2011-10-12
|
* Send KEY_END when (re)creating a text inputGiuseppe Bilotta2011-08-22
| | | | | This ensures that on creation and when resizing the cursor is at the end of the text rather than at the beginnig.
* Use wgettextGiuseppe Bilotta2011-08-02
|
* set locales to C because en_US not installed on some systems, only UTF-8 ↵Constantin Wenger2011-07-30
| | | | version and en_US.UTF-8 does not work.
* fixed displaying "umlauts" (deutsch umlaute) and hopefully other non ASCII ↵Constantin Wenger2011-07-30
| | | | chars, too
* changed some lines to fit the 80chars limitConstantin Wenger2011-07-22
|
* added gettext supportConstantin Wenger2011-07-20
| | | | german translation file and bashscript to update translations
* bug-fixin'Perttu Ahola2011-02-08
|
* OMG! Main Menu!Perttu Ahola2011-01-23
|
* changes to handing of digging (non backwards-compatible i guess)Perttu Ahola2010-12-23
|
* little tinkeringPerttu Ahola2010-12-23
|
* work-in-progress gui system updating + some settings system updatingPerttu Ahola2010-12-23
ss="hl kwc">ScriptApiClient::on_mods_loaded() { SCRIPTAPI_PRECHECKHEADER // Get registered shutdown hooks lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_mods_loaded"); // Call callbacks runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } void ScriptApiClient::on_shutdown() { SCRIPTAPI_PRECHECKHEADER // Get registered shutdown hooks lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_shutdown"); // Call callbacks runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } bool ScriptApiClient::on_sending_message(const std::string &message) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_sending_chat_message"); // Call callbacks lua_pushstring(L, message.c_str()); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); return readParam<bool>(L, -1); } bool ScriptApiClient::on_receiving_message(const std::string &message) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_receiving_chat_message"); // Call callbacks lua_pushstring(L, message.c_str()); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); return readParam<bool>(L, -1); } void ScriptApiClient::on_damage_taken(int32_t damage_amount) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_damage_taken"); // Call callbacks lua_pushinteger(L, damage_amount); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); } void ScriptApiClient::on_hp_modification(int32_t newhp) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_hp_modification"); // Call callbacks lua_pushinteger(L, newhp); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); } void ScriptApiClient::on_death() { SCRIPTAPI_PRECHECKHEADER // Get registered shutdown hooks lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_death"); // Call callbacks runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } void ScriptApiClient::environment_step(float dtime) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_globalsteps lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_globalsteps"); // Call callbacks lua_pushnumber(L, dtime); try { runCallbacks(1, RUN_CALLBACKS_MODE_FIRST); } catch (LuaError &e) { getClient()->setFatalError(std::string("Client environment_step: ") + e.what() + "\n" + script_get_backtrace(L)); } } void ScriptApiClient::on_formspec_input(const std::string &formname, const StringMap &fields) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_formspec_input"); // Call callbacks // param 1 lua_pushstring(L, formname.c_str()); // param 2 lua_newtable(L); StringMap::const_iterator it; for (it = fields.begin(); it != fields.end(); ++it) { const std::string &name = it->first; const std::string &value = it->second; lua_pushstring(L, name.c_str()); lua_pushlstring(L, value.c_str(), value.size()); lua_settable(L, -3); } runCallbacks(2, RUN_CALLBACKS_MODE_OR_SC); } bool ScriptApiClient::on_dignode(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER const NodeDefManager *ndef = getClient()->ndef(); // Get core.registered_on_dignode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_dignode"); // Push data push_v3s16(L, p); pushnode(L, node, ndef); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return lua_toboolean(L, -1); } bool ScriptApiClient::on_punchnode(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER const NodeDefManager *ndef = getClient()->ndef(); // Get core.registered_on_punchgnode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_punchnode"); // Push data push_v3s16(L, p); pushnode(L, node, ndef); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_placenode(const PointedThing &pointed, const ItemDefinition &item) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_placenode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_placenode"); // Push data push_pointed_thing(L, pointed, true); push_item_definition(L, item); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_item_use(const ItemStack &item, const PointedThing &pointed) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_item_use lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_item_use"); // Push data LuaItemStack::create(L, item); push_pointed_thing(L, pointed, true); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_inventory_open(Inventory *inventory) { SCRIPTAPI_PRECHECKHEADER lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_inventory_open"); std::vector<const InventoryList*> lists = inventory->getLists(); std::vector<const InventoryList*>::iterator iter = lists.begin(); lua_createtable(L, 0, lists.size()); for (; iter != lists.end(); iter++) { const char* name = (*iter)->getName().c_str(); lua_pushstring(L, name); push_inventory_list(L, inventory, name); lua_rawset(L, -3); } runCallbacks(1, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } void ScriptApiClient::setEnv(ClientEnvironment *env) { ScriptApiBase::setEnv(env); }