发信人: shiping (小平~~~我不常来的), 信区: ANSI
标 题: menu.ini扩展制作办法(再补)
发信站: 日月光华 (2003年01月13日20:22:41 星期一), 站内信件
这是《menu.ini入门到精通》的第8篇,也是对第6,7篇的补充和总结,
主要讲的是所谓的menu.ini扩展制作办法的原理以及部分应用。
非常感谢暨南园bbs站美工站长(真不好意思id已经想不起来)在menu.ini方面
对我的启发,使得我能够从更多的角度更高的层次来总结这种方法。
好,我们继续。
首先讲firebird系统对于menu.ini的解释过程。
: 这个过程非常简单,就是用前景代码覆盖背景代码,最终形成界面。
上面这句话中有两个词希望注意,一个是“代码”。在这个阶段,一切图形
文字控制符都是以代码的形式进行处理。换句话说系统并不知道*[31m是要显示
红颜色,而只知道这是5个字符,甚至连汉字也无法辨认,而只知道是两个字符。
(一个汉字两个字符)。我之所以强调这一点,效果会在下面显示出来。
第二个词是“覆盖“。形象地说,系统先把背景代码写在纸上,再把前景代码
”覆盖“上去,而决不会考虑是否破坏背景代码本身。
好,我们来看例子:
比如,这一行的背景代码是
[ abcdefghijkl]
0123456789012345678901234 ——这一行是横坐标尺
相应的前景代码是 10,7,0,“test","*[32m test *[0;1m"
注意,这里,前景的所有代码都会原封不动地覆盖到背景上相应地位置去,而背景上
的abcd...等,都将被覆盖掉。
再来看一个失败的例子,以下我不给出前景的menu代码而直接给出其效果代码,
应当更容易理解。
前景: *[31m test *[0;1m
背景: *[31m test *[0;1m
可以看到,代码是一样的,只是位置差了一点,那么最后得到的代码是怎样呢
结果: *[31m test *[0;1mm
结果是,最后面多出来一个m
反过来,如果
前景: *[31m test *[0;1m
背景 *[31m test *[0;1m
结果: **[31m test *[0;1m
这个结果更加严重一些。
相差再大一点,
前景: *[31m test *[0;1m
背景: *[31m test *[0;1m
结果: *[*[31m test *[0;1m
这样,已经造成了混乱。
上面都是相对失败的例子。下面我们来讲如何合理运用这种覆盖效果使得我们的
menu更加自然。
方法一:全背景方案
这个方案,在本教程的第6章有比较详细的描述,不再重复。
: 优点:对界面的美化有着极大的好处
: 缺点:无法根据权限区分menu
方法二:全前景方案
这个方案,在本教程第7章提到,不过没有说得很详细,这里补叙一下。
实施办法就是背景用空或者用全空格或者在menu中根本不加载背景块,
而所有的menu内容全部加到前景块中,比如
!M_EGROUP 10, 5, 0, "EGroup", "*[42m E) 分类讨论区 *[0;1m !!!"
两个m之间固然是菜单选项,此之后的东西明明就是背景的内容了,现在也
放到前景说明语句中来。
: 优点:能对全背景方案不能解决的权限区分menu的问题作出很好的解决
: 缺点:只能最多控制14行(这是一般bbs背景的上下宽度)。
可能有人问了,上下宽度本来就只有14行,不是正好么,这怎么能算缺点。
下面有个实际的例子,我们希望看到这样的效果,普通权限的人看到的是:
a
b
<=注意这里已经没有菜单选项了
而拥有某种特殊权限的人看到的是
a
b
c
<=这里也没有菜单选项了
这个例子无论采取上面哪一种方案,都不能达到。因此我们来介绍下面的
第三种方案
方案三:背景前景覆盖方案
看得出来,第一和第二个方案都是极端的两个方案,将两个方案结合起来,
自然就能达到更好的效果。这里,就要用到先前介绍的“覆盖”的概念。
先看对于上面这个问题的解决办法
背景:
上面这两行也可以为空
这一行一定要
前景:
!M_EGROUP 10, 5, 0, "a", " a "
!M_EGROUP 0, 0, 0, "b", "*[42m b *[0;1m"
!M_EGROUP 0, 0, PERM_SPECIAL4, "c", "*[43m c *[0;1m"
这样,就能达到所需要的效果了。
为什么呢? 我们来看一下代码,背景第三行已经预设为绿色,也就是说如果不出现
意外,这里将会是一个绿色块。呵呵,当一个拥有PERM_SPECIAL4权限的人来的时候,
意外出现了,系统用 c 正好覆盖掉了背景种的这一段代码,因此这一个位置
就按照前景的代码进行显示了。
这只是一个非常小的例子,实际应用当中,会更复杂一些,对于前景和背景的巧妙
配合,以至于计较每一个字节,都是很正常的事情。
以上说道的三种方案,各有用武之地,并且各有各的技巧,并不是说第三个方案
一定是最好的。
以第二个方案而言,参看暨南园的信件区,普通用户能看到右边有一个信封图案,
而新注册的id则看不到,但是仍然能看到另外的一些图案。仔细观察就能发现,这正是
完整图案去掉了新注册用户看不到的选项行的背景之后剩下的。而这两种图案都很
自然,看不出是裁剪下来的,这正是巧妙选择了背景图案、安排菜单位置以及应用
menu的0,0继承关系所作出来的效果。
上面这么多,仅仅是介绍了扩展制作方法的原理和一些基本技巧,对于这些的
掌握和灵活应用,有待于多加练习,相信我们的menu都能越来越pp!
Enjoy it!
shipping
2003-01-13 @Fudan
PS: 所有文字来源于参研了惠州明月湾,暨南园等BBS的menu作品以及领受了zixiaBBS
众位大虾的指点,在此一并致谢 //bow
※ 来源:·日月光华 bbs.fudan.edu.cn·[FROM: 10.100.174.156]
Sender: shipping Xiaoping I don’t come here often, message area: ANSI
Title: How to create menu.ini extension (replenished)
Sending site: Sun and Moon Guanghua January 13, 2003 20:22:41 Monday, site mail
This is the 8th article from getting started to mastering menu.ini. It is also a supplement and summary to the 6th and 7th articles.
It mainly talks about the principle and some applications of the so-called menu.ini extension production method.
Thank you very much to the art director of Nanyuan BBS station. I'm sorry that I can't remember the ID in menu.ini.
It inspired me to summarize this method from more perspectives and at a higher level.
OK let's continue
First, let’s talk about the interpretation process of menu.ini by firebird system.
: This process is very simple. It is to use the foreground code to cover the background code and finally form the interface.
There are two words in the above sentence that I would like to pay attention to. One is code. At this stage, all graphics
Text control characters are processed in the form of codes. In other words, the system does not know that *[31m is to be displayed.
The color is red, but I only know that it has 5 characters. Even the Chinese characters cannot be recognized, but I only know that it has two characters.
One Chinese character has two characters. The reason why I emphasize this point is that the effect will be shown below.
The second word is coverage. To put it figuratively speaking, the system first writes the background code on paper, and then writes the foreground code
override without ever considering whether to break the background code itself
Okay let's look at an example
For example, the background code of this line is
[abcdefghijkl]
0123456789012345678901234 This line is the abscissa ruler
The corresponding foreground code is 10,7,0 test" "*[32m test *[0;1m"
Note that here, all the code in the foreground will be overlaid to the corresponding position on the background intact. And on the background
abcd...etc. will all be overwritten.
Let’s look at a failed example. Below I will not give the foreground menu code but directly give the effect code.
should be easier to understand
foreground *[31m test *[0;1m
Background *[31m test *[0;1m
You can see that the code is the same, but the position is a little different. So what is the final code?
Result *[31m test *[0;1mm
The result is that there is an extra m at the end
conversely if
foreground *[31m test *[0;1m
Background *[31m test *[0;1m
Result **[31m test *[0;1m
This result is more serious
The difference is a little bigger
foreground *[31m test *[0;1m
Background *[31m test *[0;1m
Result *[*[31m test *[0;1m
This has caused confusion
The above are all relatively failed examples. Let’s talk about how to rationally use this coverage effect to make our
menu is more natural
Method 1 Full background solution
This solution is described in more detail in Chapter 6 of this tutorial and will not be repeated.
: Advantages: It has great benefits in beautifying the interface.
: Disadvantages: Menu cannot be differentiated based on permissions
Method 2: All-prospective plan
This solution is mentioned in Chapter 7 of this tutorial, but it is not explained in detail here.
The implementation method is to use empty background or use all spaces or not load the background block in the menu at all.
And all the menu content is added to the foreground block, for example
!M EGROUP 10, 5, 0, "EGroup", "*[42m E Classified Discussion Forum *[0;1m !!!"
Of course, there are menu options between the two ms, and the stuff after that is obviously the content of the background.
Put it in the foreground statement
: Advantages: It can provide a good solution to the problem of permission-differentiated menus that cannot be solved by the full-background solution.
: Disadvantages: It can only control up to 14 lines. This is the upper and lower width of the general bbs background.
Someone may have asked. The top and bottom width is only 14 lines. Isn’t it just right? How can this be considered a shortcoming?
Here is a practical example. We hope to see such an effect. What people with ordinary permissions see is
a
b
< Note that there are no menu options here anymore
And what people with certain special permissions see is
a
b
c
< There are no menu options here either.
This example cannot be achieved no matter which of the above solutions is adopted, so we will introduce the following
Third option
Solution 3 Background and foreground coverage solution
It can be seen that the first and second options are two extreme options. Combine the two options.
Naturally, better results can be achieved. Here, the concept of coverage introduced earlier will be used.
Let’s first look at the solution to the above problem
background
The above two lines can also be empty
This line must be
prospect:
!M EGROUP 10, 5, 0, "a", " a "
!M EGROUP 0, 0, 0, "b", "*[42m b *[0;1m"
!M EGROUP 0, 0, PERM SPECIAL4, "c", "*[43m c *[0;1m"
In this way, the required effect can be achieved
Why? Let's take a look at the code. The third line of the background has been preset to green. That is to say, if it does not appear
Accidentally, there will be a green block here. Haha. When a person with PERM SPECIAL4 permissions comes
An accident occurred. The system used c to overwrite the code in the background, so this position
It is displayed according to the foreground code.
This is just a very small example. In actual application, it will be more complicated. The foreground and background are clever.
Cooperate so that it is normal to count every byte.
The three options mentioned above each have their own uses and techniques. This does not mean that the third option
Must be the best
For the second option, please refer to the letter area of Jinan Park. Ordinary users can see an envelope pattern on the right.
The newly registered ID cannot be seen, but you can still see some other patterns. If you look closely, you can find that this is
The full pattern removes the background of the option row that newly registered users cannot see. Both patterns are very
Naturally, it can’t be seen that it was cropped. This is the clever choice of background pattern, arrangement of menu positions and applications.
The effect caused by the 0,0 inheritance relationship of menu
The above is just an introduction to the principles and some basic techniques of extended production methods. For these
It takes more practice to master and apply it flexibly. I believe our menu will become more and more pp.
Enjoy it!
shipping
2003 01 13 @Fudan
PS: All text comes from researching the menu works of BBS such as Huizhou Mingyue Bay and Ji Nanyuan and receiving zixiaBBS
Thanks to all the prawns for their advice bow
Source: Sun and Moon Guanghua bbs.fudan.edu.cn [FROM: 10.100.174.156]