summaryrefslogtreecommitdiff
path: root/src/scenes
diff options
context:
space:
mode:
Diffstat (limited to 'src/scenes')
-rw-r--r--src/scenes/puzzleScene.c19
-rw-r--r--src/scenes/resultView.c5
2 files changed, 19 insertions, 5 deletions
diff --git a/src/scenes/puzzleScene.c b/src/scenes/puzzleScene.c
index 67d3c86..48e1238 100644
--- a/src/scenes/puzzleScene.c
+++ b/src/scenes/puzzleScene.c
@@ -13,8 +13,9 @@ typedef struct {
const int HEADER_FONT_SIZE = 50;
const int PADDING = 10;
+const int EDITOR_PADDING = 3;
const int BORDER = 2;
-const int FOOTER_HEIGHT = 40;
+const int FOOTER_HEIGHT = 30;
void DrawPuzzleName(char *name) {
Vector2 width = MeasureTextEx(*GetMainFont(), name, 50, 1);
@@ -43,7 +44,6 @@ void DrawControls(Scene *self, Rectangle rect) {
.height = panel.height,
};
// Hacky. Should find a way to update in update()
- UpdateButton(data->submitButton, &submit_trg);
DrawButton(data->submitButton, &submit_trg);
acc -= (panel.height + PADDING);
}
@@ -104,7 +104,14 @@ bool drawPuzzleScene(void *self) {
DrawTextInRec(pane1, data->PuzzlePtr->Description,
GetMainFont(), 20, COLORSCHEME_BROWN, 3, &data->scroll);
- DrawTextArea(data->EditorInfo, pane2);
+
+ Rectangle editor_rect = {
+ .x = pane2.x + EDITOR_PADDING,
+ .y = pane2.y + EDITOR_PADDING,
+ .width = pane2.width - EDITOR_PADDING * 2,
+ .height = pane2.height - EDITOR_PADDING * 2,
+ };
+ DrawTextArea(data->EditorInfo, editor_rect);
Rectangle controls_rect = {
.x = PADDING,
@@ -134,9 +141,11 @@ bool updatePuzzleScene(void *self) {
GetPanesSplit(&pane1, &pane2, body, 0.35, 0.4);
UpdateTextArea(data->EditorInfo, pane2);
- if (IsKeyPressed(KEY_F5)) {
+ if (IsKeyPressed(KEY_F5))
SubmitPuzzle(self);
- }
+
+ if (data->submitButton != NULL)
+ UpdateButton(data->submitButton);
return true;
}
diff --git a/src/scenes/resultView.c b/src/scenes/resultView.c
index f3735ed..567cb02 100644
--- a/src/scenes/resultView.c
+++ b/src/scenes/resultView.c
@@ -1,6 +1,7 @@
#include <raylib.h>
#include <stdarg.h>
#include <stddef.h>
+#include <stdint.h>
#include <stdlib.h>
#include "scenes.h"
#include "../ui_elements/UI.h"
@@ -9,6 +10,7 @@
static const int PADDING = 20;
static const int BORDER = 2;
static const int SCROLL_SPEED = 10;
+static const uint8_t MAX_TINT = 96;
typedef struct {
SubmitionResult *value;
@@ -54,6 +56,9 @@ bool updateResultView(void *self) {
bool drawResultView(void *self) {
ResultViewData *data = ((Scene *)self)->data;
+ DrawRectangle(0, 0,
+ GetScreenWidth(), GetScreenHeight(),
+ (Color) {0, 0, 0, MAX_TINT * (1 - data->scroll_up) });
// DrawBackground();
Rectangle body = GetResultViewBodyRect(data->scroll_up);