~xaserle/s25rttr/s25edit

« back to all changes in this revision

Viewing changes to callbacks.cpp

  • Committer: Marc Vester
  • Date: 2013-08-06 09:09:12 UTC
  • Revision ID: x-laser@gmx.net-20130806090912-nerm6yjcrjiv9x54
Added buttons to world create menu

Show diffs side-by-side

added added

removed removed

Lines of Context:
2173
2173
    {
2174
2174
        REDUCE_WIDTH_128,
2175
2175
        REDUCE_WIDTH_16,
 
2176
        REDUCE_WIDTH_2,
 
2177
        RAISE_WIDTH_2,
2176
2178
        RAISE_WIDTH_16,
2177
2179
        RAISE_WIDTH_128,
2178
2180
        REDUCE_HEIGHT_128,
2179
2181
        REDUCE_HEIGHT_16,
 
2182
        REDUCE_HEIGHT_2,
 
2183
        RAISE_HEIGHT_2,
2180
2184
        RAISE_HEIGHT_16,
2181
2185
        RAISE_HEIGHT_128,
2182
2186
        CHANGE_LANDSCAPE,
2201
2205
                        MapObj = global::s2->getMapObj();
2202
2206
 
2203
2207
                        WNDCreate->addText("Breite", 95, 4, 9, FONT_YELLOW);
2204
 
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_WIDTH_128, 10, 15, 35, 20, BUTTON_GREY, "128<-");
2205
 
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_WIDTH_16, 45, 15, 35, 20, BUTTON_GREY, "16<-");
 
2208
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_WIDTH_128, 0, 15, 35, 20, BUTTON_GREY, "128<-");
 
2209
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_WIDTH_16, 35, 15, 35, 20, BUTTON_GREY, "16<-");
 
2210
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_WIDTH_2, 70, 15, 25, 20, BUTTON_GREY, "2<-");
2206
2211
                        sprintf(puffer, "%d", width);
2207
2212
                        TextWidth = WNDCreate->addText(puffer, 105, 17, 14, FONT_YELLOW);
2208
2213
                        TextWidth->setText(puffer);
2209
 
                        WNDCreate->addButton(EditorCreateMenu, RAISE_WIDTH_16, 158, 15, 35, 20, BUTTON_GREY, "->16");
2210
 
                        WNDCreate->addButton(EditorCreateMenu, RAISE_WIDTH_128, 193, 15, 35, 20, BUTTON_GREY, "->128");
 
2214
                        WNDCreate->addButton(EditorCreateMenu, RAISE_WIDTH_2, 143, 15, 25, 20, BUTTON_GREY, "->2");
 
2215
                        WNDCreate->addButton(EditorCreateMenu, RAISE_WIDTH_16, 168, 15, 35, 20, BUTTON_GREY, "->16");
 
2216
                        WNDCreate->addButton(EditorCreateMenu, RAISE_WIDTH_128, 203, 15, 35, 20, BUTTON_GREY, "->128");
2211
2217
 
2212
2218
                        WNDCreate->addText("H�he", 100, 40, 9, FONT_YELLOW);
2213
 
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_HEIGHT_128, 10, 49, 35, 20, BUTTON_GREY, "128<-");
2214
 
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_HEIGHT_16, 45, 49, 35, 20, BUTTON_GREY, "16<-");
 
2219
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_HEIGHT_128, 0, 49, 35, 20, BUTTON_GREY, "128<-");
 
2220
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_HEIGHT_16, 35, 49, 35, 20, BUTTON_GREY, "16<-");
 
2221
                        WNDCreate->addButton(EditorCreateMenu, REDUCE_HEIGHT_2, 70, 49, 25, 20, BUTTON_GREY, "2<-");
2215
2222
                        sprintf(puffer, "%d", height);
2216
2223
                        TextHeight = WNDCreate->addText(puffer, 105, 51, 14, FONT_YELLOW);
2217
2224
                        TextHeight->setText(puffer);
