Results 1 to 7 of 7

Thread: Trap and Door icons flashing permanently

  
  1. #1
    Troll
    Join Date
    Jul 2016
    Location
    United Kingdom
    Posts
    257

    Default Trap and Door icons flashing permanently

    Hi,

    I've noticed that the Trap and Door icons (the top one, representing the selected Trap or Door not those on the grid) in the left-hand panel flash, and remain flashing after de-selection. Spell icons stop flashing on de-selection, but Trap and Door icons do not. Is this a bug? I'm not sure that Trap and Door Icons are supposed to flash at all, but they're certainly not supposed to after de-selection. I'm using the latest KeeperFX alpha (1896).

    Thanks.

  2. #2

    Default Re: Trap and Door icons flashing permanently

    Yes, I think this is a mistake. It's not a new mistake though.

    Do you know if this behavior was different in the original game?

    EDIT: I checked and no, this worked fine in the original game.
    Last edited by YourMaster; January 19th, 2019 at 10:51.

  3. #3
    Troll
    Join Date
    Jul 2016
    Location
    United Kingdom
    Posts
    257

    Default Re: Trap and Door icons flashing permanently

    Quote Originally Posted by YourMaster View Post
    Yes, I think this is a mistake. It's not a new mistake though.

    Do you know if this behavior was different in the original game?

    EDIT: I checked and no, this worked fine in the original game.
    Actually, I think it might be a new mistake; I saw a YouTube video of someone playing a new (I think, but I don't know exactly which version, though I'm pretty sure it's of unofficial) version of KeeperFX, and it doesn't have this behaviour. I also don't recall this happening in the original game.

    So, how can this be fixed?

  4. #4

    Default Re: Trap and Door icons flashing permanently

    I tested it with an official version and the behavior is there already. And it can be fixed like how any bug can be fixed, by finding the wrong behavior in the code and fixing it. Another way is trying old versions of keeperfx until you find the version where the wrong behavior starts, so you narrow it down the the exact commit where the wrong behavior is introduced, so you know which code causes the problem.

  5. #5
    Troll
    Join Date
    Jul 2016
    Location
    United Kingdom
    Posts
    257

    Default Re: Trap and Door icons flashing permanently

    I think I might have solved this.

    I've been looking through the code, and I think the problem is in frontmenu.ingame.tabs.c's gui_area_big_trap_button method. There are also the gui_area_big_spell_button and gui_area_big_room_button methods, and if you look towards the end of them, you'll see that they check to see if the game is in room-building or spell-casting mode to determine whether or not to draw a flashing icon. In gui_area_big_trap_button, there is no such check, so it always loads the flashing icon. The states PSt_PlaceDoor and PSt_PlaceTrap are defined in config_players.c, but never seem to be used. I think what needs to be done is encase (in gui_area_big_trap_button)

    draw_gui_panel_sprite_rmleft(gbtn->scr_pos_x - 4*units_per_px/16, gbtn->scr_pos_y - 32*units_per_px/16, ps_units_per_px, gbtn->sprite_idx, 44);
    } else {
    draw_gui_panel_sprite_left(gbtn->scr_pos_x - 4*units_per_px/16, gbtn->scr_pos_y - 32*units_per_px/16, ps_units_per_px, gbtn->sprite_idx);

    in a If player->work_state == PSt_PlaceDoor or PSt_PlaceTrap statement, or perhaps add that check to the preceding If statement (gui_area_big_room_button has a If player->work_state == PSt_BuildRoom check, and gui_area_big_spell_button has a If player->work_state == powerst->work_state check), that way (if I'm right), it will draw a flashing icon if in trap/door placement mode, and a non-flashing one if not (from what I can tell, rmleft is flashing, and left is non-flashing)

    Sorry if this is a bit technical. I'll try to explain more clearly if you don't understand.
    Last edited by AdamP; September 12th, 2019 at 21:29.

  6. #6

    Default Re: Trap and Door icons flashing permanently

    Didn't work. But your other attempt sent over discord did: r1914

  7. #7
    Troll
    Join Date
    Jul 2016
    Location
    United Kingdom
    Posts
    257

    Default Re: Trap and Door icons flashing permanently

    Quote Originally Posted by YourMaster View Post
    Didn't work. But your other attempt sent over discord did: r1914
    Well, at least I got it working!

Similar Threads

  1. Replies: 0
    Last Post: March 24th, 2014, 13:44

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •