[wesnoth-commits] [wesnoth/wesnoth] c489ff: gui2/unit_create: Remove "Debug!" part of the dial...

Iris Morelle noreply at github.com
Thu Jul 9 21:42:31 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: c489ffab5947993066de8681ddb72322f3f85ced
      https://github.com/wesnoth/wesnoth/commit/c489ffab5947993066de8681ddb72322f3f85ced
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M data/gui/window/unit_create.cfg

  Log Message:
  -----------
  gui2/unit_create: Remove "Debug!" part of the dialog caption

Yes, we already know it's a debug mode functionality. It says so on the
context menu and we needed to use :debug to get here. No need to make
the dialog caption pointlessly long.


  Commit: be4b927fd8e3f7c0103cc30cdfc25f4a93ec962e
      https://github.com/wesnoth/wesnoth/commit/be4b927fd8e3f7c0103cc30cdfc25f4a93ec962e
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M data/gui/window/unit_create.cfg
    M src/gui/dialogs/unit_create.cpp
    M src/gui/dialogs/unit_create.hpp
    M src/menu_events.cpp
    M src/synced_commands.cpp
    M src/units/types.hpp
    M src/units/unit.cpp
    M src/units/unit.hpp

  Log Message:
  -----------
  Add unit variation selection to the Create Unit dialog

Surprisingly, this involves quite a few API changes to enable the Create
Unit command to specify a unit variation id.


  Commit: 3ecc7cb8343ddf60f60b242703f53dbf6d2e9314
      https://github.com/wesnoth/wesnoth/commit/3ecc7cb8343ddf60f60b242703f53dbf6d2e9314
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M data/gui/window/unit_create.cfg
    M src/gui/dialogs/unit_create.cpp

  Log Message:
  -----------
  gui2/unit_create: UI refinements

 * Make the default variation's label "Default Variation" instead of
   just "Default" (see below).
 * Drop the "Variation:" and "Gender:" labels as they take up valuable
   real estate and aren't strictly necessary since the controls they are
   attached to are very much self-explanatory. This is a debug mode
   utility dialog anyway.
 * Swap the order according to option importance -- gender is usually
   thought of as more of an essential property of units than their type
   variation, especially since unit types with multiple variations are
   rare in mainline. This means that the gender options are now on the
   left instead of on the right.
 * Improve display alignment for the variation/gender options row.


  Commit: c8a31df035c5bfebb94456566e0e58969a2a37f0
      https://github.com/wesnoth/wesnoth/commit/c8a31df035c5bfebb94456566e0e58969a2a37f0
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M src/units/unit.cpp
    M src/units/unit.hpp

  Log Message:
  -----------
  Whitespace cleanup


  Commit: fe5f7480888186473400f40003eb683e6db9fdaf
      https://github.com/wesnoth/wesnoth/commit/fe5f7480888186473400f40003eb683e6db9fdaf
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M src/gui/dialogs/unit_create.cpp

  Log Message:
  -----------
  gui2/unit_create: Address issue with variation+gender previews

Instead of generating the unit preview from the gender variation
attached to the unit type variation, we need to generate it from the
unit type variation attached to the gender variation. I know this sounds
really crazy, but it matches the behaviour in unit::advance_to():

    // Adjust the new type for gender and variation.
    const unit_type& new_type = u_type.get_gender_unit_type(gender_).get_variation(variation_);

This behaviour is also relied upon by at least one pre-existing add-on
(After the Storm Episode 3, Demon Shapeshifter unit type).

Without this patch, the preview display doesn't reflect gender
variations at all when a non-default variation is selected.

As a side-note, the fix also makes the logic in
unit_create::update_displayed_type() simpler since we don't need to
verify if the variation exists at all -- if it doesn't we just get the
parent unit type back.


  Commit: bd676edfae281d947107cc8811bb4cb4f932cff3
      https://github.com/wesnoth/wesnoth/commit/bd676edfae281d947107cc8811bb4cb4f932cff3
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M src/gui/dialogs/unit_create.cpp

  Log Message:
  -----------
  gui2/unit_create: Use variation_name before the variation's ut name

Forgot that variation_name has an actual meaning when paired with
variation_id as opposed to it just being a deprecated form of
variation_id. This makes it so it's favoured by the UI over a
potentially overridden type name when present.

This makes it so the mainline Walking Corpse and Soulless units have
their translatable variation names properly displayed.


Compare: https://github.com/wesnoth/wesnoth/compare/c8175afa3e4a...bd676edfae28



More information about the Commits mailing list