Author Topic: Ufopaedia development  (Read 37370 times)

Offline panther

  • Sergeant
  • **
  • Posts: 42
    • View Profile
Re: Ufopaedia development
« Reply #15 on: February 11, 2011, 09:05:28 pm »
Hi,

I have now refactored my code quite a bit so it fits better into the current schema. The attached patch lets you open the Ufopaedia featuring three buttons, list selection and (hold your breath) two articles ;)

It is for the 267 SVN version, which should work. It would be great to apply the changes so I can work on without touching SavedGame, Ruleset etc. again.

Documentation is nearly complete and passes doxygen without warnings. Let me know what you think.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Ufopaedia development
« Reply #16 on: February 16, 2011, 02:46:17 am »
Thanks, I'll have a look sometime this week and post feedback, just figured I'd let you know I didn't miss your post. :)

Offline panther

  • Sergeant
  • **
  • Posts: 42
    • View Profile
Re: Ufopaedia development
« Reply #17 on: February 17, 2011, 12:52:03 am »
Great, thanks! It would be so nice if my basic Ufopaedia "attachments" could go into the master branch. So it would be easier for me to stay updated and develop further.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Ufopaedia development
« Reply #18 on: February 24, 2011, 12:57:54 am »
Ok I finally had a look, and it looks very impressive, very professional. :) It still seems overly elaborate, but it seems to integrate much better with the OpenXcom structure, and you'll probably improve it over-time. I'll revise it and put it in the codebase soon, though we've just moved to Git so it'll take a while.

As for staying updated easily, you can look into GitHub forks.

Offline panther

  • Sergeant
  • **
  • Posts: 42
    • View Profile
Re: Ufopaedia development
« Reply #19 on: February 28, 2011, 11:32:35 pm »
Good to hear, thanks. I haven't been doing much lately, but soon I will have some more time to spend on programming again.
I can fork and send you a pull request for the changes, if you like, now that github is the tool of choice.
But if you put it in the codebase anytime soon, I will fork from there...

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Ufopaedia development
« Reply #20 on: March 09, 2011, 12:21:13 am »
Committed. I revised and moved things around a bit, but I figure you know your code better than me. Seems to work well. :)

One thing I noticed is you seem to put all the Ufopaedia articles in the Ruleset, but then... copy them to the SavedGame for some reason? You also worry about things like using a "insertion sort", which I don't think is a concern at all.

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Ufopaedia development
« Reply #21 on: March 09, 2011, 07:54:45 am »
There is new git build with ufopaedia :D

https://openxcom.ninex.info/git_builds/

Unfortunately, there were problems building it, there is small error:

Code: [Select]
diff --git a/src/Ufopaedia/UfopaediaSelectState.cpp b/src/Ufopaedia/UfopaediaSelectState.cpp
index 6de0c03..673ac67 100644
--- a/src/Ufopaedia/UfopaediaSelectState.cpp
+++ b/src/Ufopaedia/UfopaediaSelectState.cpp
@@ -31,7 +31,7 @@
 #include "../Interface/TextButton.h"
 #include "../Interface/TextList.h"
 #include "../Resource/ResourcePack.h"
-#include "../SaveGame/SavedGame.h"
+#include "../Savegame/SavedGame.h"
 
 namespace OpenXcom
 {

Remember that linux is case sensitive.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Ufopaedia development
« Reply #22 on: March 09, 2011, 10:51:51 am »
Fixed.

Offline panther

  • Sergeant
  • **
  • Posts: 42
    • View Profile
Re: Ufopaedia development
« Reply #23 on: March 09, 2011, 10:26:56 pm »
Committed. I revised and moved things around a bit, but I figure you know your code better than me. Seems to work well. :)

One thing I noticed is you seem to put all the Ufopaedia articles in the Ruleset, but then... copy them to the SavedGame for some reason? You also worry about things like using a "insertion sort", which I don't think is a concern at all.

Thank you! I'm currently rather busy at work but will soon continue OpenXCom development. The articles are necessary in both Ruleset and SavedGame. In Ruleset, I define how to display them, SavedGame stores what is available. This isn't obvious now, since there are only two articles implemented... :)

More to come soon.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Ufopaedia development
« Reply #24 on: March 10, 2011, 12:20:16 pm »
Committed. I revised and moved things around a bit, but I figure you know your code better than me. Seems to work well. :)

One thing I noticed is you seem to put all the Ufopaedia articles in the Ruleset, but then... copy them to the SavedGame for some reason? You also worry about things like using a "insertion sort", which I don't think is a concern at all.

Thank you! I'm currently rather busy at work but will soon continue OpenXCom development. The articles are necessary in both Ruleset and SavedGame. In Ruleset, I define how to display them, SavedGame stores what is available. This isn't obvious now, since there are only two articles implemented... :)

More to come soon.
Ah ok. You were only creating the articles in the Ruleset when newSave was called, which is why I was confusesd... I moved them to the Ruleset constructor, makes more sense now (UfopediaSaved are still created in newSave). :)

Offline panther

  • Sergeant
  • **
  • Posts: 42
    • View Profile
Re: Ufopaedia development
« Reply #25 on: March 18, 2011, 12:20:41 am »
If anyone is interested, this is my fork of OpenXCom:
https://github.com/gpin/OpenXcom

Thanks again to marabus for providing the XCode project. I only had to modify some files to reflect the new directory structure (no trunk anymore).

Well, the craft articles are already in there now!
As you can see in the screenshot, I use a TextList to display the craft stats. This is not like the original, I know. It was just more convenient this way :)
I thought I could modify TextList with an option to "pull the columns together" instead of the tabular layout.

And then I noticed a subtle difference in the TextButton rendering, that I corrected. I'm attaching a little patch here.

« Last Edit: March 18, 2011, 12:26:27 am by panther »

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Ufopaedia development
« Reply #26 on: March 18, 2011, 10:01:26 am »
Nice :)

Now fill a pull request ;)

Volutar

  • Guest
Re: Ufopaedia development
« Reply #27 on: March 18, 2011, 10:37:34 am »
Craft parameters, I hope, are extracted online from actual craft data?
I mean, if anything about craft will be changed - will ufopaedia reflect these changes?
Because in original XCOM ufopaedia extracts craft data from actual craft data tables...
« Last Edit: March 18, 2011, 10:44:58 am by Volutar »

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Ufopaedia development
« Reply #28 on: March 18, 2011, 11:04:01 am »
Craft parameters, I hope, are extracted online from actual craft data?

Of course, hardcoding data in ufopaedia would be silly ;)

OpenXcom contains ruleset, which is currently defined here:
https://github.com/gpin/OpenXcom/blob/master/src/Ruleset/XcomRuleset.cpp#L708

Offline panther

  • Sergeant
  • **
  • Posts: 42
    • View Profile
Re: Ufopaedia development
« Reply #29 on: March 18, 2011, 12:29:59 pm »
And I'm far too lazy to copy all these values into Ufopaedia myself ;)

@michal: I thought i'd wait with the pull request until there is more substantial things done, to save SupSuper some time.

I'm currently working on Craft weapons, but there I must make some changes to the TextList class.