Menu Icons and Reactions in TPT++

  • p123aradise
    14th Jan 2013 Member 0 Permalink

    So I've added a menu, I just can't figure out where or how to add an icon. How do I?

     

    Also, I've got an element that I'd like to have produce another element when in contact with fire.

    So i've used the regular for loops and an if to produce the r = sim->pmap[y+ry][x+rx] and rt = (r&0xFF).

    Then i use if (rt==PT_FIRE) and say sim->part_change_type(i,x,y,PT_MGO).

    But the element never responds to the fire. What am i doing wrong? All the tutorials and other elements i've seen do exactly this.

  • mniip
    14th Jan 2013 Developer 0 Permalink
    @p123aradise (View Post)
    1)see simulation/SimulationData.cpp
    2) ==, not =
  • p123aradise
    14th Jan 2013 Member 0 Permalink

    @mniip (View Post)

    about #2: That was just a typo. I use the correct == in my code.

    Also, i know that the menus are in SimulationData.cpp, but the code for their icon ("\xC1","\x99" etc), i don't understand where it comes from or what it references. They're not UTF-8 symbols, so they must be somewhere else in the code.

  • p123aradise
    16th Jan 2013 Member 0 Permalink

    sorry, but i'd like a better answer. bump.

  • Pilihp64
    17th Jan 2013 Developer 0 Permalink

    It would be very helpful to see the entire update function or element file, just put it on pastebin or something.

    The icons are a bit harder to add, which are with the normal font (font.h) which is generated from the 'font' folder, which has its own editor you would need to compile.

  • p123aradise
    18th Jan 2013 Member 0 Permalink
  • jacksonmj
    18th Jan 2013 Developer 0 Permalink

    x+rx>XRES && y+ry>=YRES

    should be

    x+rx<XRES && y+ry<YRES

  • p123aradise
    18th Jan 2013 Member 0 Permalink

    @jacksonmj (View Post)

     Wow. thanks. One typo...

  • jacob1
    19th Jan 2013 Developer 0 Permalink
    @p123aradise (View Post)
    if you want to add an icon, are you using an existing one, or making your own? There is a guide on the wiki called "adding an icon to menus" if you want your own, if you don't, just use the same icon character as an existing one.
  • p123aradise
    30th Jan 2013 Member 0 Permalink

    @jacob1 (View Post)

     yes, i've seen the wiki article, i guess the last time i saw it was when the guide for the new source had not been added. I'll follow the new one.