BaseMod icon indicating copy to clipboard operation
BaseMod copied to clipboard

Chinese description render defect

Open hundun000 opened this issue 4 years ago • 0 comments

If a Chinese rawDescription contain "D", example "加入一张D炸弹" (the "D炸弹" just a plain text word, as I not use "!D!"). In AbstractCard.renderDescriptionCN(), get TokenizedTextCN = ["加入一张D炸弹"], then these codes will iterate chars and replace 'D' with dynamic-value-damage.

   for (String tmp : ((DescriptionLine)this.description.get(i)).getCachedTokenizedTextCN()) {
       String updateTmp = null; int j;
       for (j = 0; j < tmp.length(); j++) {
           if (tmp.charAt(j) == 'D' || (tmp.charAt(j) == 'B' && !tmp.contains("[B]")) || tmp.charAt(j) == 'M') {
               updateTmp = tmp.substring(0, j);
               updateTmp = updateTmp + getDynamicValue(tmp.charAt(j));
               updateTmp = updateTmp + tmp.substring(j + 1);
         
               break;
           } 
       } 

Finally, the rendered description is "加入一张-1炸弹". But I want the rendered description is "加入一张D炸弹"(no change). Will there be a new patch fix it?

hundun000 avatar Mar 03 '21 04:03 hundun000