MCPcopy Create free account
hub / github.com/TurningWheel/Barony / buttonGamemodsCreateNewModTemplate

Function buttonGamemodsCreateNewModTemplate

src/menu.cpp:12010–12049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12008//}
12009
12010void buttonGamemodsCreateNewModTemplate(button_t* my)
12011{
12012 buttonCloseSubwindow(nullptr);
12013 list_FreeAll(&button_l);
12014 deleteallbuttons = true;
12015
12016 gamemods_window = 6;
12017
12018 // create window
12019 subwindow = 1;
12020 subx1 = xres / 2 - 400;
12021 subx2 = xres / 2 + 400;
12022 suby1 = yres / 2 - 70;
12023 suby2 = yres / 2 + 70;
12024 strcpy(subtext, "Create new blank mod template");
12025
12026 // close button
12027 button_t* button = newButton();
12028 strcpy(button->label, "x");
12029 button->x = subx2 - 20;
12030 button->y = suby1;
12031 button->sizex = 20;
12032 button->sizey = 20;
12033 button->action = &buttonCloseSubwindow;
12034 button->visible = 1;
12035 button->focused = 1;
12036 button->key = SDLK_ESCAPE;
12037 button->joykey = joyimpulses[INJOY_MENU_CANCEL];
12038
12039 // create button
12040 button = newButton();
12041 strcpy(button->label, "create");
12042 button->x = subx2 - (strlen(button->label) * TTF12_WIDTH + 8);
12043 button->y = suby2 - TTF12_HEIGHT - 8;
12044 button->sizex = strlen(button->label) * TTF12_WIDTH + 8;
12045 button->sizey = 20;
12046 //button->action = &buttonGamemodsCreateModDirectory;
12047 button->visible = 1;
12048 button->focused = 1;
12049}
12050
12051
12052void buttonGamemodsBaseDirectory(button_t* my)

Callers

nothing calls this directly

Calls 3

list_FreeAllFunction · 0.85
newButtonFunction · 0.85
buttonCloseSubwindowFunction · 0.70

Tested by

no test coverage detected