﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-胡言乱语</title><link>http://www.blogjava.net/kimHero/</link><description>......</description><language>zh-cn</language><lastBuildDate>Tue, 07 Apr 2026 06:18:44 GMT</lastBuildDate><pubDate>Tue, 07 Apr 2026 06:18:44 GMT</pubDate><ttl>60</ttl><item><title>同样都是代码，风格差距怎么就这么大呢？</title><link>http://www.blogjava.net/kimHero/archive/2005/05/17/4390.html</link><dc:creator>Kim Zhang</dc:creator><author>Kim Zhang</author><pubDate>Tue, 17 May 2005 00:50:00 GMT</pubDate><guid>http://www.blogjava.net/kimHero/archive/2005/05/17/4390.html</guid><wfw:comment>http://www.blogjava.net/kimHero/comments/4390.html</wfw:comment><comments>http://www.blogjava.net/kimHero/archive/2005/05/17/4390.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/kimHero/comments/commentRss/4390.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kimHero/services/trackbacks/4390.html</trackback:ping><description><![CDATA[几天来沉浸在WOW中，满心欢喜，查资料的时候，发现原来WOW还支持自己写插件，呼呼，于是乐趣就从玩游戏变成的自定义界面。<BR><BR>大脚、WOWSHELL等都用过，可是总觉得有点美中不足，我不要那么多东东，我只想要……<BR><BR>于是，就想自己写点儿东东，当然了，最快的方法是——COPY，于是就看看LUA，看看别人写的东东，毕竟，其实我是一个程序员，<IMG height=19 src="http://www.blogjava.net/Emoticons/shades_smile.gif" width=19 border=0>，于是……<BR><BR>在这个过程中就发现了一点东东，下面就是我找到的国内的代码<BR><BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000"> Oo0o0o0j() end </SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000"> Oo0o0o0Zu(Oo0o0o0Rd) </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(Oo0o0o0Rd </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">) then </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(not Oo0o0o0yi) then Oo0o0o0yi </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> UseAction UseAction </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> Oo0o0o0vq end </SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(Oo0o0o0yi) then UseAction </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> Oo0o0o0yi Oo0o0o0yi </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> nil end end end </SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000"> Oo0o0o0vq(Oo0o0o0om, check, onSelf) </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(IsAltKeyDown()) then local Oo0o0o0Bm </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(Oo0o0o0om) then getglobal(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">wsGameTooltip</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">):SetAction(Oo0o0o0om) Oo0o0o0Bm</SPAN></DIV></DIV><BR>在这个界面上，还可以看到是O（欧）＋o（欧）＋0（零）＋o（欧）＋0（零）＋o（欧）＋0（零），在记事本上就完全是0o0o0o0了。<BR><BR>再看大名鼎鼎的FlexBar的代码。<BR><BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #000000">function FlexBarButton_OnUpdate(elapsed, button)<BR></SPAN><SPAN style="COLOR: #000000">--</SPAN><SPAN style="COLOR: #000000"> Blizzard code<BR>    </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( FlexBarButton_IsFlashing(button) ) then<BR>        button.flashtime </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> button.flashtime </SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000"> elapsed;<BR>        </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( button.flashtime </SPAN><SPAN style="COLOR: #000000"><=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000"> ) then<BR>            local overtime </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">button.flashtime;<BR>            </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( overtime </SPAN><SPAN style="COLOR: #000000">>=</SPAN><SPAN style="COLOR: #000000"> ATTACK_BUTTON_FLASH_TIME ) then<BR>                overtime </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR>            end<BR>            button.flashtime </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> ATTACK_BUTTON_FLASH_TIME </SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000"> overtime;<BR><BR>            local flashTexture </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> getglobal(button:GetName()..</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Flash</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>            </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( flashTexture:IsVisible() ) then<BR>                flashTexture:Hide();<BR>            </SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR>                flashTexture:Show();<BR>            end<BR>        end<BR>    end<BR>    </SPAN><SPAN style="COLOR: #000000">--</SPAN><SPAN style="COLOR: #000000"> Handle range indicator<BR>    </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( button.rangeTimer ) then<BR>        </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( button.rangeTimer </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000"> ) then<BR>            FlexBarButton_UpdateUsable(button);<BR>            button.rangeTimer </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> TOOLTIP_UPDATE_TIME;<BR>        </SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR>            button.rangeTimer </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> button.rangeTimer </SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000"> elapsed;<BR>        end<BR>    end<BR><BR>    </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( not button.updateTooltip ) then<BR>        </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">;<BR>    end<BR><BR>    button.updateTooltip </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> button.updateTooltip </SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000"> elapsed;<BR>    </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( button.updateTooltip </SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000"> ) then<BR>        </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">;<BR>    end<BR><BR>    </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> ( GameTooltip:IsOwned(button) ) then<BR>        FlexBarButton_SetTooltip(button);<BR>    </SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR>        button.updateTooltip </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> nil;<BR>    end<BR>end</SPAN></DIV></DIV>
<P><BR>这算是文化差异吗？<BR><BR>这样做的目的是什么？保密？在记事本中拷贝Oo0o0o0（即使看起来是0o0o0o0也无所谓，反正是鼠标选择），替换成“”即可，稍稍了解一下Lua，排一下版，还保啥子秘呀！<IMG height=20 src="http://www.blogjava.net/Emoticons/QQ/14.gif" width=20 border=0></P>
<P> 曾经这样想过，如果国人的代码，能写成清晰的样子，是否可以是国人的软件水平提升呢？（个人瞎想）。<BR><BR>小子乱弹琴，放肆了。<BR></P><img src ="http://www.blogjava.net/kimHero/aggbug/4390.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kimHero/" target="_blank">Kim Zhang</a> 2005-05-17 08:50 <a href="http://www.blogjava.net/kimHero/archive/2005/05/17/4390.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>