tabtoy icon indicating copy to clipboard operation
tabtoy copied to clipboard

能否提供一个V3结构体的例子

Open nieyanbing opened this issue 2 years ago • 7 comments

能否提供一个V3结构体的例子

ID 名称 结构体
1 坦克 血量:10 攻击: 10
2 法师 血量:20 攻击: 20

期望导出lua如下

return {
    init = function(g)

        g.MyData = {{
            id = 1,
            name = "坦克",
            attr = {
				hp = 10,
				attack = 10
			}
        }, {
            id = 1,
            name = "法师",
            attr = {
				hp = 20,
				attack = 20
			}
        }}

        return g
    end
}

nieyanbing avatar Mar 04 '22 11:03 nieyanbing

不支持了

---原始邮件--- 发件人: @.> 发送时间: 2022年3月4日(周五) 晚上7:58 收件人: @.>; 抄送: @.***>; 主题: [davyxu/tabtoy] 能否提供一个V3结构体的例子 (Issue #97)

能否提供一个V3结构体的例子 ID 名称 结构体 1 坦克 血量:10 攻击: 10 2 法师 血量:20 攻击: 20

期望导出lua如下 return { init = function(g) g.MyData = {{ id = 1, name = "坦克", attr = { hp = 10, attack = 10 } }, { id = 1, name = "法师", attr = { hp = 20, attack = 20 } }} return g end }
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>

davyxu avatar Mar 04 '22 12:03 davyxu

v2貌似有支持?感觉这个功能应该还是蛮有用的。 而且如果有这种需求比如:装备合成的时候需要另外几个装备才能合成

{
    itemid = 1
    name = "合成装备",
    "合成装备" = {
        {
            itemid = 2, --物品ID
            count = 1,  --需要的数量
        },
        {
            itemid = 3,
            count = 2
        }
    }
}

像这种需求用V3应该怎么写? 或者其他的替代方案?

nieyanbing avatar Mar 04 '22 14:03 nieyanbing

不支持,也不要习惯这种行为,这是错误的

---原始邮件--- 发件人: @.> 发送时间: 2022年3月4日(周五) 晚上10:11 收件人: @.>; 抄送: "Davy @.@.>; 主题: Re: [davyxu/tabtoy] 能否提供一个V3结构体的例子 (Issue #97)

v2貌似有支持?感觉这个功能应该还是蛮有用的。 而且如果有这种需求比如:装备合成的时候需要另外几个装备才能合成 { itemid = 1 name = "合成装备", "合成装备" = { { itemid = 2, --物品ID count = 1, --需要的数量 }, { itemid = 3, count = 2 } } }
像这种需求用V3应该怎么写? 或者其他的替代方案?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

davyxu avatar Mar 04 '22 16:03 davyxu

额 好吧 那我想请教下 如果遇到这种需求应该怎么设计比较好

---原始邮件--- 发件人: "Davy @.> 发送时间: 2022年3月5日(周六) 凌晨0:53 收件人: @.>; 抄送: @.@.>; 主题: Re: [davyxu/tabtoy] 能否提供一个V3结构体的例子 (Issue #97)

不支持,也不要习惯这种行为,这是错误的

---原始邮件--- 发件人: @.> 发送时间: 2022年3月4日(周五) 晚上10:11 收件人: @.>; 抄送: "Davy @.@.>; 主题: Re: [davyxu/tabtoy] 能否提供一个V3结构体的例子 (Issue #97)

v2貌似有支持?感觉这个功能应该还是蛮有用的。 而且如果有这种需求比如:装备合成的时候需要另外几个装备才能合成 { itemid = 1 name = "合成装备", "合成装备" = { { itemid = 2, --物品ID count = 1, --需要的数量 }, { itemid = 3, count = 2 } } }
像这种需求用V3应该怎么写? 或者其他的替代方案?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

nieyanbing avatar Mar 04 '22 17:03 nieyanbing

仔细看说明,竖线分割变数组,一个是id,一个是数量

---原始邮件--- 发件人: @.> 发送时间: 2022年3月5日(周六) 凌晨1:26 收件人: @.>; 抄送: "Davy @.@.>; 主题: Re: [davyxu/tabtoy] 能否提供一个V3结构体的例子 (Issue #97)

额 好吧 那我想请教下 如果遇到这种需求应该怎么设计比较好

---原始邮件--- 发件人: "Davy @.> 发送时间: 2022年3月5日(周六) 凌晨0:53 收件人: @.>; 抄送: @.@.>; 主题: Re: [davyxu/tabtoy] 能否提供一个V3结构体的例子 (Issue #97)

不支持,也不要习惯这种行为,这是错误的

---原始邮件---
发件人: @.>
发送时间: 2022年3月4日(周五) 晚上10:11
收件人: @.
>;
抄送: "Davy @.@.>;
主题: Re: [davyxu/tabtoy] 能否提供一个V3结构体的例子 (Issue #97)

v2貌似有支持?感觉这个功能应该还是蛮有用的。
而且如果有这种需求比如:装备合成的时候需要另外几个装备才能合成
{ itemid = 1 name = "合成装备", "合成装备" = { { itemid = 2, --物品ID count = 1, --需要的数量 }, { itemid = 3, count = 2 } } }
像这种需求用V3应该怎么写? 或者其他的替代方案?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.Message ID: @.>
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.
> — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

davyxu avatar Mar 05 '22 01:03 davyxu

先谢谢了 我知道这样确实是可以 只是感觉不太直观

nieyanbing avatar Mar 05 '22 03:03 nieyanbing

你是用lua的?可以先用我的分支先。然后将格式设置为 表头 就行。

514366607 avatar Mar 31 '22 05:03 514366607