Skip to content

Commit

Permalink
+ Add help window to editor for most functions. Accessible via help d…
Browse files Browse the repository at this point in the history
…ropdown or pressing H
  • Loading branch information
WALL OF JUSTICE committed May 7, 2018
1 parent 29c6201 commit 66edee9
Show file tree
Hide file tree
Showing 3 changed files with 305 additions and 60 deletions.
168 changes: 112 additions & 56 deletions src/buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ button_t* butAttributes;
button_t* butClearMap;
button_t* butHelp;
button_t* butAbout;
button_t* butEditorControls;
button_t* butMonsterHelm;
button_t* butMonsterWeapon;
button_t* butMonsterShield;
Expand Down Expand Up @@ -1494,63 +1495,15 @@ void buttonAbout(button_t* my)

menuVisible = 0;
subwindow = 1;
subx1 = xres / 2 - 200;
subx2 = xres / 2 + 200;
suby1 = yres / 2 - 300;
suby2 = yres / 2 + 300;
subx1 = xres / 2 - 160;
subx2 = xres / 2 + 160;
suby1 = yres / 2 - 56;
suby2 = yres / 2 + 56;
strcpy(subtext, "Barony: Map Editor v2.4"
"\n\nSee EDITING for full documentation."
"\n\nThis software is copyright 2013 (c)"
"\nSheridan Rathbun, all rights reserved."
"\n\nSee LICENSE for details.\n\n");
strcat(subtext, "Editor File Shortcuts:\n");
strcat(subtext, "New Map: CTRL + N\n");
strcat(subtext, "Open: CTRL + O\n");
strcat(subtext, "Save: CTRL + S\n");
strcat(subtext, "Change Load/Save Directory: CTRL + D\n");
strcat(subtext, "Close Window/Dialogue: CTRL + M\n");
strcat(subtext, "Delete Text: Backspace or Grave (`)\n");

strcat(subtext, "\nEditor Functions:\n");
strcat(subtext, "Open Sprite Window: S\n");
strcat(subtext, "Open Tile Window: T\n");
strcat(subtext, "Sprite Properties: F2\n");
strcat(subtext, "Map Properties: CTRL + M\n");
strcat(subtext, "Delete Selected Sprite: DEL\n");
strcat(subtext, "Cycle Stacked Sprites: C\n");

strcat(subtext, "\nNavigation:\n");
strcat(subtext, "Move Camera/View: Arrow Keys\n");
strcat(subtext, "Change Current Wall Layer: SHIFT + Scrollwheel\n");
strcat(subtext, "Change Current Wall Layer: CTRL + U, CTRL + P\n");
strcat(subtext, "Toggle First Person Camera: F\n");

strcat(subtext, "\nTile Palette (Last Used Tiles):\n");
strcat(subtext, "Cycle Through Current Tile Palette: Scrollwheel\n");
strcat(subtext, "Cycle Through All Palettes: CTRL + Scrollwheel\n");
strcat(subtext, "Choose Specific Tile In Palette: Numpad 0-9\n");
strcat(subtext, "Choose Specific Tile In Palette: Left Click Tile\n");
strcat(subtext, "Lock Changes to Current Palette: Numpad *\n");
strcat(subtext, "Go To Next Palette: Numpad +\n");
strcat(subtext, "Go To Previous Palette: Numpad -\n");
strcat(subtext, "Clear Tile in Palette: Right Click Tile\n");

