ok ok i made a ton of progress on theming
This commit is contained in:
parent
9ebb95135b
commit
5cbb13cf4b
14 changed files with 128 additions and 61 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
project(games)
|
project(games)
|
||||||
set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error ")
|
set(CMAKE_CXX_FLAGS "-std=c++26 -Wno-error -Oz")
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(PLATFORM_DIR "windows")
|
set(PLATFORM_DIR "windows")
|
||||||
else()
|
else()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
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 -w -Oz -g")
|
||||||
|
|
||||||
if (DEFINED PLATFORMNAME)
|
if (DEFINED PLATFORMNAME)
|
||||||
SET(CURRPLATFORM ${PLATFORMNAME})
|
SET(CURRPLATFORM ${PLATFORMNAME})
|
||||||
|
|
@ -9,7 +9,7 @@ endif (DEFINED PLATFORMNAME)
|
||||||
|
|
||||||
file(GLOB_RECURSE ENGINE_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
file(GLOB_RECURSE ENGINE_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
||||||
|
|
||||||
add_library(enginend SHARED ${ENGINE_SOURCES} )
|
add_library(enginend STATIC ${ENGINE_SOURCES} )
|
||||||
target_link_directories(
|
target_link_directories(
|
||||||
enginend PUBLIC
|
enginend PUBLIC
|
||||||
"${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}")
|
"${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}")
|
||||||
|
|
@ -33,8 +33,8 @@ target_link_directories(
|
||||||
test PUBLIC
|
test PUBLIC
|
||||||
"${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}")
|
"${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}")
|
||||||
target_link_libraries(test PRIVATE
|
target_link_libraries(test PRIVATE
|
||||||
#"${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}/libenginend.so"
|
|
||||||
enginend
|
enginend
|
||||||
|
raylib
|
||||||
)
|
)
|
||||||
target_include_directories(test PUBLIC
|
target_include_directories(test PUBLIC
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
|
|
||||||
|
|
@ -135,17 +135,15 @@ namespace enginend{
|
||||||
protected:
|
protected:
|
||||||
std::string result;
|
std::string result;
|
||||||
public:
|
public:
|
||||||
Font font;
|
|
||||||
float fs;
|
float fs;
|
||||||
Color txc;
|
|
||||||
std::string content;
|
std::string content;
|
||||||
text(){fs=20;}
|
text(){fs=20;}
|
||||||
text(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize,std::string txt):
|
text(Texture2D* texture,enginend::theme* theme,double x,double y,double w,double h,float fsize,std::string txt):
|
||||||
//tinted(texture,color,x,y,w,h),
|
//tinted(texture,color,x,y,w,h),
|
||||||
font(f),fs(fsize),content(txt),txc(txcol)
|
fs(fsize),content(txt)
|
||||||
{
|
{
|
||||||
this->x=x;this->y=y;this->w=w;this->h=h;
|
this->x=x;this->y=y;this->w=w;this->h=h;
|
||||||
this->texture=texture;this->c=color;
|
this->texture=texture;this->theme=theme;
|
||||||
result=content;
|
result=content;
|
||||||
size_t initp=0;
|
size_t initp=0;
|
||||||
while((initp=result.find("\n",initp))!=std::string::npos){
|
while((initp=result.find("\n",initp))!=std::string::npos){
|
||||||
|
|
@ -175,14 +173,14 @@ namespace enginend{
|
||||||
tiny::echo("og: %f %f %f %f", x,y,w,h);
|
tiny::echo("og: %f %f %f %f", x,y,w,h);
|
||||||
tiny::echo("drawing text: %s", content.c_str());
|
tiny::echo("drawing text: %s", content.c_str());
|
||||||
tiny::echo("transformed: %f %f %f %f", ax, ay, aw, ah);
|
tiny::echo("transformed: %f %f %f %f", ax, ay, aw, ah);
|
||||||
Vector2 minsize=MeasureTextEx(font,content.c_str(),fs,1);
|
Vector2 minsize=MeasureTextEx(this->theme->font,content.c_str(),fs,1);
|
||||||
Vector2 charsize=MeasureTextEx(font," ",fs,1);
|
Vector2 charsize=MeasureTextEx(this->theme->font," ",fs,1);
|
||||||
float p=charsize.x>charsize.y?charsize.x/minsize.x:charsize.y/minsize.y;
|
float p=charsize.x>charsize.y?charsize.x/minsize.x:charsize.y/minsize.y;
|
||||||
p=p*2;
|
p=p*2;
|
||||||
int minh=(minsize.y>ah)?minsize.y:ah;
|
int minh=(minsize.y>ah)?minsize.y:ah;
|
||||||
int minw=(minsize.x>aw)?minsize.x:aw;
|
int minw=(minsize.x>aw)?minsize.x:aw;
|
||||||
DrawRectangle(ax-charsize.x,ay-charsize.y,minw+p,minh+p,c);
|
DrawRectangle(ax-charsize.x,ay-charsize.y,minw+p,minh+p,this->theme->background);
|
||||||
DrawTextEx(font,content.c_str(),{ax,ay},fs,1,txc);
|
DrawTextEx(this->theme->font,content.c_str(),{ax,ay},fs,1,this->theme->text);
|
||||||
}
|
}
|
||||||
void exit()override{
|
void exit()override{
|
||||||
tinted::exit();
|
tinted::exit();
|
||||||
|
|
@ -192,8 +190,14 @@ namespace enginend{
|
||||||
void(*func)();
|
void(*func)();
|
||||||
bool pressed;
|
bool pressed;
|
||||||
bool hover;
|
bool hover;
|
||||||
button():func(nullptr),pressed(false),hover(false){}
|
const bool isboolean;
|
||||||
button(Texture2D* texture,Color color,double x,double y,double w,double h,void(*f)()):func(f),pressed(false),hover(false),tinted(texture,color,x,y,w,h){}
|
bool boolean=false;
|
||||||
|
button():func(nullptr),pressed(false),hover(false),isboolean(false){}
|
||||||
|
button(Texture2D* texture,enginend::theme* theme,double x,double y,double w,double h,void(*f)()):func(f),pressed(false),hover(false),isboolean(false) {
|
||||||
|
this->theme=theme;
|
||||||
|
}button(Texture2D* texture,enginend::theme* theme,double x,double y,double w,double h,void(*f)(),bool isboolean):func(f),pressed(false),hover(false),isboolean(isboolean) {
|
||||||
|
this->theme=theme;
|
||||||
|
}
|
||||||
void boot()override{}
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
Vector2 mouse=GetMousePosition();
|
Vector2 mouse=GetMousePosition();
|
||||||
|
|
@ -203,16 +207,26 @@ namespace enginend{
|
||||||
if(CheckCollisionPointRec(mouse,r)){hover=true;
|
if(CheckCollisionPointRec(mouse,r)){hover=true;
|
||||||
if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){
|
if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){
|
||||||
pressed=true;
|
pressed=true;
|
||||||
|
c=isboolean?boolean?
|
||||||
|
this->theme->booleanbutton[5]:this->theme->booleanbutton[2]:
|
||||||
|
this->theme->button[2];
|
||||||
if(func)func();
|
if(func)func();
|
||||||
}else{
|
}else{
|
||||||
pressed=false;
|
pressed=false;
|
||||||
|
c=isboolean?boolean?
|
||||||
|
this->theme->booleanbutton[4]:this->theme->button[1]:
|
||||||
|
this->theme->button[1];
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
hover=false;
|
hover=false;
|
||||||
pressed=false;
|
pressed=false;
|
||||||
|
c=isboolean?boolean?
|
||||||
|
this->theme->booleanbutton[3]:this->theme->button[0]:
|
||||||
|
this->theme->button[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void draw()override {
|
void draw()override {
|
||||||
|
|
||||||
tinted::draw();
|
tinted::draw();
|
||||||
}
|
}
|
||||||
void exit()override{
|
void exit()override{
|
||||||
|
|
@ -221,13 +235,16 @@ namespace enginend{
|
||||||
};
|
};
|
||||||
struct labeledbutton :virtual public button {
|
struct labeledbutton :virtual public button {
|
||||||
std::string label;
|
std::string label;
|
||||||
Font font;
|
|
||||||
int fs;
|
int fs;
|
||||||
Color txc;
|
Color txc;
|
||||||
labeledbutton(std::string name,Texture2D* texture,Color color,Color text,
|
labeledbutton(std::string name,Texture2D* texture,enginend::theme*theme,Color text,
|
||||||
|
double x,double y,double w,double h,void(*f)(),int size):fs(size),txc(text),label(name),
|
||||||
|
button(texture,theme,x,y,w,h,f)
|
||||||
|
{}
|
||||||
|
labeledbutton(std::string name,Texture2D* texture,enginend::theme*theme,Color text,
|
||||||
double x,double y,double w,double h,void(*f)(),
|
double x,double y,double w,double h,void(*f)(),
|
||||||
Font fnt,int size):font(fnt),fs(size),txc(text),label(name),
|
int size,bool isboolean):fs(size),txc(text),label(name),
|
||||||
button(texture,color,x,y,w,h,f)
|
button(texture,theme,x,y,w,h,f,isboolean)
|
||||||
{}
|
{}
|
||||||
void boot()override{}
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
|
|
@ -241,12 +258,27 @@ namespace enginend{
|
||||||
float ay=y*sh;
|
float ay=y*sh;
|
||||||
float aw=w*sw;
|
float aw=w*sw;
|
||||||
float ah=h*sh;
|
float ah=h*sh;
|
||||||
Vector2 tsize=MeasureTextEx(font,label.c_str(),fs,1);
|
Vector2 tsize=MeasureTextEx(this->theme->font,label.c_str(),fs,1);
|
||||||
Vector2 tpos={
|
Vector2 tpos={
|
||||||
ax+(aw-tsize.x)/2,
|
ax+(aw-tsize.x)/2,
|
||||||
ay+(ah-tsize.y)/2
|
ay+(ah-tsize.y)/2
|
||||||
};
|
};
|
||||||
DrawTextEx(font,label.c_str(),tpos,fs,1,txc);
|
if (hover) {
|
||||||
|
if (pressed) {
|
||||||
|
txc=isboolean?boolean?
|
||||||
|
this->theme->booleantext[5]:this->theme->booleantext[2]:
|
||||||
|
this->theme->buttontext[2];
|
||||||
|
}else {
|
||||||
|
txc=isboolean?boolean?
|
||||||
|
this->theme->booleantext[4]:this->theme->buttontext[1]:
|
||||||
|
this->theme->button[1];
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
txc=isboolean?boolean?
|
||||||
|
this->theme->booleantext[3]:this->theme->button[0]:
|
||||||
|
this->theme->button[0];
|
||||||
|
}
|
||||||
|
DrawTextEx(this->theme->font,label.c_str(),tpos,fs,1,txc);
|
||||||
}
|
}
|
||||||
void exit()override{
|
void exit()override{
|
||||||
button::exit();
|
button::exit();
|
||||||
|
|
@ -288,8 +320,8 @@ namespace enginend{
|
||||||
};
|
};
|
||||||
struct textfield :public text{
|
struct textfield :public text{
|
||||||
textfield(){}
|
textfield(){}
|
||||||
textfield(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize,std::string txt):
|
textfield(Texture2D* texture,enginend::theme *theme,double x,double y,double w,double h,float fsize,std::string txt):
|
||||||
text(texture,txcol,color,x,y,w,h,f,fsize,txt){}
|
text(texture,theme,x,y,w,h,fsize,txt){}
|
||||||
void boot()override{}
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
text::tick();
|
text::tick();
|
||||||
|
|
@ -301,13 +333,13 @@ namespace enginend{
|
||||||
float ay=y*sh;
|
float ay=y*sh;
|
||||||
float aw=w*sw;
|
float aw=w*sw;
|
||||||
float ah=h*sh;
|
float ah=h*sh;
|
||||||
Vector2 charsize=MeasureTextEx(font," ",fs,0);
|
Vector2 charsize=MeasureTextEx(this->theme->font," ",fs,0);
|
||||||
Vector2 minsize=MeasureTextEx(font,content.c_str(),fs,charsize.x/2);
|
Vector2 minsize=MeasureTextEx(this->theme->font,content.c_str(),fs,charsize.x/2);
|
||||||
float po=charsize.x>charsize.y?charsize.x/charsize.y:charsize.y/charsize.x;po=po*5;
|
float po=charsize.x>charsize.y?charsize.x/charsize.y:charsize.y/charsize.x;po=po*5;
|
||||||
int minh=(minsize.y>ah)?minsize.y:ah;
|
int minh=(minsize.y>ah)?minsize.y:ah;
|
||||||
int minw=(minsize.x>aw)?minsize.x:aw;
|
int minw=(minsize.x>aw)?minsize.x:aw;
|
||||||
DrawRectangle(ax-(po/2),ay-(po/2),minw+(po*1.1),minh+(po*1.1),c);
|
DrawRectangle(ax-(po/2),ay-(po/2),minw+(po*1.1),minh+(po*1.1),this->theme->textfieldbg);
|
||||||
DrawTextEx(font,content.c_str(),{ax,ay},fs,charsize.x/2,txc);
|
DrawTextEx(this->theme->font,content.c_str(),{ax,ay},fs,charsize.x/2,this->theme->text);
|
||||||
}
|
}
|
||||||
void exit()override{
|
void exit()override{
|
||||||
text::exit();
|
text::exit();
|
||||||
|
|
@ -317,8 +349,8 @@ namespace enginend{
|
||||||
bool active;
|
bool active;
|
||||||
int cpos;
|
int cpos;
|
||||||
textinput():active(false),cpos(0){}
|
textinput():active(false),cpos(0){}
|
||||||
textinput(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize):active(false),cpos(0),
|
textinput(Texture2D* texture,enginend::theme *theme,double x,double y,double w,double h,float fsize):active(false),cpos(0),
|
||||||
text(texture,txcol,color,x,y,w,h,f,fsize,""){}
|
text(texture,theme,x,y,w,h,fsize,""){}
|
||||||
void boot()override{}
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
text::tick();
|
text::tick();
|
||||||
|
|
@ -351,7 +383,7 @@ namespace enginend{
|
||||||
float sh=GetScreenHeight();
|
float sh=GetScreenHeight();
|
||||||
float ax=x*sw;
|
float ax=x*sw;
|
||||||
float ay=y*sh;
|
float ay=y*sh;
|
||||||
DrawRectangle(ax+MeasureTextEx(font,content.c_str(),fs,1).x,ay,2,fs,{0,0,0,127});
|
DrawRectangle(ax+MeasureTextEx(this->theme->font,content.c_str(),fs,1).x,ay,2,fs,{0,0,0,127});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void exit()override{
|
void exit()override{
|
||||||
|
|
@ -362,8 +394,8 @@ namespace enginend{
|
||||||
bool active;
|
bool active;
|
||||||
int cpos;
|
int cpos;
|
||||||
textinputfield():active(false),cpos(0){}
|
textinputfield():active(false),cpos(0){}
|
||||||
textinputfield(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize):active(false),cpos(0),
|
textinputfield(Texture2D* texture,enginend::theme *theme,double x,double y,double w,double h,float fsize):active(false),cpos(0),
|
||||||
textfield(texture,txcol,color,x,y,w,h,f,fsize,""){}
|
textfield(texture,theme,x,y,w,h,fsize,""){}
|
||||||
void boot()override{}
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
textfield::tick();
|
textfield::tick();
|
||||||
|
|
@ -411,7 +443,7 @@ namespace enginend{
|
||||||
line+=ch;
|
line+=ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DrawRectangle(p.x+MeasureTextEx(font,line.c_str(),fs,1).x,p.y,2,fs,rl::BLACK);
|
DrawRectangle(p.x+MeasureTextEx(this->theme->font,line.c_str(),fs,1).x,p.y,2,fs,rl::BLACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void exit()override{
|
void exit()override{
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,12 @@
|
||||||
#include<tiny/term.h>
|
#include<tiny/term.h>
|
||||||
|
|
||||||
namespace enginend {
|
namespace enginend {
|
||||||
|
struct theme;
|
||||||
|
|
||||||
namespace nodes {
|
namespace nodes {
|
||||||
struct node{
|
struct node{
|
||||||
public:
|
public:
|
||||||
|
enginend::theme* theme;
|
||||||
virtual void boot()=0;
|
virtual void boot()=0;
|
||||||
virtual void tick()=0;
|
virtual void tick()=0;
|
||||||
virtual void draw()=0;
|
virtual void draw()=0;
|
||||||
|
|
@ -29,7 +32,9 @@
|
||||||
|
|
||||||
struct theme {
|
struct theme {
|
||||||
// in case if its a boolean button, it will use booleanbutton
|
// in case if its a boolean button, it will use booleanbutton
|
||||||
Color booleanbutton[3],button[3],booleantext[3],buttontext[3],text,buttonborder[3],booleanborder[3],border;
|
Color booleanbutton[6],button[3],booleantext[6],buttontext[3],text,buttonborder[3],booleanborder[6],border,background
|
||||||
|
,textfieldbg
|
||||||
|
;
|
||||||
|
|
||||||
Font font;
|
Font font;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ else ()
|
||||||
endif (DEFINED PLATFORMNAME)
|
endif (DEFINED PLATFORMNAME)
|
||||||
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "-std=c++26 -w -g -Wno-error -O0")
|
set(CMAKE_CXX_FLAGS "-std=c++11 -w -g -Wno-error -O0")
|
||||||
file(GLOB_RECURSE ENDLAUNCHER "src/*.cpp")
|
file(GLOB_RECURSE ENDLAUNCHER "src/*.cpp")
|
||||||
add_executable(endlauncher ${ENDLAUNCHER})
|
add_executable(endlauncher ${ENDLAUNCHER})
|
||||||
|
|
||||||
|
|
@ -18,7 +18,8 @@ target_link_directories(
|
||||||
endlauncher PUBLIC
|
endlauncher PUBLIC
|
||||||
"${CMAKE_SOURCE_DIR}/link/${PLATFORMNAME}")
|
"${CMAKE_SOURCE_DIR}/link/${PLATFORMNAME}")
|
||||||
target_link_libraries(endlauncher PRIVATE
|
target_link_libraries(endlauncher PRIVATE
|
||||||
"${CMAKE_SOURCE_DIR}/link/${PLATFORMNAME}/libenginend.so"
|
enginend
|
||||||
|
raylib
|
||||||
curl zip
|
curl zip
|
||||||
)
|
)
|
||||||
target_include_directories(endlauncher PUBLIC
|
target_include_directories(endlauncher PUBLIC
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#include <incmgr.h>
|
|
||||||
#include <raylib.h>
|
#include <enginend/engine.h>
|
||||||
#include <enginend/scenes/node2d.h>
|
|
||||||
#include "netio.h"
|
#include "netio.h"
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
@ -119,6 +118,8 @@ public:
|
||||||
const char* CONF() final{return "test.tdf";}
|
const char* CONF() final{return "test.tdf";}
|
||||||
launcher(){};
|
launcher(){};
|
||||||
void boot() override {
|
void boot() override {
|
||||||
|
currentscene = new scene{};
|
||||||
|
|
||||||
tickrate=15;
|
tickrate=15;
|
||||||
framerate=15;
|
framerate=15;
|
||||||
SetConfigFlags(FLAG_WINDOW_UNDECORATED|FLAG_WINDOW_TRANSPARENT|FLAG_WINDOW_TOPMOST);
|
SetConfigFlags(FLAG_WINDOW_UNDECORATED|FLAG_WINDOW_TRANSPARENT|FLAG_WINDOW_TOPMOST);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
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")
|
file(GLOB_RECURSE FORESPEND_SOURCES CONFIGURE_DEPENDS "src/*.cpp")
|
||||||
add_executable(forespend ${FORESPEND_SOURCES})
|
add_executable(forespend ${FORESPEND_SOURCES})
|
||||||
if(NOT DEFINED ${ARCH})
|
if(NOT DEFINED ${ARCH})
|
||||||
|
|
@ -14,8 +14,8 @@ target_link_directories(
|
||||||
forespend PUBLIC
|
forespend PUBLIC
|
||||||
"${CMAKE_SOURCE_DIR}/link")
|
"${CMAKE_SOURCE_DIR}/link")
|
||||||
target_link_libraries(forespend PRIVATE
|
target_link_libraries(forespend PRIVATE
|
||||||
"${CMAKE_SOURCE_DIR}/link/${PLATFORMNAME}/libenginend.so"
|
enginend
|
||||||
"${CMAKE_SOURCE_DIR}/link/${PLATFORMNAME}/libraylib.a"
|
raylib
|
||||||
)
|
)
|
||||||
target_include_directories(forespend PUBLIC
|
target_include_directories(forespend PUBLIC
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ void client::boot() {
|
||||||
this->tickrate=20;
|
this->tickrate=20;
|
||||||
// SetConfigFlags();
|
// SetConfigFlags();
|
||||||
InitWindow(380,240,"forespend - 0.03h");
|
InitWindow(380,240,"forespend - 0.03h");
|
||||||
initconfigmenu();
|
|
||||||
this->currentscene=new mainmenu();
|
this->currentscene=new mainmenu();
|
||||||
this->currentscene->boot();
|
this->currentscene->boot();
|
||||||
target=LoadRenderTexture(380,240);
|
target=LoadRenderTexture(380,240);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
#include "configmenu.h"
|
#include "configmenu.h"
|
||||||
|
#include "../../common/themes.h"
|
||||||
#include <enginend/scenes/node2d.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
|
int configmenupage=0; // 0 is before the mainpage is showing. aka pause menu/main menu when start game
|
||||||
enginend::group mainpage= enginend::group(
|
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),
|
}),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),
|
}),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),
|
}),forefont,32),
|
||||||
|
|
||||||
|
|
@ -20,7 +19,7 @@ enginend::group mainpage= enginend::group(
|
||||||
|
|
||||||
enginend::group graphics= 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),
|
}),forefont,32),
|
||||||
}
|
}
|
||||||
|
|
@ -34,7 +33,4 @@ enginend::group controls= enginend::group(
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
void initconfigmenu() {
|
|
||||||
forefont=LoadFont(AT("res/fonts/dos.fnt"));
|
|
||||||
}
|
|
||||||
|
|
@ -3,10 +3,8 @@
|
||||||
|
|
||||||
#include <enginend/engine.h>
|
#include <enginend/engine.h>
|
||||||
|
|
||||||
extern Font forefont;
|
|
||||||
extern enginend::group maincfgpage;
|
extern enginend::group maincfgpage;
|
||||||
extern enginend::group graphics;
|
extern enginend::group graphics;
|
||||||
extern enginend::group sound;
|
extern enginend::group sound;
|
||||||
extern enginend::group controls;
|
extern enginend::group controls;
|
||||||
extern int configmenupage;
|
extern int configmenupage;
|
||||||
void initconfigmenu();
|
|
||||||
|
|
@ -1,4 +1,35 @@
|
||||||
#include "themes.h"
|
#include "themes.h"
|
||||||
|
|
||||||
enginend::theme clienttheme;
|
Font forefont;
|
||||||
enginend::theme servertheme;
|
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"));
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <enginend/scenes/nodes.h>
|
#include <enginend/engine.h>
|
||||||
|
|
||||||
|
extern Font forefont;
|
||||||
extern enginend::theme clienttheme;
|
extern enginend::theme clienttheme;
|
||||||
extern enginend::theme servertheme;
|
extern enginend::theme servertheme;
|
||||||
|
void initthemes();
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include "server/server.h"
|
#include "server/server.h"
|
||||||
#include "client/client.h"
|
#include "client/client.h"
|
||||||
|
#include "common/themes.h"
|
||||||
PLATFORM platform=LINUX;
|
PLATFORM platform=LINUX;
|
||||||
std::string androidpackage="kn.kinfuyuki.forespend";
|
std::string androidpackage="kn.kinfuyuki.forespend";
|
||||||
inline const char* COMMONCONFIG(){return "common.tdf";}
|
inline const char* COMMONCONFIG(){return "common.tdf";}
|
||||||
|
|
@ -12,6 +13,7 @@ int main(int argc, char** argv) {
|
||||||
enginend::program* game;
|
enginend::program* game;
|
||||||
tiny::startup("forespend","0.03g-rewrite");
|
tiny::startup("forespend","0.03g-rewrite");
|
||||||
bool isserver = false;
|
bool isserver = false;
|
||||||
|
initthemes();
|
||||||
if (argc>1) {
|
if (argc>1) {
|
||||||
for (int i=1;i<argc;i++) {
|
for (int i=1;i<argc;i++) {
|
||||||
if (argv[i]=="server ") {
|
if (argv[i]=="server ") {
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 970c955be89ba6a25db3880e508634467357aff4
|
Subproject commit 2783e40e292de9fb9e671be834baadddeffc325b
|
||||||
Loading…
Add table
Add a link
Reference in a new issue