Update watch face: modular refactor + OWM/Solar/background + codegen tools
- Split render into FieldTable/Fields/Icons/Layout/Settings modules - Add Fenix8V3Background, Owm (weather), Solar modules - Add tools/ generators (gen_fields/gen_icons/gen_themes/gen_preview_svg) - Tune README/manifest/strings/settings
This commit is contained in:
@@ -1,18 +1,25 @@
|
||||
// AUTO-GENERATED by tools/gen_fields.py -- do not edit by hand.
|
||||
// Ids follow https://watchface.io/docs/datafields; only the fields a
|
||||
// Connect IQ watch face can source on-device are listed.
|
||||
// ⚠️ 本文件由 tools/gen_fields.py 自动生成,请勿手改。
|
||||
// 要加字段:在生成器的 FIELDS 表里加一行,跑一遍生成器,
|
||||
// 再到 source/Fields.mc 对应分类的函数里补一个分支。
|
||||
//
|
||||
// 字段编号沿用 https://watchface.io/docs/datafields,只收录 Connect IQ
|
||||
// 表盘在本机能算出来的那些。
|
||||
import Toybox.Lang;
|
||||
|
||||
module FieldTable {
|
||||
|
||||
// Field ids, in the same order as the Labels resource string.
|
||||
// 全部字段 id,顺序与 FieldLabels 资源串(逗号分隔的标签表)严格一致 ——
|
||||
// Fields.label() 就是靠这个下标去取对应标签的。
|
||||
const IDS = [
|
||||
0,860,880,864,865,851,872,852,855,870,856,853,868,858,859,873,1,14,707,2,603,150,
|
||||
152,154,151,3,4,5,6,9,10,618,276,12,635,11,623,8,15,281,742,13,278,277,250,251,257,
|
||||
253,255,254,256,252,615,616,733,712,717,700,731,706,732,306,639,300,301,302,305,304,
|
||||
308,307,310,309,703,704,705
|
||||
0,860,880,864,865,851,872,852,855,870,856,853,868,858,859,850,869,873,1,14,707,2,
|
||||
603,150,152,154,151,3,4,5,6,9,10,219,220,211,212,213,214,203,204,200,618,276,12,635,
|
||||
11,623,8,15,281,742,13,278,277,250,251,257,253,255,254,256,252,615,616,733,712,717,
|
||||
700,731,706,732,710,709,708,711,714,715,718,719,720,721,306,639,300,301,302,305,304,
|
||||
308,307,310,309,312,313,314,315,500,515,503,504,505,507,502,501,506,509,510,511,518,
|
||||
512,513,532,536,537,530,534,522,535,523,516,517,703,704,705
|
||||
];
|
||||
|
||||
// 由字段 id 反查它在 IDS 里的下标;找不到返回 0(对应「关闭」)。
|
||||
function indexOf(id as Number) as Number {
|
||||
for (var i = 0; i < IDS.size(); i++) {
|
||||
if (IDS[i] == id) { return i; }
|
||||
|
||||
Reference in New Issue
Block a user