From d2770c8b33fbae2a364535de3678c503c87b37f8 Mon Sep 17 00:00:00 2001 From: Andrey Stepanov Date: Sun, 10 Nov 2024 23:43:41 +0500 Subject: [PATCH] create mod --- LICENSE | 21 +++++++++++++++++++++ README.md | 4 ++++ README.ru.md | 5 +++++ init.lua | 32 ++++++++++++++++++++++++++++++++ mod.conf | 3 +++ 5 files changed, 65 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 README.ru.md create mode 100644 init.lua create mode 100644 mod.conf diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c7466d6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Andrey Stepanov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9458a6e --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# soft_filter_mode + +This mod is designed to switch the filter mod into soft mode. In soft mode, +no one will be muted or kicked. Only warning form will be shown. \ No newline at end of file diff --git a/README.ru.md b/README.ru.md new file mode 100644 index 0000000..d238c5e --- /dev/null +++ b/README.ru.md @@ -0,0 +1,5 @@ +# soft_filter_mode + +Этот мод переводит мод filter в "мягкий" режим. В этом режиме никто +не будет кикнут и не получит мут. Будет отображаться только окно +с предупреждением. \ No newline at end of file diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..3d8b1f2 --- /dev/null +++ b/init.lua @@ -0,0 +1,32 @@ +--[[ + + Copyright 2024 Andrey Stepanov + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject + to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +]]-- + + +function soft_resolution(name, message, violations) + filter.show_warning_formspec(name) + return true +end + +filter.register_on_violation(soft_resolution) \ No newline at end of file diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..fcb26c9 --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = soft_filter_mode +description = Soft mode for filter mod +depends = filter \ No newline at end of file