ok ok i made a ton of progress on theming

This commit is contained in:
kin fuyuki 2026-02-20 05:38:16 -03:00
commit 5cbb13cf4b
No known key found for this signature in database
GPG key ID: 0E4E8E519FB71401
14 changed files with 128 additions and 61 deletions

View file

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_FLAGS "-std=c++26 -Wno-error -w")
set(CMAKE_CXX_FLAGS "-std=c++26 -Wno-error -Oz -w -g")
file(GLOB_RECURSE FORESPEND_SOURCES CONFIGURE_DEPENDS "src/*.cpp")
add_executable(forespend ${FORESPEND_SOURCES})
if(NOT DEFINED ${ARCH})
@ -14,8 +14,8 @@ target_link_directories(
forespend PUBLIC
"${CMAKE_SOURCE_DIR}/link")
target_link_libraries(forespend PRIVATE
"${CMAKE_SOURCE_DIR}/link/${PLATFORMNAME}/libenginend.so"
"${CMAKE_SOURCE_DIR}/link/${PLATFORMNAME}/libraylib.a"
enginend
raylib
)
target_include_directories(forespend PUBLIC
${CMAKE_SOURCE_DIR}/include

View file

@ -10,7 +10,6 @@ void client::boot() {
this->tickrate=20;
// SetConfigFlags();
InitWindow(380,240,"forespend - 0.03h");
initconfigmenu();
this->currentscene=new mainmenu();
this->currentscene->boot();
target=LoadRenderTexture(380,240);

View file

@ -1,17 +1,16 @@
#include "configmenu.h"
#include "../../common/themes.h"
#include <enginend/scenes/node2d.h>
Font forefont;
int configmenupage=0; // 0 is before the mainpage is showing. aka pause menu/main menu when start game
enginend::group mainpage= enginend::group(
{
new enginend::nodes::labeledbutton("video",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function<void()>([]() {
new enginend::nodes::labeledbutton("video",nullptr,&clienttheme,100,100,0,0,std::function<void()>([]() {
}),forefont,32),
new enginend::nodes::labeledbutton("sound",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function<void()>([]() {
new enginend::nodes::labeledbutton("sound",nullptr,&clienttheme,100,100,0,0,std::function<void()>([]() {
}),forefont,32),
new enginend::nodes::labeledbutton("input",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function<void()>([]() {
new enginend::nodes::labeledbutton("input",nullptr,&clienttheme,100,100,0,0,std::function<void()>([]() {
}),forefont,32),
@ -20,7 +19,7 @@ enginend::group mainpage= enginend::group(
enginend::group graphics= enginend::group(
{
new enginend::nodes::labeledbutton("fullscreen",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function<void()>([]() {
new enginend::nodes::labeledbutton("fullscreen",nullptr,&clienttheme,100,100,0,0,std::function<void()>([]() {
}),forefont,32),
}
@ -34,7 +33,4 @@ enginend::group controls= enginend::group(
{
}
);
void initconfigmenu() {
forefont=LoadFont(AT("res/fonts/dos.fnt"));
}
);

View file

@ -3,10 +3,8 @@
#include <enginend/engine.h>
extern Font forefont;
extern enginend::group maincfgpage;
extern enginend::group graphics;
extern enginend::group sound;
extern enginend::group controls;
extern int configmenupage;
void initconfigmenu();
extern int configmenupage;

View file

@ -1,4 +1,35 @@
#include "themes.h"
enginend::theme clienttheme;
enginend::theme servertheme;
Font forefont;
enginend::theme clienttheme{
.textfieldbg ={127,0,0,127},
.background = {0,0,0,0},
.border = {0,0,0,0},
.booleanbutton = {
{0,200,0,180},
{100,200,100,180},
{100,255,100,255},
{200,0,0,180},
{200,100,100,180},
{255,100,100,255},
},
.text = {255,127,0,255},
.font = forefont,
.tint = {255,255,255,255},
.button = {
{0,0,0,0},
{255,255,255,80},
{255,255,255,160}
},
.buttontext = {
{255,255,255,255},
{255,255,255,255},
{255,255,255,255}
}
};
enginend::theme servertheme;
void initthemes() {
forefont=LoadFont(AT("res/fonts/dos.fnt"));
}

View file

@ -1,5 +1,7 @@
#pragma once
#include <enginend/scenes/nodes.h>
#include <enginend/engine.h>
extern Font forefont;
extern enginend::theme clienttheme;
extern enginend::theme servertheme;
extern enginend::theme servertheme;
void initthemes();

View file

@ -4,6 +4,7 @@
#include "server/server.h"
#include "client/client.h"
#include "common/themes.h"
PLATFORM platform=LINUX;
std::string androidpackage="kn.kinfuyuki.forespend";
inline const char* COMMONCONFIG(){return "common.tdf";}
@ -12,6 +13,7 @@ int main(int argc, char** argv) {
enginend::program* game;
tiny::startup("forespend","0.03g-rewrite");
bool isserver = false;
initthemes();
if (argc>1) {
for (int i=1;i<argc;i++) {
if (argv[i]=="server ") {