ktulho Posted April 29, 2019 Author Share Posted April 29, 2019 6 минут назад, Sergei Nik сказал: что бы названия карты окрашивалось в цвета,допустим летний-зелёный,пустынный-жёлтый,зимний-белый. Есть макрос: {{py:map.kind}} - возвращает 'summer', если карта летняя, 'winter' - зимняя, 'desert' - пустынная. @ Quote Link to comment Short link Share on other sites More sharing options...
Sergei Nik Posted April 29, 2019 Share Posted April 29, 2019 @ktulho ,а как прописать правильно,допустим название карты "МАЛИНОВКА"-это летняя карта,чтобы надпись "МАЛИНОВКА" выводилась зелёным цветом,а допустим "ЕРЛЕНБЕРГ"-зимняя карта,чтобы выводилась надпись белым цветом и также для пустынных карт выводилась жёлтым цветом. @ Quote Link to comment Short link Share on other sites More sharing options...
ktulho Posted April 29, 2019 Author Share Posted April 29, 2019 @Sergei Nik "format": "<font size='12' color='{{py:map.kind=summer?#FF0000|{{py:map.kind=winter?#FFFFFF|#00FFFF}}}}'>{{py:map.localeName}}</font>" 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Sergei Nik Posted April 29, 2019 Share Posted April 29, 2019 @ktulho спасибо вам огромное. @ Quote Link to comment Short link Share on other sites More sharing options...
ktulho Posted May 3, 2019 Author Share Posted May 3, 2019 Обновил в шапке: Скрипт аддона Маркер над своим танком Скрипт аддона Premium аккаунт 2 @ Quote Link to comment Short link Share on other sites More sharing options...
ddar Posted May 3, 2019 Share Posted May 3, 2019 (edited) @ktulho как понять, почему у меня нет маркера над своим танком, если в логе про это вроде ничего? У меня в конфиге число 0.75, которое указано в ошибках в логе, встречается в единственной строчке "alpha": "{{ally?0|{{py:mul({{py:sight.damageShell}},0.75)>{{hp}}?100|0}}}}", xvm.log python.log Edited May 3, 2019 by ddar @ Quote Link to comment Short link Share on other sites More sharing options...
ktulho Posted May 3, 2019 Author Share Posted May 3, 2019 53 минуты назад, ddar сказал: как понять, почему у меня нет маркера над своим танком, если в логе про это вроде ничего? Исправил, обновил в шапке скрипт playerMarker.py 54 минуты назад, ddar сказал: У меня в конфиге число 0.75, которое указано в ошибках в логе, встречается в единственной строчке Покажите все поле. @ Quote Link to comment Short link Share on other sites More sharing options...
ddar Posted May 3, 2019 Share Posted May 3, 2019 @ktulho markers.xc: "alphaHP": { "x": 0, "y": -110, "width": 90, "height": 90, "alpha": "{{ally?0|{{py:mul({{py:sight.damageShell}},0.75)>{{hp}}?100|0}}}}", "format": "<img src='cfg://dar/img/lowhp.png'>" }, minimapLabelsTemplates.xc: "lowHp": { "x": 1, "y": 1, "width": 30, "height": 30, "align": "center", "valign": "center", "layer": "bottom", "alpha": "{{ally?0|{{hp?{{py:mul({{py:sight.damageShell}},0.75)>{{hp}}?100|0}}|0}}}}", "flags": [ "ally", "enemy", "squadman", "teamKiller", "spotted", "alive" ], "format": "<img src='cfg://dar/img/minimap/lowHp.png' width='24' height='24'>" }, @ Quote Link to comment Short link Share on other sites More sharing options...
ktulho Posted May 3, 2019 Author Share Posted May 3, 2019 (edited) @ddar Ну, макрос предназначен для использования в battleLabels, в других местах, как говорится, гарантий, что он будет работать нет. Чтобы не было ошибок в логах, пишите: "alpha": "{{py:sight.damageShell?{{ally?0|{{hp?{{py:mul({{py:sight.damageShell}},0.75)>{{hp}}?100|0}}|0}}}}|0}}", Edited May 3, 2019 by ktulho @ Quote Link to comment Short link Share on other sites More sharing options...
ddar Posted May 3, 2019 Share Posted May 3, 2019 @ktulho ошибок не будет, но и работать он не будет ) В прошлой версии, кстати, работал и в маркерах, и на миникарте. @ Quote Link to comment Short link Share on other sites More sharing options...
ktulho Posted May 3, 2019 Author Share Posted May 3, 2019 4 минуты назад, ddar сказал: ошибок не будет, но и работать он не будет ) В прошлой версии, кстати, работал и в маркерах, и на миникарте. Это не ко мне. @ Quote Link to comment Short link Share on other sites More sharing options...
ddar Posted May 3, 2019 Share Posted May 3, 2019 @ktulho Спасибо @ Quote Link to comment Short link Share on other sites More sharing options...
skitey Posted May 4, 2019 Share Posted May 4, 2019 Hello, hope somebody can help me with maps.py. I want to show mapname on minimap near mapsize..but it does not work :( please help in minimap.xc: // Map size label // Поле размера карты "mapSize": ${"minimapMapSize.xc":"mapSize"}, // Map name label // Поле размера карты "mapName": ${"minimapMapName.xc":"mapName"}, in minimapMapName.xc: /** * Textfield for map name. */ { // The settings correspond to the extra fields parameters // Настройки соответствуют параметрам дополнительных полей // {{py: map.nameFile}} - the name of the map file on which the battle takes place. // {{py: map.localeName}} - localized name of the map on which the battle takes place. // {{py: map.kind}} - returns 'summer' if the map is summer, 'winter' - winter, 'desert' - desert. "mapName": { "enabled": true, "x": 10, "y": 0, "alpha": 70, "textFormat": { "font": "Times New Roman", "size": 18, "color": "0xFFCC66", "align": "left", "bold": true, "italic": false }, "format": "<font size='18' color='{{py:map.kind=summer?#FF0000|{{py:map.kind=winter?#FFFFFF|#00FFFF}}}}'>{{py:map.localeName}}</font>", "shadow": { "enabled": true, "color": "0x000000", "alpha": 70, "blur": 2, "strength": 3, "distance": 0, "angle": 0 } } } @ Quote Link to comment Short link Share on other sites More sharing options...
ktulho Posted May 4, 2019 Author Share Posted May 4, 2019 @skitey попробуйте в файле minimapMapSize.xc написать: /** * Textfield for map side size. * Поле размера стороны карты. * * Example: * Например: * 1000 m, 700 m, 600 m. */ { // The settings correspond to the extra fields parameters. // Настройки соответствуют параметрам дополнительных полей. "mapSize": { "enabled": true, "x": 0, "y": 0, "alpha": 70, "textFormat": { "font": "Times New Roman", "size": 10, "color": "0xFFCC66", "align": "left", "bold": true, "italic": false }, "format": "<font size='18' color='{{py:map.kind=summer?#FF0000|{{py:map.kind=winter?#FFFFFF|#00FFFF}}}}'>{{py:map.localeName}}</font> {{cellsize}}0 {{l10n:m}}", "shadow": { "enabled": true, "color": "0x000000", "alpha": 70, "blur": 2, "strength": 3, "distance": 0, "angle": 0 } } } 1 @ Quote Link to comment Short link Share on other sites More sharing options...
skitey Posted May 4, 2019 Share Posted May 4, 2019 (edited) 38 minutes ago, ktulho said: @skitey try to write in minimapMapSize .xc file : , "italic": false }, "format": "<font size='18' color='{{py:map.kind=summer?#FF0000|{{py:map.kind=winter?#FFFFFF|#00FFFF}}}}'>{{py:map.localeName}}</font> {{cellsize}}0 {{l10n:m}}", "shadow": { "enabled": true, "color": "0x000000", "alpha": 70, "blur": 2, "strength": 3, "distance": 0, "angle": 0 } } } nice, it's working :) thx one last question: is it possible to move the mapname a bit up? so it looks like this: Malinovka 1000M Edited May 4, 2019 by skitey @ Quote Link to comment Short link Share on other sites More sharing options...
Slava7572 Posted May 12, 2019 Share Posted May 12, 2019 ktulho,Саш,скажи пожалуйста,скрипт infoPremium.py возможно как то завести в hangar.xc?Есть статистика в ангаре(sessionTime) и рядом инфу по серверу добавлял с помощью оффсетов "serverInfo".Проблема в том,что когда покупаешь премиум,то родные кнопки смещаются,добавил этот скрипт на прием,в виджете sessionTime работает,смещается,а в hangar.xc пока никак,сбрасывается на ноль при такой конструкции(добавил выделенное): "serverInfo": { // Show server info in hangar. // Показывать информацию о сервере в ангаре. "enabled": true, "updateEvent": "PY(ON_INFO_PREMIUM)", // Transparency in percents [0..100]. // Прозрачность в процентах [0..100]. "alpha": 100, // Rotation in degrees [0..360]. // Угол поворота в градусах [0..360]. "rotation": 0, // X offset. // Смещение по оси X. "offsetX": "{{py:prem.timeLeft?580|538}}", @ Quote Link to comment Short link Share on other sites More sharing options...
night_dragon_on Posted May 12, 2019 Share Posted May 12, 2019 (edited) 1 час назад, Slava7572 сказал: пока никак,сбрасывается на ноль В hangar.xc "updateEvent" не поддерживается. Секция "serverInfo" не относится никоим образом к экстраполям. ┌───────────────────┬───┬───┬───┬───┬───┬───┬───────────────────────────────────────────────── │ Параметры: │ BL│ PP│ SF│ MM│ VM│BLb│ Описание: ├───────────────────┼───┼───┼───┼───┼───┼───┼───────────────────────────────────────────────── │ "updateEvent" │ │ │ │ │ │ X │ события по которому обновляется поле, используйте динамические макросы; для отключения используйте значение null или удалите параметр; └───────────────────┴───┴───┴───┴───┴───┴───┴───────────────────────────────────────────────── Я уже не первый раз заостряю внимание на доках (extra-field.txt, extra-field_ru.txt). Помимо этого в конфиге явно указывал места где их можно использовать: extended format supported, see extra-field.txt поддерживается расширенный формат, см. extra-field.txt Для кого все это расписывал, непонятно. Edited May 12, 2019 by night_dragon_on 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Slava7572 Posted May 12, 2019 Share Posted May 12, 2019 53 минуты назад, night_dragon_on сказал: Для кого все это расписывал, непонятно. Ром,не нервничай,наверное нет человека помимо тебя конечно,кто так часто ими пользуется как я.Всего же не упомнишь,опробовал,не вышло,спросил возможно ли такое,на ошибках учатся,особенно такие чайники как я @ Quote Link to comment Short link Share on other sites More sharing options...
night_dragon_on Posted May 12, 2019 Share Posted May 12, 2019 Просто какой смысл добавлять/обновлять документацию если на нее никто не смотрит. Основная цель ее заключается в том чтобы конечный пользователь мог наглядно увидеть что и где можно прописать. Причем не смотрят не только на конкретно упомянутые выше файлы, добавленный @ktulho файл py_macros_ru.txt тоже никто не открывает. Я думаю он с той же целью добавлял его, дать хоть какое нибудь описание для py_macros поставляемых с модом по умолчанию, но все равно в подавляющем большинстве замечаю что в темах задают одни и те же вопросы по ним, что они отдают, откуда подгружается те или иные данные (цвет например), хотя там все расписано. @ Quote Link to comment Short link Share on other sites More sharing options...
arom Posted May 12, 2019 Share Posted May 12, 2019 3 часа назад, night_dragon_on сказал: никто не смотрит не-не-не, не правда это! Всё время с доками сверяюсь, регулярно. Спасибо за труд и разъяснения. Не соскакивайте с этой полезнейшей миссии, пожалуйста. @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.