2218
 
                        WNDCreate->addButton(EditorCreateMenu, RAISE_HEIGHT_16, 158, 49, 35, 20, BUTTON_GREY, "->16");
2219
 
                        WNDCreate->addButton(EditorCreateMenu, RAISE_HEIGHT_128, 193, 49, 35, 20, BUTTON_GREY, "->128");
 
2225
                        WNDCreate->addButton(EditorCreateMenu, RAISE_HEIGHT_2, 143, 49, 25, 20, BUTTON_GREY, "->2");
 
2226
                        WNDCreate->addButton(EditorCreateMenu, RAISE_HEIGHT_16, 168, 49, 35, 20, BUTTON_GREY, "->16");
 
2227
                        WNDCreate->addButton(EditorCreateMenu, RAISE_HEIGHT_128, 203, 49, 35, 20, BUTTON_GREY, "->128");
2220
2228
 
2221
2229
                        WNDCreate->addText("Landschaft", 85, 80, 9, FONT_YELLOW);
2222
2230
                        ButtonLandscape = WNDCreate->addButton(EditorCreateMenu, CHANGE_LANDSCAPE, 64, 93, 110, 20, BUTTON_GREY, (LandscapeType == 0 ? "Gr�nland" : (LandscapeType == 1 ? "�dland" : "Winterwelt")));
2268
2276
                    sprintf(puffer, "%d", width);
2269
2277
                    TextWidth = WNDCreate->addText(puffer, 105, 17, 14, FONT_YELLOW);
2270
2278
                    break;
 
2279
        case REDUCE_WIDTH_2:
 
2280
                    if (width - 2 >= 32)
 
2281
                        width -= 2;
 
2282
                    else
 
2283
                        width = 32;
 
2284
                    WNDCreate->delText(TextWidth);
 
2285
                    sprintf(puffer, "%d", width);
 
2286
                    TextWidth = WNDCreate->addText(puffer, 105, 17, 14, FONT_YELLOW);
 
2287
                    break;
 
2288
        case RAISE_WIDTH_2:
 
2289
                    if (width + 2 <= MAXMAPWIDTH)
 
2290
                        width += 2;
 
2291
                    else
 
2292
                        width = MAXMAPWIDTH;
 
2293
                    WNDCreate->delText(TextWidth);
 
2294
                    sprintf(puffer, "%d", width);
 
2295
                    TextWidth = WNDCreate->addText(puffer, 105, 17, 14, FONT_YELLOW);
 
2296
                    break;
2271
2297
        case RAISE_WIDTH_16:
2272
2298
                    if (width + 16 <= MAXMAPWIDTH)
2273
2299
                        width += 16;
2304
2330
                    sprintf(puffer, "%d", height);
2305
2331
                    TextHeight = WNDCreate->addText(puffer, 105, 51, 14, FONT_YELLOW);
2306
2332
                    break;
 
2333
        case REDUCE_HEIGHT_2:
 
2334
                    if (height - 2 >= 32)
 
2335
                        height -= 2;
 
2336
                    else
 
2337
                        height = 32;
 
2338
                    WNDCreate->delText(TextHeight);
 
2339
                    sprintf(puffer, "%d", height);
 
2340
                    TextHeight = WNDCreate->addText(puffer, 105, 51, 14, FONT_YELLOW);
 
2341
                    break;
 
2342
        case RAISE_HEIGHT_2:
 
2343
                    if (height + 2 <= MAXMAPHEIGHT)
 
2344
                        height += 2;
 
2345
                    else
 
2346
                        height = MAXMAPHEIGHT;
 
2347
                    WNDCreate->delText(TextHeight);
 
2348
                    sprintf(puffer, "%d", height);
 
2349
                    TextHeight = WNDCreate->addText(puffer, 105, 51, 14, FONT_YELLOW);
 
2350
                    break;
2307
2351
        case RAISE_HEIGHT_16:
2308
2352
                    if (height + 16 <= MAXMAPHEIGHT)
2309
2353
                        height += 16;