Exemplo n.º 1
0
  //
  // Retrieve
  //
  // Retrieve data from the task, return TRUE if filled
  //
  Bool UnitRecycle::Retrieve(U32 id, RetrievedData &data)
  {
    switch (id)
    {
      case TaskRetrieve::Progress:
        data.u1 = GetNameCrc();
        data.f1 = GetProgress();
        return (TRUE);

      case TaskRetrieve::Info:
      {
        if (inst.Test(0xB9EBA067)) // "Decycle"
        {
          data.s2 = TRANSLATE(("#game.client.hud.tasks.recycle.cancel"));
        }
        else
        {
          data.s2 = TRANSLATE(("#game.client.hud.tasks.recycle.process"));
        }
        return (TRUE);
      }
    }

    return (GameTask<UnitObjType, UnitObj>::Retrieve(id, data));
  }
  //
  // Retrieve
  //
  // Retrieve data from the task, return TRUE if filled
  //
  Bool UnitConstruct::Retrieve(U32 id, RetrievedData &data)
  {
    switch (id)
    {
      case TaskRetrieve::Progress:
      {
        data.f1 = GetProgress();
        data.u1 = GetNameCrc();
        return (TRUE);
      }

      case TaskRetrieve::Info:
      {
        // Are we constructing
        if (inst.Test(0x4E5A04E4)) // "Construct"
        {
          data.s2 = TRANSLATE(("#game.client.hud.tasks.construct.process"));
          return (TRUE);
        }

        if (inst.Test(0xF073DD95)) // "Paused"
        {
          data.s2 = TRANSLATE(("#game.client.hud.tasks.construct.paused"));
          return (TRUE);
        }

        return (FALSE);
      }
    }

    return (GameTask<UnitObjType, UnitObj>::Retrieve(id, data));
  }