Trying to understand the Angband 3.X source code

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Magnate
    replied
    Originally posted by d_m
    Pete, is there still a bug in this patch (that is not in HEAD)? If not, I will test it a bit and commit it, otherwise I will wait for you to look at it some more.
    Just FYI, you might need to do this twice, as quite a bit of the store display function was copied for the display within the knowledge menu. (I haven't checked whether Pete's patch affects the bit that was copied, sorry.)

    Leave a comment:


  • Pete Mack
    replied
    The bug is in the patch. Please don't commit it until I finish.

    Leave a comment:


  • d_m
    replied
    Originally posted by Pete Mack
    OK, I agree the current store.c event loop is a bit confusing.
    I cleaned it up a bit.

    diff is attached.

    Edit:
    Reloaded, to get rid of annoying flicker on double-tap (existing bug)
    Edit:
    There's a bug in this-- more prompt is not working for lists too long by one.
    Pete, is there still a bug in this patch (that is not in HEAD)? If not, I will test it a bit and commit it, otherwise I will wait for you to look at it some more.

    Thanks.

    Leave a comment:


  • Pete Mack
    replied
    @Jeff--
    One other thing.
    In cleaning up store.c, I recalled another trivial change I made ~3.0.8: adding type union
    Code:
    %y
    to the list of string format characters for vstrnfmt and strnfmt.

    It makes complicated formatting like files.c a lot easier. Unfortunately, it's not useful when you want to do formatted text with mixed colors.
    I added some really hacky support for multiple colors in files.c -- display_panel
    It makes formatting character info much easier, but it does not generalize.

    ...

    In fact, let me whip something up... TBC in a week or so.

    Leave a comment:


  • Pete Mack
    replied
    OK, I agree the current store.c event loop is a bit confusing.
    I cleaned it up a bit.

    diff is attached.

    Edit:
    Reloaded, to get rid of annoying flicker on double-tap (existing bug)
    Edit:
    There's a bug in this-- more prompt is not working for lists too long by one.
    Attached Files
    Last edited by Pete Mack; July 11, 2010, 05:21.

    Leave a comment:


  • Pete Mack
    replied
    store_display_entry is the function for displaying store inventory.
    It's an event handler--it gets called for each row every time a menu action occurs.

    Leave a comment:


  • nppangband
    replied
    Thanks. I tested it, and although I am not sure what code triggers it (something in ui-menu.c), but the game does re-price everything and re-draw all of the prices if the player's charisma changes when they are inside the store.

    Leave a comment:


  • d_m
    replied
    Originally posted by nppangband
    I guess the player's charisma can change in Angabnd as well, if they take off or wield equipment. Do these lines (at the end of store_process_command) assure that inventory and prices re-drawn in the store?

    event_signal(EVENT_INVENTORY);
    event_signal(EVENT_EQUIPMENT);
    The only thing those events do (AFAIK) is to update the inventory/equipment subwindows... I don't think they have anything to do with redrawing prices in the store.

    The event handlers are reigstered in src/xtra3.c if you want to see what they do.

    Leave a comment:


  • nppangband
    replied
    This is a quick question for the Angband maintainers. I just need to confirm how often store_display_entry is called.

    The reason I ask is that in NPP, due to store services or quild rewards, charisma can change while a person is in the store (restore stat, increase stat, and sometimes a quest reward are stat increases.

    I guess the player's charisma can change in Angabnd as well, if they take off or wield equipment. Do these lines (at the end of store_process_command) assure that inventory and prices re-drawn in the store?

    Thanks.

    event_signal(EVENT_INVENTORY);
    event_signal(EVENT_EQUIPMENT);

    Leave a comment:


  • nppangband
    replied
    Originally posted by Soluzar
    I'm really glad that you're bringing the codebase in line with current V, since it's only fair to say that Andi and co. have implemented some really nice features. I'm glad NPP is still actively under development, and look forward to the results.
    Thanks. Implementing the Vanilla changes is long overdue. After more than a decade of minimal changes in Vanilla, I think it is more active than most variants. I just hope I have the time to keep up with them.

    Leave a comment:


  • Soluzar
    replied
    Originally posted by nppangband
    My target for releasing a beta is August 1. I am actually almsot done now, but I have a project at work that is going to keep me busy for the next two weeks. I want to hold off the beta release until I actually will have time to fix the problems people discover.
    I'm really glad that you're bringing the codebase in line with current V, since it's only fair to say that Andi and co. have implemented some really nice features. I'm glad NPP is still actively under development, and look forward to the results.

    Leave a comment:


  • nppangband
    replied
    I saw the question in Nick's thread first, ( http://angband.oook.cz/forum/showthread.php?t=3004), but here is the answer:

    For NPP 0.5.0, I am not sure. But very soon, the answer will be a definite yes.

    I have an updated version coming out that updates the core of NPP from Angband 3.0.6 to the current Angband 3.1.2v2 beta. It won't have all of the features yet, but it will have all of the updated makefiles, main-xxx files, mouse support, the improved Angband UI and all of the core files that make Angband run. That that point, anything that can compile the current Vanilla should compile NPP as well.

    My target for releasing a beta is August 1. I am actually almsot done now, but I have a project at work that is going to keep me busy for the next two weeks. I want to hold off the beta release until I actually will have time to fix the problems people discover.

    Leave a comment:


  • Soluzar
    replied
    Any chance you'll be implementing the SDL display module? I've become rather fond of it and miss it whenever I'm playing NPP. I'm really fond of it, actually... it is the main variant that I spend my Angbanding time on other than V.

    Leave a comment:


  • nppangband
    replied
    Originally posted by Nick
    The relevant file is pref-win.prf, IIRC. I have had endless troubles with it and arrow keys.
    If I understand assert correctly, that is what it does - if the condition is not satisfied, it terminates the program.
    Good luck
    Thanks! With that help I found it. Strangely, utting in the updated pref-win.prf fromthe current angband into NPP causes the crashes. If I keep the current one from NPPAngband it works fine.

    Leave a comment:


  • Nick
    replied
    Originally posted by nppangband
    assert(p_ptr->command_cmd >= CHAR_MIN && p_ptr->command_cmd <= CHAR_MAX);

    If the numlock is on, the p_ptr->command is 59, and if numlock is off, the direction keys are between 138-141, and the game crashes. Again, the diagonal keys work fine either way

    Isn't there a pref file that converts certain keyboard commands like this? I know the 138 is above the 127 limit, but I can't figure out why it would be crashing the game. I have assert.h declared in h-basic.h just like in Angband.
    The relevant file is pref-win.prf, IIRC. I have had endless troubles with it and arrow keys.
    If I understand assert correctly, that is what it does - if the condition is not satisfied, it terminates the program.
    Good luck

    Leave a comment:

Working...
😀
😂
🥰
😘
🤢
😎
😞
😡
👍
👎