sidi762 / followme_e-tron

A realistic electric supercar for FlightGear based on the Renault Kangoo I Follow me vehicle.
https://www.fgprc.org.cn/followmeev.html
GNU General Public License v2.0
14 stars 6 forks source link

Save to the Rescue! #57

Closed Marsdolphin closed 4 years ago

Marsdolphin commented 4 years ago

Hi Sidi, Finally an experimental version has success. For now, it can only save one place, but I'll perhaps add slots later I am going to pull even more for the save as I will add more new features to be saved in the future. Best Regards, Mars.

sidi762 commented 4 years ago

我看了下,没什么大问题,不过希望你能注意一下代码格式(缩进、变量命名规范等),这样便于代码日后进行维护。

Marsdolphin commented 4 years ago

我把setprop往后移了一格

sidi762 commented 4 years ago

你可以看一下其他的nasal代码,我个人倾向于使用tab进行缩进(或者soft tab)。

sidi762 commented 4 years ago

还有一些建议:你既然已经把这些property存储到了save下面,其实可以把save这个节点存储为xml,恢复状态时再读取,这样就可以进行永久存储。你也可以参考一下FG的state功能(我自己还没有细看过,但是也许能用上?)

Marsdolphin commented 4 years ago

我看一下。。。

sidi762 commented 4 years ago

啊不是的,代码缩进不是这样的...... 建议参考下其他的代码,或者上网搜索一下其他语言的缩进规范来参考

Marsdolphin commented 4 years ago

我实在不知道 ❌

Marsdolphin commented 4 years ago

好像可以存xml, 把所有的property都放进去存储

sidi762 commented 4 years ago

这个代码缩进简单来说就是......花括号里面的内容比外面的内容都往后一个tab(或四个空格)

Marsdolphin commented 4 years ago

看一下其他的nasal,学习一下 ......

Marsdolphin commented 4 years ago

我有点懵。。。怎么弄的?有没有什么example?其他的nasal都不一样......

Marsdolphin commented 4 years ago

除了setprop还要tab什么》》》?

Marsdolphin commented 4 years ago

好像明白了。。。

Marsdolphin commented 4 years ago

又tab了一大堆东西

Marsdolphin commented 4 years ago

我重开一个