1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

XML GUI progress

Discussion in 'Civ4Col - Medieval: Conquests' started by Nightinggale, Jan 19, 2016.

  1. Nightinggale

    Nightinggale Deity

    Feb 2, 2009
    A week passed (more or less). All I added for the user was assigning the left/right arrow keys to jump through files. This means you can edit a building, then go to the BuildingClass file and the left arrow becomes buildings because that was the last file you viewed. Going back will then make the right arrow jump to BuildingClass. I has a memory of an unlimited number of files in each direction and it remembers the entry you had open on each page.

    Other than that it might take a while before new stuff shows up in the GUI. Back when I started out, I had no idea how the editor GUI would turn out because I never even made a python screen from scratch before. The result is one big file with a big class and it has now reached the 2000 line threshold. This seems to be the limit of how big a file I can work with efficiently and I only noticed because I started to spend longer and longer searching through the file. Since this will only get worse and the worsening overview makes it prone to bugs, I decided to restructure the code to make it meet standards of the 21th century. This means proper objective programming, code encapsulation, multiple files with a well defined purpose for each etc. In other words proper clean code. So far I moved 25% of the code to new files and cleaned up not only the moved code, but also the code calling it.

    The code redesign works very well. It's much easier to read and work with and I can already feel a significant speedup in my work speed. It's not just about the size of the file. Now all the popup windows have a class and file each (well when I'm done), meaning not only is the code for each window in the same place, the code now has a concept of the current popup window, meaning it can give orders like draw, input, delete and so on without investigating which window is actually open. This is not only faster to code and easier to read, it's also less prone to bugs because it allows reusing well tested code.

    In other words great progress, but not much to show for user improvements and it will stay that way for a while.

    And in case you wonder, the DLL is unaffected by this. Unlike the python code, I do have experience with what the DLL is supposed to do and it has been well planned from the start. It's written to be highly efficient and allow python to offload the real workload to the compiled (much faster) code.
    topsecret likes this.
  2. topsecret

    topsecret Believer

    Feb 11, 2010
    At the Foot of the Cross
    Awesome work!

Share This Page