Giter Site home page Giter Site logo

Comments (5)

knyghtmare avatar knyghtmare commented on June 16, 2024

I wonder if this is viable as a solution:

[campaign]
    #ifdef MULTIPLAYER
    id=Campaign_ID_MP
    abbrev="Campaign_MP"
    #else
    id=Campaign_ID_SP
    abbrev="Campaign"
    #endif
    type=hybrid
[/campaign]

from wesnoth.

soliton- avatar soliton- commented on June 16, 2024

That's pretty much what they said they did as a workaround. That should not be necessary. Also we should move away from more reliance on the preprocessor.

from wesnoth.

Discontinuum avatar Discontinuum commented on June 16, 2024

I made a bit different way

#define MY_CAMPAIGN TYPE ABBR
[campaign]
id=my_campaign_{TYPE}
type={TYPE}
abbrev={ABBR}
...
[/campaign]
#enddef
{MY_CAMPAIGN sp "ABBR"}
{MY_CAMPAIGN mp "ABBR MP"}

the workaround by knyghtmare seems much less reliable to me. It feels suspicious that a campaign will define itself differently depending on the preprocessor's state.

Maybe we can add an optional parameter abbrev_mp to the [campaign] tag that will apply if it's a hybrid campaign run in MP

from wesnoth.

soliton- avatar soliton- commented on June 16, 2024

I think adding a fixed string like the "MP" you mentioned after the abbreviation is enough. If someone wants an entirely different abbreviation then they can make multiple campaigns like you showed. I don't think abbrev_mp is desirable.

from wesnoth.

Discontinuum avatar Discontinuum commented on June 16, 2024

I thought at first hardcoding the "MP" prefix isn't desirable but prolly it makes sense. As you say, people may define two distinct non-hybrid campaigns if they want to

from wesnoth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.