Closes #1279 Signed-off-by: falkTX <falktx@falktx.com>tags/v2.3.0
@@ -1258,7 +1258,12 @@ typedef enum { | |||||
/*! | /*! | ||||
* Hide-optional-gui message. | * Hide-optional-gui message. | ||||
*/ | */ | ||||
NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7 | |||||
NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7, | |||||
/*! | |||||
* Set client name id message. | |||||
*/ | |||||
NSM_CALLBACK_SET_CLIENT_NAME_ID = 8 | |||||
} NsmCallbackOpcode; | } NsmCallbackOpcode; | ||||
@@ -179,6 +179,9 @@ public: | |||||
lo_send_from(fReplyAddress, fServer, LO_TT_IMMEDIATE, "/nsm/client/gui_is_hidden", ""); | lo_send_from(fReplyAddress, fServer, LO_TT_IMMEDIATE, "/nsm/client/gui_is_hidden", ""); | ||||
} | } | ||||
break; | break; | ||||
case CB::NSM_CALLBACK_SET_CLIENT_NAME_ID: | |||||
break; | |||||
} | } | ||||
} | } | ||||
@@ -284,6 +287,12 @@ protected: | |||||
if (gStandalone.engineCallback != nullptr) | if (gStandalone.engineCallback != nullptr) | ||||
{ | { | ||||
fReadyActionOpen = false; | fReadyActionOpen = false; | ||||
gStandalone.engineCallback(gStandalone.engineCallbackPtr, | |||||
CB::ENGINE_CALLBACK_NSM, | |||||
0, | |||||
CB::NSM_CALLBACK_SET_CLIENT_NAME_ID, | |||||
0, 0, 0.0f, | |||||
clientNameId); | |||||
gStandalone.engineCallback(gStandalone.engineCallbackPtr, | gStandalone.engineCallback(gStandalone.engineCallbackPtr, | ||||
CB::ENGINE_CALLBACK_NSM, | CB::ENGINE_CALLBACK_NSM, | ||||
0, | 0, | ||||
@@ -1456,17 +1456,7 @@ public: | |||||
if (fClient == nullptr && clientName != nullptr) | if (fClient == nullptr && clientName != nullptr) | ||||
{ | { | ||||
#ifndef BUILD_BRIDGE | |||||
if (pData->options.processMode == ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS && fClientNamePrefix.isNotEmpty()) | |||||
{ | |||||
truncatedClientName = fClientNamePrefix; | |||||
truncatedClientName.truncate(truncatedClientName.rfind(".")); | |||||
} | |||||
else | |||||
#endif | |||||
{ | |||||
truncatedClientName = clientName; | |||||
} | |||||
truncatedClientName = clientName; | |||||
truncatedClientName.truncate(getMaxClientNameSize()); | truncatedClientName.truncate(getMaxClientNameSize()); | ||||
} | } | ||||
@@ -897,6 +897,9 @@ NSM_CALLBACK_SHOW_OPTIONAL_GUI = 6 | |||||
# Hide-optional-gui message. | # Hide-optional-gui message. | ||||
NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7 | NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7 | ||||
# Set client name id message. | |||||
NSM_CALLBACK_SET_CLIENT_NAME_ID = 8 | |||||
# --------------------------------------------------------------------------------------------------------------------- | # --------------------------------------------------------------------------------------------------------------------- | ||||
# Engine Option | # Engine Option | ||||
# Engine options. | # Engine options. | ||||
@@ -2490,7 +2490,6 @@ class HostWindow(QMainWindow): | |||||
# Open | # Open | ||||
elif opcode == NSM_CALLBACK_OPEN: | elif opcode == NSM_CALLBACK_OPEN: | ||||
self.fClientName = os.path.basename(valueStr) | |||||
self.fProjectFilename = QFileInfo(valueStr+".carxp").absoluteFilePath() | self.fProjectFilename = QFileInfo(valueStr+".carxp").absoluteFilePath() | ||||
self.setProperWindowTitle() | self.setProperWindowTitle() | ||||
@@ -2514,6 +2513,11 @@ class HostWindow(QMainWindow): | |||||
elif opcode == NSM_CALLBACK_HIDE_OPTIONAL_GUI: | elif opcode == NSM_CALLBACK_HIDE_OPTIONAL_GUI: | ||||
self.hideForNSM() | self.hideForNSM() | ||||
# Set client name | |||||
elif opcode == NSM_CALLBACK_SET_CLIENT_NAME_ID: | |||||
self.fClientName = valueStr | |||||
return | |||||
self.host.nsm_ready(opcode) | self.host.nsm_ready(opcode) | ||||
# -------------------------------------------------------------------------------------------------------- | # -------------------------------------------------------------------------------------------------------- | ||||