Author Topic: Add a label to the objects but without reserving the tile/quadrant.  (Read 498 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

I currently have to use "text labels" to label objects, but that is not a good solution.

I would like to implement this:
Code: [Select]
// place text to objects
void_t create_text_object(grund_t *gr,  const char* text)
{
    gr->set_text(text);
    return void_t();
}

// remover text in objects
void_t remover_text_object(grund_t *gr)
{
    const char* text=NULL;
    gr->set_text(text);
    return void_t();
}

    /**
     * Creates a text tag for objects.
     */
    register_method(vm, &create_text_object, "text_object", true);

    /**
     * Delete text tag on objects.
     */
    register_method(vm, &remover_text_object, "remover_text", true);

I already tried it and it does not seem to have side effects.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4204
  • Total likes: 158
  • Helpful: 148
  • Languages: EN, DE, AT
Re: Add a label to the objects but without reserving the tile/quadrant.
« Reply #1 on: April 11, 2017, 08:26:10 AM »
Why not using public player (pl==1) or the human player (pl==0) as owner?

Calling set_text directly may also remove station and city labels.
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: Add a label to the objects but without reserving the tile/quadrant.
« Reply #2 on: April 11, 2017, 12:21:05 PM »
Why not using public player (pl==1) or the human player (pl==0) as owner?

Calling set_text directly may also remove station and city labels.
The label text gives me some problems.
This also gives me the freedom to place texts anywhere and at no cost.

Calling set_text directly may also remove station and city labels.
That's no problem (You only have to know how and where to use), and you can even get a chance (to change the name of the station).


Offline Yona-TYT

Re: Add a label to the objects but without reserving the tile/quadrant.
« Reply #3 on: April 11, 2017, 03:55:55 PM »
Why not using public player (pl==1) or the human player (pl==0) as owner?
Currently it is impossible to do this:


I apologize for the double post.