Hello!
I'm using OXPConfig for my planned
Long Range Scanner (for which, btw, suggestions are always very welcome!), and I've got a question:
I'm using OXPConfig to allow the user to define which key-combo (e.g. F7-F6-F7) he wants to use to enter the LRS-configuration-screen. Therefore, I'd like to use the value of a variable to be printed as part of the InfoS-String, because I'd like to show it the current settings (since the hexadecimal representation of the sliders might be a little hard to read for normal users). So what I did was:
Code: Select all
this.oxpcSettings = {
Info: {
Name:this.name,
Display:"GGIndustries LRS",
Notify: true,
InfoB:"Setup how to access the LRS configuration screen. If alwaysPrimable=true, the specials can be ignored. If not, they are used and default to F6-F6-F7.",
InfoS:"Current Setting: "+$getKeyComboAsString()+"\nSetup which key combo you want to use to open the LRS configuration screen.\nValues: 0->F5, 1->F6, 2->F7, 3->F8.\nKeys1-3 have to be set, Key4 is optional
},
Bool0: {Name:"$alwaysPrimable",Def:false,Desc:"access LRS configScreen through priming?"},
SInt0: {Name:"$key1st", Def:0x01, Max:0x03, Desc:"1st key of key combo."},
SInt1: {Name:"$key2nd", Def:0x01, Max:0x03, Desc:"2nd key of key combo."},
SInt2: {Name:"$key3rd", Def:0x02, Max:0x03, Desc:"3rd key of key combo."},
SInt3: {Name:"$key4th", Def:0x04, Max:0x04, Desc:"4th key of key combo."}
};
Note the embedded function call: InfoS:"Current Setting: "+
$getKeyComboAsString()+"\nSetup which key combo...
The called function looks like this:
Code: Select all
this.$getKeyComboAsString = function() {
var last = "";
if ($key4th <= 3) { last = "-F"+($key4th+5); }
return "F"+($key1st+5)+"-F"+($key2nd+5)+"-F"+($key3rd+5)+last
}
This works perfectly, but only one time (at start).
The value never gets updated, so when I change the key-combo, the InfoS-String still shows the old value
I've also tried to use a variable instead of a function call, but the results are the same. The shown InfoS-String is not updated after I've changed some values with OXPConfig.
Am I missing something? Or is it not possible?
Oooh, and while I'm at it, a short question: How did you manage to display text in different font sizes and on different positions on the screen?
I would like to have my configuration screen use such features, too (but I haven't looked into the OXPConfig-source for this yet, I admit)
EDIT: If you wanna have a look at my full script, you can find it here:
https://www.box.com/s/n2jwh3v10ymkovd3erzr