strcat(subtext, "Editing Tools:\n");
strcat(subtext, "Pencil: Draws currently selected tile on current wall layer.\n");
strcat(subtext, " Does not select sprites. Right click sets the selected tile\n");
strcat(subtext, " under the cursor to selected.\n");
strcat(subtext, "Point: Selects sprites only. Sprites can be moved or deleted once\n");
strcat(subtext, " placed and selected with this tool. Left click selects, right\n");
strcat(subtext, " clicking duplicates a sprite and places it the cursor.\n");
strcat(subtext, " When sprites are stacked, only the lowest listed sprite is selected.\n");
strcat(subtext, " Hovering over multiple sprites and cycling with C allows\n");
strcat(subtext, " you to change the order that sprites are drawn in the editor.\n");
strcat(subtext, "Brush: Same as pencil, but draws a larger area at once.\n");
strcat(subtext, "Select: Selects area of tiles or sprites. Tiles can be copied/\n");
strcat(subtext, " pasted/deleted in groups. Sprites can be moved in groups\n");
strcat(subtext, " with ALT + Arrow Keys. Selection can be moved with CTRL + \n");
strcat(subtext, " Arrow Keys, and resized with SHIFT + Arrow Keys.\n");
strcat(subtext, "Fill: Fills in left-clicked area with currently selected tile.\n");
"\n\nSee EDITING for full documentation."
"\n\nThis software is copyright 2018 (c)"
"\nSheridan Rathbun, all rights reserved."
"\n\nSee LICENSE for details.\n");

button = newButton();
strcpy(button->label, "OK");
Expand All @@ -1573,6 +1526,109 @@ void buttonAbout(button_t* my)
button->focused = 1;
}

void buttonEditorToolsHelp(button_t* my)
{
node_t* node;
node_t* nextnode;
button_t* button;
for ( node = button_l.first; node != NULL; node = nextnode )
{
nextnode = node->next;
button = (button_t*)node->element;
if ( button->focused )
{
list_RemoveNode(button->node);
continue;
}
}
subwindow = 1;
if ( newwindow == 16 )
{
newwindow = 17;
subx1 = xres / 2 - 280;
subx2 = xres / 2 + 280;
suby1 = yres / 2 - 180;
suby2 = yres / 2 + 180;

button = newButton();
strcpy(button->label, "OK");
button->sizex = 9 * 12 + 8;
button->x = xres / 2 - button->sizex - 4;
button->y = suby2 - 24;
button->sizey = 16;
button->action = &buttonCloseSubwindow;
button->visible = 1;
button->focused = 1;

button = newButton();
strcpy(button->label, "Next Page");
button->x = xres / 2 + 4;
button->y = suby2 - 24;
button->sizex = strlen(button->label) * 12 + 8;
button->sizey = 16;
button->action = &buttonEditorToolsHelp;
button->visible = 1;
button->focused = 1;

button = newButton();
strcpy(button->label, "X");
button->x = subx2 - 16;
button->y = suby1;
button->sizex = 16;
button->sizey = 16;
button->action = &buttonCloseSubwindow;
button->visible = 1;
button->focused = 1;
}
else
{
buttonEditorControls(nullptr);
}
}

void buttonEditorControls(button_t* my)
{
button_t* button;

menuVisible = 0;
subwindow = 1;
newwindow = 16;
subx1 = xres / 2 - 250;
subx2 = xres / 2 + 250;
suby1 = yres / 2 - 250;
suby2 = yres / 2 + 250;

button = newButton();
strcpy(button->label, "OK");
button->sizex = 9 * 12 + 8;
button->x = xres / 2 - button->sizex - 4;
button->y = suby2 - 24;
button->sizey = 16;
button->action = &buttonCloseSubwindow;
button->visible = 1;
button->focused = 1;

button = newButton();
strcpy(button->label, "Next Page");
button->x = xres / 2 + 4;
button->y = suby2 - 24;
button->sizex = strlen(button->label) * 12 + 8;
button->sizey = 16;
button->action = &buttonEditorToolsHelp;
button->visible = 1;
button->focused = 1;

button = newButton();
strcpy(button->label, "X");
button->x = subx2 - 16;
button->y = suby1;
button->sizex = 16;
button->sizey = 16;
button->action = &buttonCloseSubwindow;
button->visible = 1;
button->focused = 1;
}

// Subwindows
void buttonCloseSubwindow(button_t* my)
{
Expand Down
Loading

0 comments on commit 66edee9

Please sign in to comment.