Jump to content
Korean Random

Помощь с playersPanel


Recommended Posts

Приветствую, хотел бы выровнять столбцы в playersPanel.

Вот как выглядит сейчас у меня:

Pic

Wrs7.jpg

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"}
      ]
    },
...

А хотел бы сделать, что бы столбцы были ровные:

Wrs8.jpg

Как я понял, это можно сделать только с помощью tabstops. Я пытался вставлять <tab> в разные места, менять значения отступа, в итоге, у меня толком ничего не получается.

 

Поэтому прошу помощи, подскажите пожалуйста, как хоть примерно должна выглядеть структура кода, что бы выглядело красиво?

Link to comment
Short link
Share on other sites

Приветствую, хотел бы выровнять столбцы в playersPanel.

Вот как выглядит сейчас у меня:

Pic

Wrs7.jpg

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"}
      ]
    },
...

А хотел бы сделать, что бы столбцы были ровные:

Wrs8.jpg

Как я понял, это можно сделать только с помощью 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 by TurinDeNar
  • Upvote 1
Link to comment
Short link
Share on other sites

@HGK, чётко вы мой кусок кода спионерили )
Дело в том, что tabstops для определённой ширины с запасом подгоняются, чуть шире - и по ЖПП пойдёт . Там долго надо голову сушить .

  • Upvote 1
Link to comment
Short link
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...