aliens

Author Topic: [DONE] craft preview  (Read 2053 times)

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 7380
    • View Profile
Re: [DONE] craft preview
« Reply #15 on: April 25, 2022, 12:02:41 am »
I'm not changing a simple, elegant, consistent and commonly-used solution.

Simple = literally two lines of code (1 to save, 1 to load)
Elegant = raw unobscured YAML, what you see is exactly what you get
Consistent = same as 99.9% of the rest
Commonly-used = there are many other objects in the openxcom save file, which are saved in the same way (tip: look at a battlescape save); or look at mod rulesets

Losing these four qualities just to gain a bit of (questionable) human-readability has zero priority for me.

For a correct raw representation, you'd have to make a new class. Considering this object has very limited usage, I agree that adding a new class would be an overkill.

This part is actually what I would even be willing to do.
A class (or struct) overhead doesn't cost too much and adds to c++ code readability too.
Fun fact: this is even currently used for storing data about HWPs (which use a completely different structure than soldiers; again for a good reason).

Code: [Select]
        customVehicleDeployment:
          - type: STR_TANK_CANNON
            pos:
              - 4
              - 9
              - 1
            dir: 0

The biggest issue with your proposed change is not wrapping a few fields into a class (or struct), but changing std::map (YAML dictionary) into std::vector (YAML list), which I'm not willing to do in any case.


At the end of the day, the current solution has overwhelmingly more advantages for me than your counter-proposal and will stay as is.
« Last Edit: April 25, 2022, 12:32:26 am by Meridian »

Online Delian

  • Colonel
  • ****
  • Posts: 144
    • View Profile
Re: [DONE] craft preview
« Reply #16 on: April 25, 2022, 01:00:06 am »
which I'm not willing to do in any case.

Ok. Then, as you said, you're willing to change std::pair<Position, int> into a struct. Can you do that then?
« Last Edit: May 25, 2022, 12:40:17 pm by Delian »

Online Delian

  • Colonel
  • ****
  • Posts: 144
    • View Profile
Re: [DONE] craft preview
« Reply #17 on: June 21, 2022, 05:20:35 pm »
I have a new suggestion for the craft preview. Can you please temporarily set the Player Movement Speed to the maximum (or even faster - just teleport units) during the craft preview? I like using slower movement speed in the battlescape, but in the preview that's too slow and it's kinda bothersome having to keep changing the speed back and forther every time i use the preview.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 7380
    • View Profile
Re: [DONE] craft preview
« Reply #18 on: June 21, 2022, 05:54:15 pm »
it is already possible to teleport

Online Delian

  • Colonel
  • ****
  • Posts: 144
    • View Profile
Re: [DONE] craft preview
« Reply #19 on: June 21, 2022, 06:58:48 pm »
Oh, I'm dumb. Well, it would be useful to mention the shortcut in the in-game help text.
« Last Edit: June 21, 2022, 07:10:45 pm by Delian »