1
0
Fork 0

chat: make it transparent; '+' key switches to full version; esc doesn't quit

chat_full: use "window" style (to save); '-' key switches to small version
This commit is contained in:
mfranz 2009-01-28 22:02:38 +00:00
parent ab8451d92c
commit 12a4321801
2 changed files with 151 additions and 104 deletions

View file

@ -3,68 +3,114 @@
<PropertyList>
<name>chat</name>
<modal>false</modal>
<layout>vbox</layout>
<resizable>true</resizable>
<layout>hbox</layout>
<default-padding>5</default-padding>
<group>
<layout>hbox</layout>
<color>
<enabled>false</enabled>
<red>0.5</red>
<green>0.5</green>
<blue>0.5</blue>
<alpha>0.3</alpha>
</color>
<input>
<name>compose</name>
<pref-width>500</pref-width>
<stretch>true</stretch>
<halign>fill</halign>
<length>50</length>
<property>/sim/multiplay/chat-compose</property>
</input>
<button-color>
<enabled>false</enabled>
<red>0.5</red>
<green>0.5</green>
<blue>0.5</blue>
<alpha>0.3</alpha>
</button-color>
<button>
<legend>Send</legend>
<default>true</default>
<key>Enter</key>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
var lchat = getprop("/sim/multiplay/chat-compose");
if (lchat != "")
{
setprop("/sim/multiplay/chat", lchat);
setprop("/sim/multiplay/chat-compose", "");
gui.dialog_update("chat", "compose");
}
</script>
</binding>
</button>
</group>
<button>
<legend>Close</legend>
<pref-width>45</pref-width>
<pref-height>30</pref-height>
<equal>true</equal>
<binding>
<command>dialog-close</command>
</binding>
<color>
<red alias="../../../button-color/red"/>
<green alias="../../../button-color/green"/>
<blue alias="../../../button-color/blue"/>
<alpha alias="../../../button-color/alpha"/>
</color>
</button>
<button>
<legend>More</legend>
<equal>true</equal>
<pref-width>45</pref-width>
<pref-height>30</pref-height>
<key>+</key>
<binding>
<command>dialog-show</command>
<dialog-name>chat-full</dialog-name>
</binding>
<binding>
<command>dialog-close</command>
</binding>
<color>
<red alias="../../../button-color/red"/>
<green alias="../../../button-color/green"/>
<blue alias="../../../button-color/blue"/>
<alpha alias="../../../button-color/alpha"/>
</color>
</button>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<input>
<name>compose</name>
<pref-width>500</pref-width>
<stretch>true</stretch>
<halign>fill</halign>
<length>50</length>
<property>/sim/multiplay/chat-compose</property>
<color>
<red>0.5</red>
<green>0.5</green>
<blue>0.5</blue>
<alpha>0.3</alpha>
</color>
<color-legend>
<red>1</red>
<green>1</green>
<blue>1</blue>
<alpha>1</alpha>
</color-legend>
<font>
<name>FIXED_9x15</name>
</font>
</input>
<button>
<legend>Close</legend>
<default>true</default>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<legend>More v</legend>
<default>false</default>
<binding>
<command>dialog-show</command>
<dialog-name>chat-full</dialog-name>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<empty><stretch>true</stretch></empty>
</group>
<button>
<legend>Send</legend>
<default>true</default>
<pref-width>45</pref-width>
<pref-height>30</pref-height>
<equal>true</equal>
<key>Enter</key>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
var lchat = getprop("/sim/multiplay/chat-compose");
if (lchat != "")
{
setprop("/sim/multiplay/chat", lchat);
setprop("/sim/multiplay/chat-compose", "");
gui.dialog_update("chat", "compose");
}
</script>
</binding>
<color>
<red alias="../../../button-color/red"/>
<green alias="../../../button-color/green"/>
<blue alias="../../../button-color/blue"/>
<alpha alias="../../../button-color/alpha"/>
</color>
</button>
</PropertyList>

View file

@ -6,9 +6,43 @@
<layout>vbox</layout>
<resizable>true</resizable>
<text>
<label>Multiplayer Chat</label>
</text>
<group>
<layout>hbox</layout>
<button>
<legend>-</legend>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<border>2</border>
<key>-</key>
<binding>
<command>dialog-show</command>
<dialog-name>chat</dialog-name>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<empty><stretch>1</stretch></empty>
<text>
<label>Multiplayer Chat</label>
</text>
<empty><stretch>1</stretch></empty>
<button>
<legend></legend>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<border>2</border>
<keynum>27</keynum>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
@ -18,6 +52,7 @@
<stretch>true</stretch>
<pref-width>550</pref-width>
<pref-height>120</pref-height>
<padding>5</padding>
<slider>20</slider>
<live>true</live>
<wrap>true</wrap>
@ -25,21 +60,19 @@
<property>/sim/multiplay/chat-history</property>
</textbox>
<text>
<label></label>
</text>
<group>
<layout>hbox</layout>
<padding>4</padding>
<input>
<name>compose</name>
<stretch>true</stretch>
<halign>fill</halign>
<stretch>true</stretch>
<length>50</length>
<pref-width>500</pref-width>
<property>/sim/multiplay/chat-compose</property>
<name>compose</name>
<stretch>true</stretch>
<halign>fill</halign>
<stretch>true</stretch>
<length>50</length>
<pref-width>500</pref-width>
<property>/sim/multiplay/chat-compose</property>
<binding><command>nasal</command><script>gui.popupTip("WOOHOO!")</script></binding>
</input>
<button>
@ -63,36 +96,4 @@
</binding>
</button>
</group>
<text>
<label></label>
</text>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<button>
<legend>Close</legend>
<default>true</default>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<legend>Less ^</legend>
<default>false</default>
<binding>
<command>dialog-show</command>
<dialog-name>chat</dialog-name>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<empty><stretch>true</stretch></empty>
</group>
</PropertyList>