Author Topic: guiMessageVectorCtrl crashes when I try to use it  (Read 885 times)

like the title says, when I try to use a guiMessageVectorCtrl, the game crashes on me.

Here is my GUI:
Code: [Select]
//--- OBJECT WRITE BEGIN ---
new GuiControl(connectifyGui) {
   profile = "GuiDefaultProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "640 480";
   minExtent = "8 2";
   enabled = "1";
   visible = "1";
   clipToParent = "1";

   new GuiWindowCtrl(connectifyGuiWindow) {
      profile = "GuiWindowProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "135 134";
      extent = "384 256";
      minExtent = "64 64";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      text = "Connectify - Alpha";
      maxLength = "255";
      resizeWidth = "0";
      resizeHeight = "0";
      canMove = "1";
      canClose = "1";
      canMinimize = "0";
      canMaximize = "0";
      minSize = "64 64";
      closeCommand = "Canvas.popDialog(connectifyGui);";

      new GuiTextEditCtrl(connectifyChatbox) {
         profile = "GuiTextEditProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "14 223";
         extent = "280 18";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         variable = "$connectifyChatMessage";
         maxLength = "64";
         historySize = "0";
         password = "0";
         tabComplete = "0";
         sinkAllKeyEvents = "0";
      };
      new GuiBitmapButtonCtrl(connectifySendButton) {
         profile = "BlockButtonProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "300 217";
         extent = "75 30";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         command = "Connectify_MsgVector.pushBackLine($connectifyChatMessage,0);connectifyChatbox.setValue(\"\");";
         text = "Send";
         groupNum = "-1";
         buttonType = "PushButton";
         bitmap = "base/client/ui/button2";
         lockAspectRatio = "0";
         alignLeft = "0";
         alignTop = "0";
         overflowImage = "0";
         mKeepCached = "0";
         mColor = "255 255 255 255";
      };
      new GuiMessageVectorCtrl(connectifyMessageVectorControl) {
         profile = "GuiTextProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "16 36";
         extent = "350 170";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         lineSpacing = "0";
         lineContinuedIndex = "10";
         matchColor = "0 0 255 255";
         maxColorIndex = "9";
      };
   };
};
//--- OBJECT WRITE END ---

and here is my client side code for attaching it
Code: [Select]
function connectifyGui::onWake(%this)
{
if(!isObject(Connectify_MsgVector))
new MessageVector(Connectify_MsgVector);

connectifyMessageVectorControl.attach(Connectify_MsgVector);
}

when I press the 'send' button, game crashes.

manually doing
Code: [Select]
Connectify_MsgVector.pushBackLine($connectifyChatMessage,0);crashes as well

any help?

I've never even heard of this control. Are you certain that it actually works?

I've never even heard of this control. Are you certain that it actually works?
It's used in RTB, and I found 2 coding help topics on the forums with it. It seems obscure, but in those topics and RTB it works. I don't know what I'm doing something wrong.

I've never seen someone use connectifyChatbox.variable = $connectifyChatMessage; So I'm unsure if that works. It probably won't help, but you could try swapping that with:
Code: [Select]
connectifyChatbox.getValue();
to get the TextEditCtrl's text.

I've never seen someone use connectifyChatbox.variable = $connectifyChatMessage; So I'm unsure if that works. It probably won't help, but you could try swapping that with:
Code: [Select]
connectifyChatbox.getValue();
to get the text.

Already tried that, same result.

Your fix: You need to put the GuiMessageVectorCtrl in a GuiScrollCtrl.
Doing so will give you these results:


Edit: You'll might also want to modify some stuff to set padding and give your box multi-line support. I have a similar mod to yours that was made over a year ago. If you want I can send you that.
« Last Edit: February 05, 2015, 01:25:26 AM by Static »

I've never even heard of this control. Are you certain that it actually works?

It's used for the chat message HUD.

Your fix: You need to put the GuiMessageVectorCtrl in a GuiScrollCtrl.
Thank you soooo much <3 :D.