summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/script/api/script_story_page.cpp8
-rw-r--r--src/story_gui.cpp8
2 files changed, 10 insertions, 6 deletions
diff --git a/src/script/api/script_story_page.cpp b/src/script/api/script_story_page.cpp
index 39ae3d53f..8fda69e6f 100644
--- a/src/script/api/script_story_page.cpp
+++ b/src/script/api/script_story_page.cpp
@@ -83,6 +83,10 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type)
case SPET_BUTTON_VEHICLE:
refid = reference;
break;
+ case SPET_TEXT:
+ break;
+ default:
+ NOT_REACHED();
}
if (!ScriptObject::DoCommand(reftile,
@@ -124,6 +128,10 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type)
case SPET_BUTTON_VEHICLE:
refid = reference;
break;
+ case SPET_TEXT:
+ break;
+ default:
+ NOT_REACHED();
}
return ScriptObject::DoCommand(reftile,
diff --git a/src/story_gui.cpp b/src/story_gui.cpp
index 96c411fe9..2de96a1a5 100644
--- a/src/story_gui.cpp
+++ b/src/story_gui.cpp
@@ -459,7 +459,7 @@ protected:
}
}
/* Position element in main column */
- LayoutCacheElement ce{ pe };
+ LayoutCacheElement ce{ pe, {} };
ce.bounds.left = left_offset;
ce.bounds.right = max_width - right_offset;
ce.bounds.top = main_y;
@@ -479,7 +479,7 @@ protected:
std::vector<size_t> &cur_floats = (fl == ElementFloat::Left) ? left_floats : right_floats;
/* Position element */
cur_width = max(cur_width, this->GetPageElementFloatWidth(*pe));
- LayoutCacheElement ce{ pe };
+ LayoutCacheElement ce{ pe, {} };
ce.bounds.left = (fl == ElementFloat::Left) ? 0 : (max_width - cur_width);
ce.bounds.right = (fl == ElementFloat::Left) ? cur_width : max_width;
ce.bounds.top = cur_y;
@@ -745,11 +745,7 @@ public:
case SPET_BUTTON_PUSH:
case SPET_BUTTON_TILE:
case SPET_BUTTON_VEHICLE: {
- const int height = FONT_HEIGHT_NORMAL;
const int tmargin = WD_BEVEL_TOP + WD_FRAMETEXT_TOP;
- const int bmargin = WD_BEVEL_BOTTOM + WD_FRAMETEXT_BOTTOM;
- const int width = ce.bounds.right - ce.bounds.left;
- const int hmargin = width / 5;
const FrameFlags frame = this->active_button_id == ce.pe->index ? FR_LOWERED : FR_NONE;
const Colours bgcolour = StoryPageButtonData{ ce.pe->referenced_id }.GetColour();