1
0
Fork 0

Add option to move chat to the left and align left.

This commit is contained in:
Michael Danilov 2021-01-13 22:43:12 +01:00
parent a2c3c4c3d8
commit 51972c51ee
3 changed files with 21 additions and 4 deletions

View file

@ -549,7 +549,7 @@ _setlistener("/sim/signals/nasal-dir-initialized", func {
#-- Init ----------------------------------------------------------------------- #-- Init -----------------------------------------------------------------------
if (getprop("/sim/chat-on-the-left")) { if (getprop("/sim/gui/chat-box-location") == "left") {
property_display = display.new(5, -250); property_display = display.new(5, -250);
} else { } else {
property_display = display.new(5, -25); property_display = display.new(5, -25);
@ -571,7 +571,7 @@ setlistener("/sim/gui/current-style", func {
theme_font = getprop("/sim/gui/selected-style/fonts/message-display/name"); theme_font = getprop("/sim/gui/selected-style/fonts/message-display/name");
}, 1); }, 1);
if (getprop("/sim/chat-on-the-left")) { if (getprop("/sim/gui/chat-box-location") == "left") {
log = window.new(5, -30, 10, 10); log = window.new(5, -30, 10, 10);
log.align = "left"; log.align = "left";
} else { } else {

View file

@ -730,6 +730,7 @@ Started September 2000 by David Megginson, david@megginson.com
<style n="0" include="gui/styles/tortola.xml"/> <style n="0" include="gui/styles/tortola.xml"/>
<style n="1" include="gui/styles/anthrax.xml"/> <style n="1" include="gui/styles/anthrax.xml"/>
<devel-widgets type="bool" userarchive="y">false</devel-widgets> <devel-widgets type="bool" userarchive="y">false</devel-widgets>
<chat-box-location type="string" userarchive="y">default</chat-box-location>
</gui> </gui>
<mouse> <mouse>
<hide-cursor type="bool" userarchive="y">true</hide-cursor> <hide-cursor type="bool" userarchive="y">true</hide-cursor>
@ -899,7 +900,6 @@ Started September 2000 by David Megginson, david@megginson.com
<auto-attach type="bool" userarchive="y">true</auto-attach> <auto-attach type="bool" userarchive="y">true</auto-attach>
</mp-carriers> </mp-carriers>
<freeze-mouse-flight-controls-on-pause type="bool" userarchive="n">true</freeze-mouse-flight-controls-on-pause> <freeze-mouse-flight-controls-on-pause type="bool" userarchive="n">true</freeze-mouse-flight-controls-on-pause>
<chat-on-the-left type="bool" userarchive="y">false</chat-on-the-left>
</sim> </sim>
<!-- accelerations --> <!-- accelerations -->
<accelerations> <accelerations>

View file

@ -48,6 +48,12 @@
target.getNode("property").setValue(enabled.getPath()); target.getNode("property").setValue(enabled.getPath());
} }
} }
if (getprop("/sim/gui/chat-box-location") == "left") {
setprop("/sim/gui/dialogs/view/chat-box-left-checked", 1);
} else {
setprop("/sim/gui/dialogs/view/chat-box-left-checked", 0);
}
</open> </open>
</nasal> </nasal>
@ -148,12 +154,23 @@
</checkbox> </checkbox>
<checkbox> <checkbox>
<live>true</live>
<halign>left</halign> <halign>left</halign>
<label>Chat and event log on the left (requires restart)</label> <label>Chat and event log on the left (requires restart)</label>
<property>/sim/chat-on-the-left</property> <property>/sim/gui/dialogs/view/chat-box-left-checked</property>
<binding> <binding>
<command>dialog-apply</command> <command>dialog-apply</command>
</binding> </binding>
<binding>
<command>nasal</command>
<script>
if (getprop("/sim/gui/dialogs/view/chat-box-left-checked")) {
setprop("/sim/gui/chat-box-location", "left");
} else {
setprop("/sim/gui/chat-box-location", "default");
}
</script>
</binding>
</checkbox> </checkbox>
<checkbox> <checkbox>