Jump to content

Translations:Touch controls/23/zh: Difference between revisions

From DDraceNetwork
Darkh (talk | contribs)
No edit summary
No edit summary
 
Line 17: Line 17:
*** <code>&quot;ingame-menu&quot;</code>:松开该按钮时立即打开游戏内菜单;
*** <code>&quot;ingame-menu&quot;</code>:松开该按钮时立即打开游戏内菜单;
*** <code>&quot;extra-menu&quot;</code>:附加菜单切换按钮,在可见性为<code>&quot;extra-menu&quot;</code>, <code>&quot;extra-menu-2&quot;</code>, <code>&quot;extra-menu-3&quot;</code>, <code>&quot;extra-menu-4&quot;</code>和<code>&quot;extra-menu-5&quot;</code>的这些按钮间循环切换,长按也可打开游戏菜单;
*** <code>&quot;extra-menu&quot;</code>:附加菜单切换按钮,在可见性为<code>&quot;extra-menu&quot;</code>, <code>&quot;extra-menu-2&quot;</code>, <code>&quot;extra-menu-3&quot;</code>, <code>&quot;extra-menu-4&quot;</code>和<code>&quot;extra-menu-5&quot;</code>的这些按钮间循环切换,长按也可打开游戏菜单;
**** 将属性<code>&quot;number&quot;</code>设置为1到5的整数分别对应下面几项的可见性<code>&quot;extra-menu&quot;</code>, <code>&quot;extra-menu-2&quot;</code>, <code>&quot;extra-menu-3&quot;</code>, <code>&quot;extra-menu-4&quot;</code>, <code>&quot;extra-menu-5&quot;</code>。
**** 将属性<code>&quot;number&quot;</code>设置为1到5的整数分别对应下面几项的可见性<code>&quot;extra-menu&quot;</code>, <code>&quot;extra-menu-2&quot;</code>, <code>&quot;extra-menu-3&quot;</code>, <code>&quot;extra-menu-4&quot;</code>, <code>&quot;extra-menu-5&quot;</code>。若导入文件内对应的按钮没有<code>&quot;number&quot;</code>值,客户端会自动将其赋值为<code>&quot;1&quot;</code>。
*** <code>&quot;emoticon&quot;</code>:打开表情轮盘(此功能无法通过绑定使用);
*** <code>&quot;emoticon&quot;</code>:打开表情轮盘(此功能无法通过绑定使用);
*** <code>&quot;spectate&quot;</code>:打开旁观列表(此功能无法通过绑定使用);
*** <code>&quot;spectate&quot;</code>:打开旁观列表(此功能无法通过绑定使用);
Line 29: Line 29:
*** 属性<code>&quot;label&quot;</code>指定为字符串,用作定义该按钮的标签(即显示在按钮上的文字);
*** 属性<code>&quot;label&quot;</code>指定为字符串,用作定义该按钮的标签(即显示在按钮上的文字);
*** 属性<code>&quot;label-type&quot;</code>指定为字符串,用于决定该按键的标签种类,即属性<code>&quot;label&quot;</code>的处理方法:
*** 属性<code>&quot;label-type&quot;</code>指定为字符串,用于决定该按键的标签种类,即属性<code>&quot;label&quot;</code>的处理方法:
**** <code>&quot;plain&quot;</code>:标签会被直接呈现;
**** <code>&quot;plain&quot;</code>:标签会被直接呈现,这也是导入文件内缺少相应按钮的<code>&quot;label-type&quot;</code>值时自动赋予的默认值。
**** <code>&quot;localized&quot;</code>:标签会本地化,仅对默认按钮存在对应翻译时可用;
**** <code>&quot;localized&quot;</code>:标签会本地化,仅对默认按钮存在对应翻译时可用;
**** <code>&quot;icon&quot;</code>:标签使用图标。图标必须为UTF-16编码,格式为<code>\uXXXX</code>。例如<code>\uf3ce</code>为手机图标,对应的Unicode编码为<code>f3ce</code>。注意该图标必须来自于DDNet或在[https://fontawesome.com/search?o=r&m=free Font Awesome Free]上可用。
**** <code>&quot;icon&quot;</code>:标签使用图标。图标必须为UTF-16编码,格式为<code>\uXXXX</code>。例如<code>\uf3ce</code>为手机图标,对应的Unicode编码为<code>f3ce</code>。注意该图标必须来自于DDNet或在[https://fontawesome.com/search?o=r&m=free Font Awesome Free]上可用。

Latest revision as of 16:13, 18 March 2025

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Touch controls)
* Position and size (attributes <code>&quot;x&quot;</code>, <code>&quot;y&quot;</code>, <code>&quot;w&quot;</code>, <code>&quot;h&quot;</code>): the X/Y position and width/height are integers on a 1,000,000² grid. These ''unit grid'' values are converted to ''screen grid'' values at runtime in relation to the size and aspect ratio of the screen. This means buttons may appear stretched if the resolution is changed, but it allows us to provide a reasonable default for slightly different aspect ratios.
* Shape (attribute <code>&quot;shape&quot;</code>): determines the shape of the button being rendered.
** <code>&quot;rect&quot;</code>: rectangle shape.
** <code>&quot;circle&quot;</code>: circle shape. The button size will automatically be adjusted so that width and height are identical.
* Visibility (attribute <code>&quot;visibilities&quot;</code>): an array of predefined visibility classes can be selected and the button is only shown if all conditions are satisfied. An empty array means that the button is always shown. The following visibility classes are defined:
** <code>&quot;ingame&quot;</code>: player is ingame, i.e. not spectating.
** <code>&quot;extra-menu&quot;</code>, <code>&quot;extra-menu-2&quot;</code>, <code>&quot;extra-menu-3&quot;</code>, <code>&quot;extra-menu-4&quot;</code>, <code>&quot;extra-menu-5&quot;</code>: the extra menu with the given number is activated.
** <code>&quot;zoom-allowed&quot;</code>: zoom is allowed on this server.
** <code>&quot;vote-active&quot;</code>: a vote is currently active.
** <code>&quot;dummy-allowed&quot;</code>: dummy is allowed on this server.
** <code>&quot;dummy-connected&quot;</code>: dummy is currently connected.
** <code>&quot;rcon-authed&quot;</code>: player is currently authed in rcon.
** <code>&quot;demo-player&quot;</code>: demo player is currently active.
** All visibility classes can be inverted by prefixing them with <code>-</code>, e.g. <code>&quot;-ingame&quot;</code> is satisfied when the player is not ingame, i.e. spectating.
* Behavior (attribute <code>&quot;behavior&quot;</code>): an object which describes the behavior of this touch button when it is activated/deactivated as well as its label. The attribute <code>&quot;type&quot;</code> is used to differentiate which type of behavior is used. The behavior is either predefined (hard-coded) or based on generic console commands (like binds). Predefined behavior is only used where necessary, all other buttons are represented as generic binds.
** Predefined behavior (attribute <code>&quot;type&quot;</code> set to <code>&quot;predefined&quot;</code>): The attribute <code>&quot;id&quot;</code> is set to a fixed string value which determines the specific predefined behavior. The following predefined behaviors can be used:
*** <code>&quot;ingame-menu&quot;</code>: Opens the ingame menu immediately when released.
*** <code>&quot;extra-menu&quot;</code>: The extra menu button which toggles visibility of buttons with <code>&quot;extra-menu&quot;</code>, <code>&quot;extra-menu-2&quot;</code>, <code>&quot;extra-menu-3&quot;</code>, <code>&quot;extra-menu-4&quot;</code> and <code>&quot;extra-menu-5&quot;</code> visibilities. Also opens the ingame menu on long press.
**** The attribute <code>&quot;number&quot;</code> specifies an integer between 1 and 5 to associate this button with the respective visibilities <code>&quot;extra-menu&quot;</code>, <code>&quot;extra-menu-2&quot;</code>, <code>&quot;extra-menu-3&quot;</code>, <code>&quot;extra-menu-4&quot;</code>, <code>&quot;extra-menu-5&quot;</code>.
*** <code>&quot;emoticon&quot;</code>: Opens the emoticon selector (this does not work with binds).
*** <code>&quot;spectate&quot;</code>: Opens the spectator menu (this does not work with binds).
*** <code>&quot;swap-action&quot;</code>: Swaps the active action (fire and hook) for direct touch input and virtual joysticks.
*** <code>&quot;use-action&quot;</code>: Uses the active action with the current aiming position.
*** <code>&quot;joystick-action&quot;</code>: Virtual joystick which uses the active action.
*** <code>&quot;joystick-aim&quot;</code>: Virtual joystick which only aims without using an action.
*** <code>&quot;joystick-fire&quot;</code>: Virtual joystick which always uses fire.
*** <code>&quot;joystick-hook&quot;</code>: Virtual joystick which always uses hook.
** Bind behavior (attribute <code>&quot;type&quot;</code> set to <code>&quot;bind&quot;</code>). Buttons with this behavior execute console commands like regular key binds.
*** The attribute <code>&quot;label&quot;</code> specifies as a string the label of the button.
*** The attribute <code>&quot;label-type&quot;</code> specifies as a string the type of the label of the button, i.e. how the attribute <code>&quot;label&quot;</code> is interpreted:
**** <code>&quot;plain&quot;</code>: Label is used as is.
**** <code>&quot;localized&quot;</code>: Label is localized. Only usable for the default buttons for which there are translations available.
**** <code>&quot;icon&quot;</code>: Icon font is used for the label. Icons must be encoded in UTF-16 using <code>\uXXXX</code>, e.g. <code>\uf3ce</code> for the mobile phone icon which has unicode <code>f3ce</code>. Note that the icon must be available in the icon font that comes with DDNet, [https://fontawesome.com/search?o=r&m=free Font Awesome Free].
*** The attribute <code>&quot;command&quot;</code> specifies as a string the command to execute in the console like a bind when this button is used, e.g. <code>&quot;+fire&quot;</code> for a button that uses the fire action.
** Bind toggle behavior (attribute <code>type</code> set to <code>&quot;bind-toggle&quot;</code>). Buttons with this behavior cycle between executing one of two or more specified commands.
*** The attribute <code>&quot;commands&quot;</code> specifies an array of two or more commands in the order in which they are shown and executed. Each command is an object with the attributes <code>&quot;label&quot;</code>, <code>&quot;label-type&quot;</code> and <code>&quot;command&quot;</code> which are defined the same as for the bind behavior described above. At least two command objects must be specified in the array.
  • 位置和大小(属性"x", "y", "w", "h"):屏幕显示区域将被平均划分为1000000x1000000的网格,前面提到的四个属性为整数,大小分别表示按钮的中心点横纵坐标和宽度高度。网格的实际单位长度会根据游戏窗口大小及屏幕比例实时拉伸,因此对于不同的屏幕设备,只要屏幕纵横比差异不大,按钮布局就不会变得特别不合理。
  • 形状 (属性"shape"):用于决定按钮形状:
    • "rect":矩形;
    • "circle":圆形,该按钮的高度和宽度会自动调整为一致大小。
  • 可见性(属性"visibilities"):该属性为空意味着按钮总是显示在屏幕上。如果设置了某些属性,按钮将只会在满足特定条件时显示,其它情况下隐藏,目前已预设一系列可选的可见性类型如下:
    • "ingame":仅在游戏内显示,即在旁观模式下将会隐藏;
    • "extra-menu", "extra-menu-2", "extra-menu-3", "extra-menu-4", "extra-menu-5":在打开对应序号的附加菜单时显示;
    • "zoom-allowed":当前服务器允许缩放视野时显示;
    • "vote-active":当投票进行时显示;
    • "dummy-allowed":当前服务器允许分身连接时显示;
    • "dummy-connected":当分身已经连接时显示;
    • "rcon-authed":成为管理员时显示;
    • "demo-player":当播放回放时显示;
    • 所有可见性类型都可以通过在添加-前缀来反转。例如:"-ingame"将在游戏内隐藏,即旁观模式中显示。
  • 行为(属性"behavior"):一个用于描述此按钮激活或失效时执行的行为、标签的对象。属性"type"用于区分按钮的行为类型。行为类型有两种,分别是预设好的硬编码以及基于一般的控制台命令(例如:按键绑定)。请根据需求设置按钮的行为类型,按钮的预设行为功能较少,其余所有按钮功能来自于一般的绑定:
    • 预设行为(属性"type""predefined"):此行为类型的按钮只能执行预设行为。属性"id"为一个字符串,用以决定特定的预设行为。下方列出可用的预设行为:
      • "ingame-menu":松开该按钮时立即打开游戏内菜单;
      • "extra-menu":附加菜单切换按钮,在可见性为"extra-menu", "extra-menu-2", "extra-menu-3", "extra-menu-4""extra-menu-5"的这些按钮间循环切换,长按也可打开游戏菜单;
        • 将属性"number"设置为1到5的整数分别对应下面几项的可见性"extra-menu", "extra-menu-2", "extra-menu-3", "extra-menu-4", "extra-menu-5"。若导入文件内对应的按钮没有"number"值,客户端会自动将其赋值为"1"
      • "emoticon":打开表情轮盘(此功能无法通过绑定使用);
      • "spectate":打开旁观列表(此功能无法通过绑定使用);
      • "swap-action":切换当前直接点击屏幕和虚拟摇杆控制的动作(开火和出钩);
      • "use-action":以当前瞄准角度执行当前激活的动作;
      • "joystick-action":按下时会在调整瞄准角度的同时使用当前激活动作的虚拟摇杆;
      • "joystick-aim":按下时仅调整瞄准角度不执行动作的虚拟摇杆;
      • "joystick-fire":按下时会在调整瞄准角度的同时开火的虚拟摇杆;
      • "joystick-hook":按下时会在调整瞄准角度的同时出钩的虚拟摇杆。
    • 绑定行为(属性"type"设置为"bind")。此行为类型的按钮会执行控制台命令,和常规按键绑定类似:
      • 属性"label"指定为字符串,用作定义该按钮的标签(即显示在按钮上的文字);
      • 属性"label-type"指定为字符串,用于决定该按键的标签种类,即属性"label"的处理方法:
        • "plain":标签会被直接呈现,这也是导入文件内缺少相应按钮的"label-type"值时自动赋予的默认值。;
        • "localized":标签会本地化,仅对默认按钮存在对应翻译时可用;
        • "icon":标签使用图标。图标必须为UTF-16编码,格式为\uXXXX。例如\uf3ce为手机图标,对应的Unicode编码为f3ce。注意该图标必须来自于DDNet或在Font Awesome Free上可用。
      • 属性"command"指定为可以在控制台执行的命令的字符串,与绑定类似。例如"+fire"为按钮添加开火动作。
    • 绑定切换行为(属性type设置为"bind-toggle")。此行为类型的按钮会循环触发两个或更多的命令。
      • 属性"commands"指定为两个及以上的指令列表,依据排列的先后顺序依次触发和显示。单个指令为一个拥有属性"label""label-type""command"的对象,与上述绑定行为的定义基本一致,但是在指令列表中必须至少有两个指令对象。