Commit c284eecb authored by ZwerOxotnik's avatar ZwerOxotnik 🖋

Init

parents
# OS #
######
.DS_Store
# Git #
#######
*.orig
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Node & Bower & JSPM #
#######################
node_modules
bower_components
jspm_packages
# NetBeans specific #
#####################
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
nbactions.xml
nb-configuration.xml
# KomodoEdit #
##############
*.komodoproject
.komodotools
# Cloud9 #
##########
.c9revisions
.c9
# Notepad++ backups #
#####################
*.bak
# Linux #
#########
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# Node #
########
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# Visual studio directories
.vscode
# Contributing
## About translation
Please note the mod is in the process of being internationalized.
## Coding conventions
We optimize for readability:
* We indent using tabs, however spaces are also acceptable
* Read [a note about Git commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
* Each branch is divided into versions of the game Factorio x.x (e.g., 0.17)
## Found an Issue?
Please report any issues or a mistake in the documentation, you can help us by
[submitting an issue](https://gitlab.com/ZwerOxotnik/event-listener/issues) to our GitLab Repository or on [mods.factorio.com](https://mods.factorio.com/mod/event-listener/discussion).
## Want a Feature?
You can *request* a new feature by [submitting an issue](https://gitlab.com/ZwerOxotnik/event-listener/issues) to our GitLab
Repository or on [mods.factorio.com](https://mods.factorio.com/mod/event-listener/discussion).
## Prerequisites
We recommend several tools build the mod, including:
* [Git](https://git-scm.com) — distributed version control system
* [jq](https://stedolan.github.io/jq/) — command-line JSON processor
## Extensions
If you are using [Visual Studio code](https://code.visualstudio.com), we recommend:
* [Lua](https://marketplace.visualstudio.com/items?itemName=keyring.Lua)
* [vscode-lua](https://marketplace.visualstudio.com/items?itemName=trixnz.vscode-lua)
* [Factorio Lua API autocomplete](https://marketplace.visualstudio.com/items?itemName=svizzini.factorio-lua-api-autocomplete)
* [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight)
* [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
* [Guides](https://marketplace.visualstudio.com/items?itemName=spywhere.guides)
### For others text editors:
* For Vim, [Syntastic](https://github.com/vim-syntastic/syntastic) contains [luacheck checker](https://github.com/vim-syntastic/syntastic/wiki/Lua%3A---luacheck);
* For Sublime Text 3 there is [SublimeLinter-luacheck](https://packagecontrol.io/packages/SublimeLinter-luacheck) which requires [SublimeLinter](https://sublimelinter.readthedocs.io/en/latest/);
* For Atom there is [linter-luacheck](https://atom.io/packages/linter-luacheck) which requires [AtomLinter](https://github.com/steelbrain/linter);
* For Emacs, [Flycheck](http://www.flycheck.org/en/latest/) contains [luacheck checker](http://www.flycheck.org/en/latest/languages.html#lua);
* For Brackets, there is [linter.luacheck](https://github.com/Malcolm3141/brackets-luacheck) extension;
This diff is collapsed.
# Teams
Read this in another language | [English](/README.md) | [Русский](/docs/ru/README.md)
|---|---|---|
## Quick Links
[Changelog](/changelog.txt) | [Contributing](CONTRIBUTING.md)
| --- | --- |
## Contents
* [Overview](#overview)
* [Versions](#versions)
* [Issues](#issue)
* [Features](#feature)
* [Installing](#installing)
* [License](#license)
## Overview
Adds "/create_team" command for creating new team in which you will be
## <a name="issue"></a> Found an Issue?
Please report any issues or a mistake in the documentation, you can help us by
[submitting an issue](https://gitlab.com/ZwerOxotnik/teams/issues) to our GitLab Repository or on [mods.factorio.com](https://mods.factorio.com/mod/teams/discussion).
## <a name="feature"></a> Want a Feature?
You can *request* a new feature by [submitting an issue](https://gitlab.com/ZwerOxotnik/teams/issues) to our GitLab
Repository or on [mods.factorio.com](https://mods.factorio.com/mod/teams/discussion).
## Installing
If you have downloaded a zip archive:
* simply place it in your mods directory.
For more information, see [Installing Mods on the Factorio wiki](https://wiki.factorio.com/index.php?title=Installing_Mods).
If you have downloaded the source archive (GitLab):
* copy the mod directory into your factorio mods directory
* rename the mod directory to teams_*versionnumber*, where *versionnumber* is the version of the mod that you've downloaded (e.g., 1.0.0)
## License
This project is copyright © 2019 ZwerOxotnik \<zweroxotnik@gmail.com\>.
Use of the source code included here is governed by the Apache License, Version 2.0. See the [LICENSE](/LICENSE) file for details.
[homepage]: http://mods.factorio.com/mod/teams
[Factorio]: https://factorio.com/
---------------------------------------------------------------------------------------------------
Version: 1.0.5
Date: 2019-07-07
Notes:
- This release for 1.0
---------------------------------------------------------------------------------------------------
Version: 1.0.4
Date: 2019-07-07
Notes:
- This release for 0.17
---------------------------------------------------------------------------------------------------
Version: 1.0.3
Date: 2019-07-07
Notes:
- This release for 0.16
---------------------------------------------------------------------------------------------------
Version: 1.0.1
Date: 2019-07-07
Notes:
- This release for 0.15
---------------------------------------------------------------------------------------------------
Version: 1.0.0
Date: 2019-07-07
Notes:
- This release for 0.14
require("teams")
\ No newline at end of file
# Руководство контрибьютора
## О переводе
Пожалуйста, обратите внимание, что мод находится в процессе интернационализации.
## Соглашения о кодировании
Мы оптимизируем для удобочитаемости:
* Мы делаем отступ, используя табуляцию, однако пробелами тоже приемлемо
* Прочитайте [заметка о сообщениях Git commit](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
* Каждая ветка делится на версии игры Factorio x.x (например, 0.17)
## <a name="issue"></a> Нашли ошибку?
Пожалуйста, сообщайте о любых проблемах или ошибках в документации, вы можете помочь нам
[submitting an issue](https://gitlab.com/ZwerOxotnik/event-listener/issues) на нашем GitLab репозитории или сообщите на [mods.factorio.com](https://mods.factorio.com/mod/event-listener/discussion).
## <a name="feature"></a> Хотите новую функцию?
Вы можете *запросить* новую функцию [submitting an issue](https://gitlab.com/ZwerOxotnik/event-listener/issues) на нашем GitLab репозитории или сообщите на [mods.factorio.com](https://mods.factorio.com/mod/event-listener/discussion).
## Предпосылки
Мы рекомендуем несколько инструментов, чтобы собрать мод, включая:
* [Git](https://git-scm.com) — распределённая система управления версиями
* [jq](https://stedolan.github.io/jq/) — процессор командной строки JSON
## Расширения
Если вы используйте [Visual Studio code](https://code.visualstudio.com), мы рекомендуем:
* [Lua](https://marketplace.visualstudio.com/items?itemName=keyring.Lua)
* [vscode-lua](https://marketplace.visualstudio.com/items?itemName=trixnz.vscode-lua)
* [Factorio Lua API autocomplete](https://marketplace.visualstudio.com/items?itemName=svizzini.factorio-lua-api-autocomplete)
* [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight)
* [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
* [Guides](https://marketplace.visualstudio.com/items?itemName=spywhere.guides)
### Для других текстовых редакторов:
* Для Vim, [Syntastic](https://github.com/vim-syntastic/syntastic) содержит [luacheck checker](https://github.com/vim-syntastic/syntastic/wiki/Lua%3A---luacheck);
* Для Sublime Text 3 есть [SublimeLinter-luacheck](https://packagecontrol.io/packages/SublimeLinter-luacheck), который требует [SublimeLinter](https://sublimelinter.readthedocs.io/en/latest/);
* Для Atom есть [linter-luacheck](https://atom.io/packages/linter-luacheck), который требует [AtomLinter](https://github.com/steelbrain/linter);
* Для Emacs, [Flycheck](http://www.flycheck.org/en/latest/) содержит [luacheck checker](http://www.flycheck.org/en/latest/languages.html#lua);
* Для Brackets, есть [linter.luacheck](https://github.com/Malcolm3141/brackets-luacheck) расширение;
# Команды
Хотите прочитать на другом языке? | [English](/README.md) | [Русский](/docs/ru/README.md)
|---|---|---|
## Быстрые ссылки
[Список изменений](/changelog.txt) | [Руководство контрибьютора](CONTRIBUTING.md)
| --- | --- |
## Содержание
* [Введение](#overview)
* [Версии](#versions)
* [Сообщить об ошибки](#issue)
* [Запросить функцию](#feature)
* [Установка](#installing)
* [Лицензия](#license)
## <a name="overview"></a> Введение
Добавляет "/create_team" команду для создания команды в которой ты будешь
## <a name="issue"></a> Нашли ошибку?
Пожалуйста, сообщайте о любых проблемах или ошибках в документации, вы можете помочь нам
[submitting an issue](https://gitlab.com/ZwerOxotnik/teams/issues) на нашем GitLab репозитории или сообщите на [mods.factorio.com](https://mods.factorio.com/mod/teams/discussion).
## <a name="feature"></a> Хотите новую функцию?
Вы можете *запросить* новую функцию [submitting an issue](https://gitlab.com/ZwerOxotnik/teams/issues) на нашем GitLab репозитории или сообщите на [mods.factorio.com](https://mods.factorio.com/mod/teams/discussion).
## <a name="installing"></a> Установка
Если вы скачали zip архив:
* просто поместите его в директорию модов.
Для большей информации, смотрите [вики Factorio "загрузка и установка модов"](https://wiki.factorio.com/Modding/ru#.D0.97.D0.B0.D0.B3.D1.80.D1.83.D0.B7.D0.BA.D0.B0_.D0.B8_.D1.83.D1.81.D1.82.D0.B0.D0.BD.D0.BE.D0.B2.D0.BA.D0.B0_.D0.BC.D0.BE.D0.B4.D0.BE.D0.B2).
если вы скачали исходный архив (GitLab):
* скопируйте данный мод в директорию модов Factorio
* переименуйте данный мод в teams_*версия*, где *версия* это версия мода, которую вы скачали (например, 1.0.0)
## <a name="license"></a> Лицензия
Этот проект защищен авторским правом © 2019 ZwerOxotnik \<zweroxotnik@gmail.com\>.
Использование исходного кода, включенного здесь, регламентируется Apache License, Version 2.0. Смотрите [LICENSE](/LICENSE) файл для разбора.
[homepage]: http://mods.factorio.com/mod/teams
[Factorio]: https://factorio.com/
{
"name": "teams",
"version": "1.0.0",
"factorio_version": "0.17",
"title": "Nickname changer",
"author": "ZwerOxotnik",
"contact": "zweroxotnik@gmail.com, Discord:ZwerOxotnik#7117",
"source": "https://github.com/ZwerOxotnik/teams",
"homepage": "https://forums.factorio.com/viewtopic.php?f=190&t=73013",
"description": "Adds \"/create_team\" command for creating new team in which you will be.",
"dependencies": []
}
[mod-name]
teams=Teams
[mod-description]
teams=Adds "/create_team" command for creating new team in which you will be.
[teams]
create_team=<name> - creates new team.
double_team=Team named "__1__" already exists.
too_many=Too many teams, sorry.
\ No newline at end of file
[mod-name]
teams=Команды
[mod-description]
teams=Добавляет "/create_team" команду для создания команды в которой ты будешь.
[teams]
create_team=<название> - создаёт новую команду.
double_team=Команда с названием "__1__" уже существует.
too_many=Слишком много команд, извини.
\ No newline at end of file
--[[
Copyright 2019 ZwerOxotnik <zweroxotnik@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]--
-- You can write and receive any information on the links below.
-- Source: https://github.com/ZwerOxotnik/teams
-- Mod portal: https://mods.factorio.com/mod/teams
-- Homepage: https://forums.factorio.com/viewtopic.php?f=190&t=73013
local prohibited_forces = {neutral = true, player = true, enemy = true}
local function create_new_team(cmd)
if cmd.player_index == nil then return end
local player = game.players[cmd.player_index]
if #game.forces >= 60 then player.print({"teams.too_many"}) return end -- for compability with other mods/scenarios and forces count max = 64 (https://lua-api.factorio.com/0.17.54/LuaGameScript.html#LuaGameScript.create_force)
if cmd.parameter == nil then player.print({"teams.create_team"}) return end
if game.forces[cmd.parameter] then
player.print({"teams.double_team", cmd.parameter})
else
local new_team = game.create_force(cmd.parameter)
if #player.force.players == 1 and not prohibited_forces[player.force.name] then
game.merge_forces(player.force, new_team)
else
player.force = new_team
end
end
end
commands.add_command("create_team", {"teams.create_team"}, create_new_team)
return module
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment