|
@@ -813,6 +813,33 @@ void* laget_FirstInputMapping(void* unused1,void* unused2){
|
|
|
void* laget_CurrentInputMapping(laInputMappingBundle* imb){
|
|
|
return imb->CurrentInputMapping;
|
|
|
}
|
|
|
+void* laget_FirstCustomSignal(void* unused1,void* unused2){
|
|
|
+ return MAIN.CustomSignals.pFirst;
|
|
|
+}
|
|
|
+void laset_InputMappingEntrySignal(laInputMappingEntry* ime, laCustomSignal* cs){
|
|
|
+ if(cs){ strSafeSet(&ime->Signal,SSTR(cs->Name)); ime->SignalValue=cs->Signal; }
|
|
|
+ else{ strSafeSet(&ime->Signal,"none"); ime->SignalValue=0; }
|
|
|
+}
|
|
|
+void laset_InputMappingEntryKeyString(laInputMappingEntry* ime, char* key){
|
|
|
+ strSafeSet(&ime->Key,key); laInputMappingUpdateSignal(ime);
|
|
|
+}
|
|
|
+void laset_InputMappingEntrySignalString(laInputMappingEntry* ime, char* sig){
|
|
|
+ strSafeSet(&ime->Signal,sig); laInputMappingUpdateSignal(ime);
|
|
|
+}
|
|
|
+void laset_SignalFilter(void* unused, char* sig){
|
|
|
+ strSafeSet(&MAIN.SignalFilter,sig);
|
|
|
+ laNotifyUsers("la.filtered_signals");
|
|
|
+}
|
|
|
+void* laget_FirstFilteredCustomSignal(void* unused1,laPropIterator* pi){
|
|
|
+ laCustomSignal* p = MAIN.CustomSignals.pFirst;
|
|
|
+ while(!strstr(SSTR(p->Name),SSTR(MAIN.SignalFilter))){ p=p->Item.pNext; if(!p){ return 0; } }
|
|
|
+ return p;
|
|
|
+}
|
|
|
+void* lagetnext_FilteredSignal(laCustomSignal* p, laPropIterator* pi){
|
|
|
+ p=p->Item.pNext; if(!p){ return 0; }
|
|
|
+ while(!strstr(SSTR(p->Name),SSTR(MAIN.SignalFilter))){ p=p->Item.pNext; if(!p){ return 0; } }
|
|
|
+ return p;
|
|
|
+}
|
|
|
|
|
|
void tnspost_World(tnsWorld *w){
|
|
|
tnsRefreshMaterialLibraries();
|
|
@@ -1500,7 +1527,10 @@ void la_RegisterInternalProps(){
|
|
|
if(MAIN.InitArgs.HasAudio) laAddSubGroup(p, "audio", "Audio", "Audio data","la_audio",0,0,0,offsetof(LA,Audio),0,0,0,0,0,0,0,LA_UDF_SINGLE);
|
|
|
|
|
|
laAddSubGroup(p,"input_mapping","Input Mapping","Input mapping bundle","la_input_mapping_bundle",0,0,0,offsetof(LA,InputMapping),0,0,0,0,0,0,0,LA_UDF_SINGLE);
|
|
|
-
|
|
|
+ laAddStringProperty(p,"signal_filter","Signal Filter","Filter displayed signals",0,0,0,0,1,offsetof(LA,SignalFilter),0,0,laset_SignalFilter,0,0);
|
|
|
+ laAddSubGroup(p,"custom_signals","Signals","Registered custom signals","la_custom_signal",0,0,laui_IdentifierOnly,-1,laget_FirstCustomSignal,0,laget_ListNext,0,0,0,0,LA_UDF_IGNORE);
|
|
|
+ laAddSubGroup(p,"filtered_signals","Filtered Signals","Filtered custom signals","la_custom_signal",0,0,laui_IdentifierOnly,-1,laget_FirstFilteredCustomSignal,0,lagetnext_FilteredSignal,0,0,0,0,LA_UDF_IGNORE);
|
|
|
+
|
|
|
laAddStringProperty(p, "identifier", "Identifier", "Identifier", 0,0,0,0,0,0,0,laget_MainIdentifier, 0,0,LA_AS_IDENTIFIER|LA_READ_ONLY);
|
|
|
laAddSubGroup(p, "test_ucn", "TEST UCN", "---", "udf_content_node",0,0,0,offsetof(LA, TEST_Link), 0,0,0,0,0,0,0,0);
|
|
|
|
|
@@ -1714,7 +1744,7 @@ void la_RegisterInternalProps(){
|
|
|
p = laAddPropertyContainer("la_input_mapping", "Input Mapping", "Input mapping data", 0,0,sizeof(laInputMapping), 0,0,2);{
|
|
|
laAddStringProperty(p, "name", "Name", "The name of this mapping", 0,0,0,"Mapping", 1, offsetof(laInputMapping, Name), 0,0,0,0,LA_AS_IDENTIFIER);
|
|
|
laAddSubGroup(p, "entries","Entries","Input mapping entries","la_input_mapping_entry",0,0,0,-1,0,0,0,0,0,0,offsetof(laInputMapping,Entries),0);
|
|
|
- laAddOperatorProperty(p,"remove","Remove","Remove this mapping","LA_new_remove_mapping",U'🞫',0);
|
|
|
+ laAddOperatorProperty(p,"remove","Remove","Remove this mapping","LA_remove_input_mapping",U'🞫',0);
|
|
|
laAddOperatorProperty(p,"new_entry","New Entry","New mapping entry","LA_new_input_mapping_entry",'+',0);
|
|
|
}
|
|
|
p = laAddPropertyContainer("la_input_mapping_entry", "Input Mapping Entry", "Input mapping entry", 0,0,sizeof(laInputMappingEntry), 0,0,1);{
|
|
@@ -1722,9 +1752,15 @@ void la_RegisterInternalProps(){
|
|
|
laAddEnumItemAs(ep, "KEYBOARD", "Keyboard", "Keyboard input", LA_INPUT_DEVICE_KEYBOARD, 0);
|
|
|
laAddEnumItemAs(ep, "JOYSTICK", "Joystick", "Joystick input", LA_INPUT_DEVICE_JOYSTICK, 0);
|
|
|
laAddIntProperty(p,"joystick_device","Joystick Device","Joystick device number",0,0,0,0,0,0,0,0,offsetof(laInputMappingEntry,JoystickDevice),0,0,0,0,0,0,0,0,0,0,0);
|
|
|
- laAddStringProperty(p,"key","Key","Event key",0,0,0,0,1,offsetof(laInputMappingEntry,Key),0,0,0,0,0);
|
|
|
- laAddStringProperty(p,"message","Message","Target message",0,0,0,0,1,offsetof(laInputMappingEntry,TargetMessage),0,0,0,0,0);
|
|
|
- laAddOperatorProperty(p,"remove","Remove","Remove this entry","LA_new_remove_mapping_entry",U'🞫',0);
|
|
|
+ laAddStringProperty(p,"key","Key","Event key",0,0,0,0,1,offsetof(laInputMappingEntry,Key),0,0,laset_InputMappingEntryKeyString,0,0);
|
|
|
+ laAddStringProperty(p,"signal","Signal","Target signal",0,0,0,0,1,offsetof(laInputMappingEntry,Signal),0,0,laset_InputMappingEntrySignalString,0,0);
|
|
|
+ laAddSubGroup(p,"signal_selection","Signal","Signal selection","la_custom_signal",0,0,laui_IdentifierOnly,-1,laget_FirstCustomSignal,0,laget_ListNext,laset_InputMappingEntrySignal,0,0,0,LA_UDF_IGNORE);
|
|
|
+ laAddOperatorProperty(p,"remove","Remove","Remove this entry","LA_remove_input_mapping_entry",U'🞫',0);
|
|
|
+ laAddOperatorProperty(p,"select_signal","Select","Select signal","LA_input_mapping_entry_select_signal",0,0);
|
|
|
+ laAddOperatorProperty(p,"select_key","Select Key","Select key","LA_input_mapping_entry_select_key",0,0);
|
|
|
+ }
|
|
|
+ p = laAddPropertyContainer("la_custom_signal", "Custom Signal", "Custom signal", 0,0,sizeof(laCustomSignal), 0,0,1);{
|
|
|
+ laAddStringProperty(p, "name", "Name", "The name of this mapping", 0,0,0,"Mapping", 1, offsetof(laCustomSignal, Name), 0,0,0,0,LA_AS_IDENTIFIER);
|
|
|
}
|
|
|
|
|
|
p = laAddPropertyContainer("la_translation_language", "Language", "Translation language pack", 0,0,sizeof(laTranslationNode), 0,0,1);{
|
|
@@ -2019,3 +2055,9 @@ void la_RegisterInternalProps(){
|
|
|
|
|
|
la_RegisterTNSProps();
|
|
|
}
|
|
|
+
|
|
|
+void la_RegisterDefaultSignals(){
|
|
|
+ laNewCustomSignal("la.new",LA_SIGNAL_NEW);
|
|
|
+ laNewCustomSignal("la.delete",LA_SIGNAL_DELETE);
|
|
|
+ laNewCustomSignal("la.confirm",LA_SIGNAL_CONFIRM);
|
|
|
+}
|