HGK Posted April 30, 2015 Share Posted April 30, 2015 Приветствую, хотел бы выровнять столбцы в playersPanel. Вот как выглядит сейчас у меня: Pic Code { "enemySpottedMarker": { "alpha": 100, "x": -7, "y": 5, "bindToIcon": true, "format": "{{spotted}}", "shadow": {} }, "xTE": { "x": 0, "y": 2, "format": "<font size='13' alpha='{{alive?#FF|#80}}' color='#FFFFFF'>[<font face='Liberation Mono' color='{{c:xte}}'>{{xte%2s|--}}</font>]</font>", "shadow": {} }, "frags": { "x": -92, "y": 2, "align": "center", "bindToIcon": true, "format": "<font size='13' alpha='{{player?#FF|{{alive?#FF|#80}}}}' color='{{player?#FDC25A|#FFFFFF}}'>{{frags}}</font>", "shadow": {} }, "medium2": { "formatLeft": "{{name%10.10s~.}} - <font color='{{c:rating}}'>{{rating%2d~%|--%}}</font> - <font color='{{c:kb}}'>{{kb%2d~k|--k}}</font> WN8 - <font color='{{c:xwn}}'>{{wn8%4d|----}}</font> PR - <font color='{{c:xeff}}'>{{eff%4d|----}}</font>", "formatRight": "{{name%10.10s~.}} - <font color='{{c:rating}}'>{{rating%2d~%|--%}}</font> - <font color='{{c:kb}}'>{{kb%2d~k|--k}}</font> WN8 - <font color='{{c:xwn}}'>{{wn8%4d|----}}</font> PR - <font color='{{c:xeff}}'>{{eff%4d|----}}</font>", "width": 295, "fragsFormatLeft": "", "fragsFormatRight": "", "extraFieldsLeft": [ ${"frags"}, ${"xTE"} ], "extraFieldsRight": [ ${"enemySpottedMarker"}, ${"frags"}, ${"xTE"} ] }, ... А хотел бы сделать, что бы столбцы были ровные: Как я понял, это можно сделать только с помощью tabstops. Я пытался вставлять <tab> в разные места, менять значения отступа, в итоге, у меня толком ничего не получается. Поэтому прошу помощи, подскажите пожалуйста, как хоть примерно должна выглядеть структура кода, что бы выглядело красиво? @ Quote Link to comment Short link Share on other sites More sharing options...
TurinDeNar Posted April 30, 2015 Share Posted April 30, 2015 (edited) Приветствую, хотел бы выровнять столбцы в playersPanel. Вот как выглядит сейчас у меня: Pic Code { "enemySpottedMarker": { "alpha": 100, "x": -7, "y": 5, "bindToIcon": true, "format": "{{spotted}}", "shadow": {} }, "xTE": { "x": 0, "y": 2, "format": "<font size='13' alpha='{{alive?#FF|#80}}' color='#FFFFFF'>[<font face='Liberation Mono' color='{{c:xte}}'>{{xte%2s|--}}</font>]</font>", "shadow": {} }, "frags": { "x": -92, "y": 2, "align": "center", "bindToIcon": true, "format": "<font size='13' alpha='{{player?#FF|{{alive?#FF|#80}}}}' color='{{player?#FDC25A|#FFFFFF}}'>{{frags}}</font>", "shadow": {} }, "medium2": { "formatLeft": "{{name%10.10s~.}} - <font color='{{c:rating}}'>{{rating%2d~%|--%}}</font> - <font color='{{c:kb}}'>{{kb%2d~k|--k}}</font> WN8 - <font color='{{c:xwn}}'>{{wn8%4d|----}}</font> PR - <font color='{{c:xeff}}'>{{eff%4d|----}}</font>", "formatRight": "{{name%10.10s~.}} - <font color='{{c:rating}}'>{{rating%2d~%|--%}}</font> - <font color='{{c:kb}}'>{{kb%2d~k|--k}}</font> WN8 - <font color='{{c:xwn}}'>{{wn8%4d|----}}</font> PR - <font color='{{c:xeff}}'>{{eff%4d|----}}</font>", "width": 295, "fragsFormatLeft": "", "fragsFormatRight": "", "extraFieldsLeft": [ ${"frags"}, ${"xTE"} ], "extraFieldsRight": [ ${"enemySpottedMarker"}, ${"frags"}, ${"xTE"} ] }, ... А хотел бы сделать, что бы столбцы были ровные: Как я понял, это можно сделать только с помощью tabstops. Я пытался вставлять <tab> в разные места, менять значения отступа, в итоге, у меня толком ничего не получается. Поэтому прошу помощи, подскажите пожалуйста, как хоть примерно должна выглядеть структура кода, что бы выглядело красиво? Возможно здесь может помочь использование моноширинного шрифта.... Код будет такого типа. { "enemySpottedMarker": { "alpha": 100, "x": -7, "y": 5, "bindToIcon": true, "format": "{{spotted}}", "shadow": {} }, "xTE": { "x": 0, "y": 2, "format": "<font face='mono' size='13' alpha='{{alive?#FF|#80}}' color='#FFFFFF'>[<font face='Liberation Mono' color='{{c:xte}}'>{{xte%2s|--}}</font>]</font>", "shadow": {} }, "frags": { "x": -92, "y": 2, "align": "center", "bindToIcon": true, "format": "<font face='mono' size='13' alpha='{{player?#FF|{{alive?#FF|#80}}}}' color='{{player?#FDC25A|#FFFFFF}}'>{{frags}}</font>", "shadow": {} }, "medium2": { "formatLeft": "<font face='mono' size='13'> {{name%10.10s~.}} - <font color='{{c:rating}}'>{{rating%2d~%|--%}}</font> - <font color='{{c:kb}}'>{{kb%2d~k|--k}}</font> WN8 - <font color='{{c:xwn}}'>{{wn8%4d|----}}</font> PR - <font color='{{c:xeff}}'>{{eff%4d|----}}</font></font>",", "formatRight": "<font face='mono' size='13'>{{name%10.10s~.}} - <font color='{{c:rating}}'>{{rating%2d~%|--%}}</font> - <font color='{{c:kb}}'>{{kb%2d~k|--k}}</font> WN8 - <font color='{{c:xwn}}'>{{wn8%4d|----}}</font> PR - <font color='{{c:xeff}}'>{{eff%4d|----}}</font></font>",", "width": 295, "fragsFormatLeft": "", "fragsFormatRight": "", "extraFieldsLeft": [ ${"frags"}, ${"xTE"} ], "extraFieldsRight": [ ${"enemySpottedMarker"}, ${"frags"}, ${"xTE"} ] }, ... Должно заработать, если я нигде не накосячил - проверить не на чем:) Edited April 30, 2015 by TurinDeNar 1 @ Quote Link to comment Short link Share on other sites More sharing options...
TornadoCat Posted April 30, 2015 Share Posted April 30, 2015 @HGK, чётко вы мой кусок кода спионерили )Дело в том, что tabstops для определённой ширины с запасом подгоняются, чуть шире - и по ЖПП пойдёт . Там долго надо голову сушить . 1 @ 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.