0

我有这个:

{{#config.buildings:building}}
    <div class="building" id="building-item-{{building}}">
        <div class="image-container">
            <div class="thumbnail" style="background: transparent url({{staticUrl}}/game_images/town/buildings/{{building}}/{{building}}-1-thumbnail.png) no-repeat center center;"></div>
            <div class="cover"></div>
            <div class="undercover"></div>

            <div class="level">{{village.buildings[building].level + alreadyInQueue(building)}}</div>
        </div>
        <div class="big_title">{{lang('buildings',building)}}</div>
        <p class="{{buildingMaxed(building) ? 'maxed' : ''}}">{{lang('buildings',building+'_description')}}</p>
        <div on-tap="upgradeBuilding:{{building}}" class="upgrade-button" tooltip="{{lang('general','upgrade_building')}}"></div>
        <div on-tap="downgradeBuilding:{{building}}" class="downgrade-button disabled" tooltip="{{lang('general','downgrade_building')}}"></div>
            <div class="resources">
                <div class="resource">
                    <img class="thumbnail" src="{{staticUrl}}/game_images/resources/woodB.png">
                    <label class="res-count-wood">{{config.buildings[building][village.buildings[building].level].wood}}</label>
                </div>
                <div class="resource">
                    <img class="thumbnail" src="{{staticUrl}}/game_images/resources/ironB.png">
                    <label class="res-count-iron">{{config.buildings[building][village.buildings[building].level].clay}}</label>
                </div>
                <div class="resource">
                    <img class="thumbnail" src="{{staticUrl}}/game_images/resources/clayB.png">
                    <label class="res-count-stone">{{config.buildings[building][village.buildings[building].level].iron}}</label>
                </div>
                <div class="resource">
                    <img class="thumbnail" src="{{staticUrl}}/game_images/resources/workersB.png">
                    <label class="res-count-builders">{{config.buildings[building][village.buildings[building].level].people}}</label>
                </div>
                <div class="resource">
                    <img class="thumbnail" src="{{staticUrl}}/game_images/resources/timeB.png">
                    <label class="res-count-time">{{secsToString(config.buildings[building][village.buildings[building].level].time)}}</label>
                </div>
            </div>
        <div class="hr"></div>
    </div>
{{/config.buildings:building}}

当我使用

contentTPL.set('village.buildings[1].level',4)

唯一更新的是

<div class="level">{{village.buildings[building].level + alreadyInQueue(building)}}</div>
// and
<label class="res-count-time">{{secsToString(config.buildings[building][village.buildings[building].level].time)}}</label>

我似乎不明白为什么其他值没有按应有的方式在 update() 上更新。代码中没有错误,我使用的是边缘版本(与 4 月 8 日的最新版本 0.4.0 的结果相同)。

更新 我已经剥离了所有不必要的数据,并在已经排队的函数中添加了一个 console.log。它在初始化时被调用,但是,当我调用contentTPL.update()时,它不再被调用。按下 startQueue 按钮时,文件中没有任何更新。队列到期时还有另一个 contentTPL.update() ,它只更新级别和所需的时间,如上所述。我要求 Rich 或 Marty 就这个问题提出建议,因为我在这里被困了大约 4 个小时,似乎无法理解这是我对图书馆的滥用还是一个错误。

4

1 回答 1

0

事实证明这是一个错误,现在已在 dev 中修复

于 2014-05-29T02:09:02.273 回答