hedgewars/uScript.pas
changeset 10210 1a6b9a98147c
parent 10150 fa5c83fd0ad9
child 10230 361d36ec5181
equal deleted inserted replaced
10209:76316652ef26 10210:1a6b9a98147c
  1075         if gear <> nil then
  1075         if gear <> nil then
  1076             begin
  1076             begin
  1077             vgear:= AddVisualGear(0, 0, vgtSpeechBubble, s, true);
  1077             vgear:= AddVisualGear(0, 0, vgtSpeechBubble, s, true);
  1078             if vgear <> nil then
  1078             if vgear <> nil then
  1079                begin
  1079                begin
       
  1080                if Gear^.Kind = gtHedgehog then
       
  1081                    begin
       
  1082                    AddChatString(#1+'[' + gear^.Hedgehog^.Name + '] '+vgear^.text);
       
  1083                    vgear^.Hedgehog:= gear^.Hedgehog
       
  1084                    end
       
  1085                else vgear^.Frame:= gear^.uid;
       
  1086 
  1080                vgear^.Text:= lua_tostring(L, 2);
  1087                vgear^.Text:= lua_tostring(L, 2);
  1081                vgear^.Hedgehog:= gear^.Hedgehog;
       
  1082                vgear^.FrameTicks:= lua_tointeger(L, 3);
  1088                vgear^.FrameTicks:= lua_tointeger(L, 3);
  1083                if (vgear^.FrameTicks < 1) or (vgear^.FrameTicks > 3) then
  1089                if (vgear^.FrameTicks < 1) or (vgear^.FrameTicks > 3) then
  1084                    vgear^.FrameTicks:= 1;
  1090                    vgear^.FrameTicks:= 1;
  1085                lua_pushinteger(L, vgear^.Uid);
  1091                lua_pushinteger(L, vgear^.Uid);
  1086                AddChatString(#1+'[' + gear^.Hedgehog^.Name + '] '+vgear^.text)
       
  1087                end
  1092                end
  1088             end
  1093             end
  1089             else
  1094             else
  1090                 lua_pushnil(L)
  1095                 lua_pushnil(L)
  1091         end
  1096         end