1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93/* Minetest Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr> 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. */ #pragma once #include <unordered_map> #include <string> #include <vector> #include <memory> #include "network/networkprotocol.h" #include "irrlichttypes.h" enum ModChannelState : u8 { MODCHANNEL_STATE_INIT, MODCHANNEL_STATE_READ_WRITE, MODCHANNEL_STATE_READ_ONLY, MODCHANNEL_STATE_MAX, }; class ModChannel { public: ModChannel(const std::string &name) : m_name(name) {} ~ModChannel() = default; const std::string &getName() const { return m_name; } bool registerConsumer(session_t peer_id); bool removeConsumer(session_t peer_id); const std::vector<u16> &getChannelPeers() const { return m_client_consumers; } bool canWrite() const; void setState(ModChannelState state); private: std::string m_name; ModChannelState m_state = MODCHANNEL_STATE_INIT; std::vector<u16> m_client_consumers; }; enum ModChannelSignal : u8 { MODCHANNEL_SIGNAL_JOIN_OK, MODCHANNEL_SIGNAL_JOIN_FAILURE, MODCHANNEL_SIGNAL_LEAVE_OK, MODCHANNEL_SIGNAL_LEAVE_FAILURE, MODCHANNEL_SIGNAL_CHANNEL_NOT_REGISTERED, MODCHANNEL_SIGNAL_SET_STATE, }; class ModChannelMgr { public: ModChannelMgr() = default; ~ModChannelMgr() = default; void registerChannMinetest Texture Pack Reference =============================== Texture packs allow you to replace textures provided by a mod with your own textures. Texture pack directory structure -------------------------------- textures |-- Texture Pack | |-- texture_pack.conf | |-- screenshot.png | |-- description.txt | |-- override.txt | |-- your_texture_1.png | |-- your_texture_2.png `-- Another Texture Pack ### Texture Pack This is a directory containing the entire contents of a single texture pack. It can be chosen more or less freely and will also become the name of the texture pack. The name must not be “base”. ### `texture_pack.conf` A key-value config file with the following keys: * `title` - human readable title * `description` - short description, shown in the content tab ### `description.txt` **Deprecated**, you should use texture_pack.conf instead. A file containing a short description of the texture pack to be shown in the content tab. ### `screenshot.png` A preview image showing an in-game screenshot of this texture pack; it will be shown in the texture packs tab. It should have an aspect ratio of 3:2 and a minimum size of 300×200 pixels. ### `your_texture_1.png`, `your_texture_2.png`, etc. Any other PNG files will be interpreted as textures. They must have the same names as the textures they are supposed to override. For example, to override the apple texture of Minetest Game, add a PNG file named `default_apple.png`. The custom textures do not necceessarily require the same size as their originals, but this might be required for a few particular textures. When unsure, just test your texture pack in-game. Texture modifiers ----------------- See lua_api.txt for texture modifiers Special textures ---------------- These texture names are hardcoded into the engine but can also be overwritten by texture packs. All existing fallback textures can be found in the directory `textures/base/pack`. ### Gameplay textures * `bubble.png`: the bubble texture when the player is drowning (default size: 12×12) * `bubble_gone.png`: like `bubble.png`, but denotes lack of breath (transparent by default, same size as bubble.png) * `crack_anylength.png`: node overlay texture when digging * `crosshair.png` * the crosshair texture in the center of the screen. The settings `crosshair_color` and `crosshair_alpha` are used to create a cross when no texture is found. * `object_crosshair.png` * the crosshair seen when pointing at an object. The settings `crosshair_color` and `crosshair_alpha` are used to create a cross when no texture is found. * `halo.png`: used for the node highlighting mesh * `heart.png`: used to display the health points of the player (default size: 12×12) * `heart_gone.png`: like `heart.png`, but denotes lack of health points (transparent by default, same size as heart.png) * `minimap_mask_round.png`: round minimap mask, white gets replaced by the map * `minimap_mask_square.png`: mask used for the square minimap * `minimap_overlay_round.png`: overlay texture for the round minimap * `minimap_overlay_square.png`: overlay texture for the square minimap * `object_marker_red.png`: texture for players on the minimap * `player_marker.png`: texture for the own player on the square minimap * `no_texture_airlike.png`: fallb std::unordered_map<std::string, std::unique_ptr<ModChannel>> m_registered_channels; }; |