Example #1
0
 public override bool ReadINIText(clsSplitCommaText SplitText)
 {
     if (!base.ReadINIText(SplitText))
     {
         return false;
     }
     if (SplitText.PartCount < 4)
     {
         return false;
     }
     if (!modIO.InvariantParse_sng(SplitText.Parts[3], ref this.Alpha))
     {
         this.Alpha = 1f;
     }
     return true;
 }
 public bool Translate(string Text)
 {
     int num;
     clsSplitCommaText text = new clsSplitCommaText(Text);
     if ((text.PartCount >= 2) && modIO.InvariantParse_int(text.Parts[0], ref num))
     {
         this.Pos.X = num;
     }
     else
     {
         return false;
     }
     if (modIO.InvariantParse_int(text.Parts[1], ref num))
     {
         this.Pos.Y = num;
         return true;
     }
     return false;
 }
Example #3
0
 public virtual bool ReadINIText(clsSplitCommaText SplitText)
 {
     sRGB_sng _sng;
     if (SplitText.PartCount < 3)
     {
         return false;
     }
     if (!modIO.InvariantParse_sng(SplitText.Parts[0], ref _sng.Red))
     {
         return false;
     }
     if (!modIO.InvariantParse_sng(SplitText.Parts[1], ref _sng.Green))
     {
         return false;
     }
     if (!modIO.InvariantParse_sng(SplitText.Parts[2], ref _sng.Blue))
     {
         return false;
     }
     this.Red = _sng.Red;
     this.Green = _sng.Green;
     this.Blue = _sng.Blue;
     return true;
 }
Example #4
0
 public static bool WZAngleFromINIText(string Text, ref modProgram.sWZAngle Result)
 {
     modProgram.sWZAngle angle;
     clsSplitCommaText text = new clsSplitCommaText(Text);
     if (text.PartCount != 3)
     {
         return false;
     }
     if (!InvariantParse_ushort(text.Parts[0], ref angle.Direction))
     {
         int num;
         int remaidner;
         if (!InvariantParse_int(text.Parts[0], ref num))
         {
             return false;
         }
         int mulitplaier = Math.DivRem(num, 0x10000, out remaidner);
         try
         {
             if (remaidner < 0)
             {
                 angle.Direction = (ushort) (remaidner + 0x10000);
             }
             else
             {
                 angle.Direction = (ushort) remaidner;
             }
         }
         catch (Exception exception1)
         {
             ProjectData.SetProjectError(exception1);
             Exception exception = exception1;
             ProjectData.ClearProjectError();
             return false;
         }
         return true;
     }
     if (!InvariantParse_ushort(text.Parts[1], ref angle.Pitch))
     {
         return false;
     }
     if (!InvariantParse_ushort(text.Parts[2], ref angle.Roll))
     {
         return false;
     }
     Result = angle;
     return true;
 }
Example #5
0
 public static bool WorldPosFromINIText(string Text, ref modProgram.clsWorldPos Result)
 {
     clsSplitCommaText text = new clsSplitCommaText(Text);
     if (text.PartCount != 3)
     {
         return false;
     }
     int[] numArray = new int[3];
     int index = 0;
     do
     {
         int num2;
         if (InvariantParse_int(text.Parts[index], ref num2))
         {
             numArray[index] = num2;
         }
         else
         {
             return false;
         }
         index++;
     }
     while (index <= 2);
     modMath.sXY_int newHorizontal = new modMath.sXY_int(numArray[0], numArray[1]);
     modProgram.sWorldPos newWorldPos = new modProgram.sWorldPos(newHorizontal, numArray[2]);
     Result = new modProgram.clsWorldPos(newWorldPos);
     return true;
 }