Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2023-04-03 00:00:00Z and 2023-04-04 00:00:00Z
Avatar
Avatar
Ravie
but I also agree with heinrich that team logic inside Die function is kinda unclean
I added this into teams.cpp, is this better? Or should I do more? bool CGameTeams::SquashTeammates(int Team) { return Team != TEAM_FLOCK && Count(Team) > 1 && GetTeamState(Team) != CGameTeams::TEAMSTATE_OPEN; }
Avatar
@Voxel if you use it in only one place then I'd say this one line doesn't need to be a function, otherwise nice
Avatar
Avatar
Ravie
@Voxel if you use it in only one place then I'd say this one line doesn't need to be a function, otherwise nice
no i mean, this used to be in characters.cpp
00:37
I don't know if to also add in the actual sending of the packets or just that part of the code into teams.cpp
Avatar
@Voxel I'd say the message sending should be in KillTeam
Avatar
Avatar
Ravie
@Voxel I'd say the message sending should be in KillTeam
but KillTeam doesn't even get reached when you're in team 0
00:46
and stuff
Avatar
I mean the team kill message
00:47
i think i know what to do now
Avatar
so OnCharacterDeath checks if whole team should die and calls KillTeam and that sends the message automatically and then separately in CCharacter::Die you send the single tee death message if needed
Avatar
So I should only check !Teams()->SquashTeammates(Team()) in CCharacter::Die?
00:48
Meaning if it's false?
Avatar
ye I guess so
Avatar
Avatar
Ewan
is there any existing drag & drop mechanism within ddnet UI
also is there any existing text input mask mechanism
Avatar
Avatar
Ewan
is there any existing drag & drop mechanism within ddnet UI
i think ones in progress
Avatar
Avatar
Ravie
@Voxel if you use it in only one place then I'd say this one line doesn't need to be a function, otherwise nice
ok i split it out of the function since it's only used in one place
Avatar
Avatar
Voxel
i think ones in progress
cool
01:30
maybe lacks context but lmk what you think
01:30
ui wise
Avatar
woah wtf is this
01:33
oh its figma
01:33
what's the concept for?
Avatar
status bar
01:38
for tater
01:38
when i asked here devs did not show interest so i just added to tater
01:39
and he wants settings menu before merge
Avatar
okay so I have a component that is being changed by these settings, but the automatic update functionality is implemented with a conchain & as such editing the value directly does not cause it to update (which is what i have to do in the settings, i think)
04:55
how can i find this component and call the same thing the conchain calls
04:56
(which just happens to be OnWindowResize())
04:56
i've always seen stuff like parent->findObject<ObjectType>("name"); or something
04:56
does teeworlds have something similar
04:57
alternatively how can i change a console value without the user using the console
04:58
is ExecuteLine() my only option? seems kinda bad to have to re-format the string over and over
Avatar
oh right i can get it through the client
05:07
silly me
Avatar
RequestInterface<>()?
Avatar
Avatar
Ewan
alternatively how can i change a console value without the user using the console
g_Config.m_SvXXXXX
05:20
that doesn't trigger conchains from what i can tell
05:20
which was the whole reason for me asking
Avatar
Just call it yourself
Avatar
Avatar
fokkonaut
RequestInterface<>()?
it doesn't have to be dynamic so thankfully i don't have to
Avatar
Avatar
Ewan
oh right i can get it through the client
please read
Avatar
Avatar
fokkonaut
Just call it yourself
put the stuff in a function and call it yourself
Avatar
I did it already
05:22
05:22
this works for me and i don't need to call it
05:22
i just call OnWindowResize to force reflow it
05:22
which is how i designed it from the start i just forgot how to get the component instance
Avatar
is there a way to get a max console configurable value for a particular console setting
Avatar
chillerdragon BOT 2023-04-03 06:47:10Z
Check the code where it is clamped maybe you see it there
08:33
is there a less ugly way to draw stuff like this
08:33
built in icons or something
Avatar
Those are not icons
08:54
I believe those buttons just have text
Avatar
did you read
Avatar
Try to look for a button that doesn't look like its "icon" can be represented using text
08:55
I think the settings one is an icon (with the gearwheel) (edited)
Avatar
hurr durr i wonder if these are icons
08:56
i just want to know if there are existing add/remove and arrow icons
Avatar
I doubt it
08:57
do you want to make these icons?
Avatar
I might make them but i want to know if they exist already
Avatar
What is your experience with IDEs for Teeworlds development? I used CLion in the past but my license is over now, I guess VSCode? For Linux ofc
Avatar
Just try it out. If it's nothing for u, there is eclipse. Some kind of vim. Qtcreator. Kate
09:33
Btw ddnet also has a vs code workspace
09:34
And some stuff for vim
Avatar
i would count Kate and vim as text-editors and less of an IDE, I bet eclipse can be used for anything nowadays, used it for Java (and python but meh)
Avatar
Well pure vim maybe yes. But u probably customize it to smth I'd consider ide
Avatar
Avatar
Jupstar ✪
Btw ddnet also has a vs code workspace
that's nice! I will take a look, thank you 😘
Avatar
But we already had such discussions xd
Avatar
I am not a huge vim fan, in fact, the opposite, a Nano one 😉
Avatar
Avatar
AssassinTee
I am not a huge vim fan, in fact, the opposite, a Nano one 😉
Emacs, helix maybe ?
Avatar
For terminals i use micro.bcs it has saner hotkeys to me xd
Avatar
Avatar
Nagi01 {LAN}
Emacs, helix maybe ?
Swoosh
Avatar
Emacs is for the true tryhards xd
09:39
The community behind it is really smth else
Avatar
vscode just works
09:48
use it
09:48
also it has vim mode
Avatar
yes, noticed that too, tested on windows too, but libpng was not found (automatically)
Avatar
thats not a vscode problem
Avatar
I know
Avatar
Avatar
AssassinTee
What is your experience with IDEs for Teeworlds development? I used CLion in the past but my license is over now, I guess VSCode? For Linux ofc
VsCode not an IDE Madge
Avatar
Vs code is as much of an ide as ddnet is a superset of teeworlds
Avatar
Something tells me that my setup is wrong
Avatar
missing textures
Avatar
(i know it was just missing the data dir)
Avatar
Avatar
AssassinTee
Something tells me that my setup is wrong
You leaked the ddnet 2.0 design
Avatar
I bet the FPS are great due to the reduced number of textures!
Avatar
Depends^^ but possibly
10:54
U should do a study
Avatar
cursed?
11:42
set tile height to 15 and width to 20 xD
Avatar
@Avolicious ur the docker guy maybe u know, how can i make sure a network is up before services start in a stack/compose thingy
12:14
sometimes my stack fails to start because the order is random and the network doesnt exist yet
12:17
root@debian-ryzen ~/mediawiki # ./deploy.sh Ignoring unsupported options: links, restart Creating service mediawiki_database failed to create service mediawiki_database: Error response from daemon: network mediawiki_default not found root@debian-ryzen ~/mediawiki # ./deploy.sh Ignoring unsupported options: links, restart Creating service mediawiki_mediawiki failed to create service mediawiki_mediawiki: Error response from daemon: network mediawiki_default not found root@debian-ryzen ~/mediawiki # ./deploy.sh Ignoring unsupported options: links, restart Creating network mediawiki_default Creating service mediawiki_mediawiki Creating service mediawiki_database
12:17
boring docker
12:17
bad
12:22
why are networks not created before services always
12:22
nonsense
Avatar
just created a map that crashes the client 🙂
Avatar
That's not hard xd
Avatar
Avatar
AssassinTee
just created a map that crashes the client 🙂
By only using the map editor or with external tools?
Avatar
I can send you the map, it will crash you in the editor and on a server that is hosting it
12:34
By external tools/custom ddnet client
Avatar
Then it's not very interesting
12:35
There are hundreds of those
Avatar
Avatar
Ryozuki
sometimes my stack fails to start because the order is random and the network doesnt exist yet
Are you using docker-compose or running docker commands via deploy.sh?
Avatar
deploy.sh is
12:47
docker stack deploy -c stack.yml mediawiki
Avatar
docker-compose keeps everything in order & waits for till it comes up
Avatar
i thought stack was the shiny super new thing
12:48
a replacement of compose
Avatar
Docker stack is used for a swarm
12:48
Noo
12:48
The docker stack deploy command supports any Compose file of version “3.0” or above. If you have an older version, see the upgrade guide.
12:49
What docker version are you using?
12:49
docker info
12:49
i need to use this instead
12:49
docker stack deploy --compose-file docker-compose.yml
12:49
i think
12:49
?
12:50
v2.17.2
Avatar
Avatar
Ryozuki
docker stack deploy --compose-file docker-compose.yml
Yeah if you have an docker-compose.yml file, then go for this instead
12:50
Are you using docker swarm?
12:50
xD
12:50
altho its just my server
Avatar
But you want to be prepared to scale?
Avatar
i mean i doubt i need scaling
Avatar
Or why have you considered using swarm
Avatar
its the ddnet wiki
12:51
i used it cuz i thought it was the replacement for compose
12:51
xD
12:51
and i like new shiny software
Avatar
Ahhh I see
12:51
Well, actually I'd go with docker compose without using swarm
12:51
The swarm just adds the scalability
12:52
so just run docker compose up -d
12:52
That should do the trick
12:52
We are using K3s, but docker is fair enough
Avatar
well i guess i need to rename stack.yml to docker-compose.yml
Avatar
There is a difference in how the file is structured
12:53
docker-compose.yml is built different than stack.yml
12:53
You want to deploy mediawiki, no?
Avatar
[+] Running 2/2 ✔ mediawiki Pulled 1.1s ✔ database Pulled 1.1s WARN[0001] volume "mediawiki_ddnetwiki-images" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume WARN[0001] volume "mediawiki_ddnetwiki-extensions" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume WARN[0001] volume "mediawiki_ddnetwiki-apache2" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume WARN[0001] volume "mediawiki_ddnetwiki-mariadb" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume [+] Running 3/3 ✔ Network mediawiki_default Created 0.0s ✔ Container mediawiki-database-1 Started 0.5s ✔ Container mediawiki-mediawiki-1 Started
12:53
hmm
12:53
do i put external
12:53
i guess yes
Avatar
If the network is external, yes
Avatar
this is about volumes the warning
Avatar
The network is not external accessible
Avatar
Avatar
Avolicious
You want to deploy mediawiki, no?
yeah
Avatar
docker bridge networks
12:54
rip
Avatar
thats outdated
12:55
MediaWiki is a free software open source wiki package written in PHP.
12:55
i used this
12:55
and cuz it said stack too
12:55
i got confused xd
Avatar
AH I see
12:55
They are not using stack specific stuff
12:56
Okay, sure... then you can go with docker compose -f stack.yml up -d
12:59
ok i got it working xd
13:00
or not
13:02
ok now
13:02
bye bye swarm
Avatar
👋 swarm
13:09
If you are not wanting so scale like hell, do not use swarm 😄
Avatar
@Ewan maybe you found out already but there is an icon font in the client that you can use, it has a lot of stuff
Avatar
I have an issue: I want to affect the size of a tile that is rendered by the client, so here https://github.com/ddnet/ddnet/blob/master/src/game/client/components/maplayers.cpp#L1002 But there is no way to change this, I don't understand how this rendering works: https://github.com/ddnet/ddnet/blob/1b1f2a0621c9871c99b4acc9a08018a7b2a4a355/src/engine/client/graphics_threaded.cpp#L1645 I guess you fill some buffer with images and send it to the graphics card? (edited)
Avatar
No
14:22
Depends what ur goal is. Dynamic tile sizes or only in the setup code?
Avatar
i want dynamic tile sizes, and the only thing holding me back rn is the ingame rendering
14:22
the rest already works
Avatar
U can use the camera zoom or add a scale parameter to the shaders
Avatar
was this relating to that one request for you to be able to change non game layer sizes
14:24
or is this smth else
Avatar
no this is exactly that
Avatar
ah cool!
Avatar
The Editor works fine
14:25
changed tile sizes to 20/15 for everything except any logic layers (game, font, speed etc)
Avatar
Avatar
Jupstar ✪
U can use the camera zoom or add a scale parameter to the shaders
a scale parameter would be sufficient
14:26
or 2
Avatar
Ok u have to be careful for border tiles
14:27
There are quite some calculations that assume the old size
14:27
Best is u search for all 32 in the file
14:28
And shaders
Avatar
I changed every 32 that i could find
Avatar
And backends
14:28
Ok
Avatar
where do I find the shaders?
Avatar
Data shaders
Avatar
thx
Avatar
Btw this feature would require a break with backward compability. Even if u have my support. Heinrich will probably prevent it at every cost
Avatar
my idea is, to force details on every non standard size, also i can load the map with the older client
Avatar
It would still render incorrectly
Avatar
ah yes it tries to render versions > their version 🤔
Avatar
Would have to be a new layer type altogether, so old clients ignore the unknown layer type
Avatar
That would still lead to incorrect rendering
14:34
Then we can also break compability
14:35
Do we want random bloat software at every aspect of the game now ? XD
14:35
Nobody will understand why what renders and why not
Avatar
For other clients (like 0.7) you are still serving other maps, removing that layer there would be no issue, problems only occur with older ddnet versions
14:36
H
Avatar
If those new layers are always considered Detail layers, then there is no issue with incorrect rendering when they are missing
14:37
There is also the existing Details flag for layers, which can be set by the mappers arbitrarily
Avatar
Ppl will not understand why it's detail only then.. u must look from the perspective of non it guy
Avatar
idea is to add this feature as a detail now, and remove the forced detail in the future because most people updated
Avatar
It would be independent from the existing Detail flag
14:38
The new layer would only be rendered by new clients
Avatar
Avatar
Robyt3
It would be independent from the existing Detail flag
that's a new idea 😮
Avatar
But conceptually it only adds details, so maps must be playable if the layer is not rendered
Avatar
exactly
Avatar
Gl with that xd
14:42
I really wonder why we always do such random solutions instead of finally deciding on how we want to cleanly evolve the game. Imagine u start a game and see maps with different tile sizes but for u in the editor it will only work when u enable a detail flag or use a different layer type
14:42
That's absolutely not intuitive
Avatar
both would be automatic
Avatar
also consider if it's even worth adding cause for such a major change I can only think of 1 map effect using it
Avatar
That makes it even more random
Avatar
a different layer type would also be invisible to the user
Avatar
Avatar
AssassinTee
a different layer type would also be invisible to the user
But increase complexity
Avatar
Avatar
Ravie
also consider if it's even worth adding cause for such a major change I can only think of 1 map effect using it
i think you underestimate the usecases ... you could even make a "big ddnet" campaign with every map x2 as big (edited)
14:44
I would use it simply for details
Avatar
it would be only nice for adding some depth to background tile layers, other than that only really weird stuff
14:45
and we can already do x2 size maps with Patiga's tools xD
Avatar
It can create nice parllex effects for background layers i guess . I've seen it in many 2d games
Avatar
How many users would we lose if we break map format compatibility?
Avatar
How many would we loose if we break any compatibility: 5-10
14:46
Of 3k xd
Avatar
unless you break compatibility with older ddnet clients, then like half of the community
Avatar
Avatar
Ravie
unless you break compatibility with older ddnet clients, then like half of the community
Lmao
Avatar
Avatar
Ravie
unless you break compatibility with older ddnet clients, then like half of the community
Yes, that would be the case if we break the map format compatibility by switching to an entirely different format
Avatar
I can still finish this, make a PR and you can collect features for the future when you decide to break compatability
Avatar
Avatar
Robyt3
How many users would we lose if we break map format compatibility?
well the infclass community using TeeUniverse will get a little more work to adjust xd
Avatar
Well then I guess they'd need to update too.. somehow it worked for 0.5 -> 0.6 so it should work for ddrace too
Avatar
yeah easily, kaffeine does a good job keeping the software up to date
Avatar
Also I assume the player base is rather small. In worst case they'd get incompatible for an uncertain time
14:53
I just hope that our rendering code doesn't end up like the network code. Unmaintainable bloat
Avatar
I wonder how many people play with show gametiles only and wouldn't even notice xD
Avatar
Most
14:53
Pros
Avatar
the same ones with incompatible client
Avatar
I wonder if it would be too bad to be honest. Even if the rendering is a bit fucked for a different size, when it's a forced detail it can be turned of and in most cases it would work too (in the bg for example)
Avatar
Well I'd then say this would be the moment to tell the outdated client that it does not run correctly anymore
Avatar
did exactly that in a mod of mine: https://github.com/AssassinTee/catch64/blob/27d236cd7b10d1e2ef5a64a247dcd13f8d1661a4/src/game/server/gamecontext.cpp#L845 is there already a way to send an info to a client that he might be outdated when loading a map in ddnet? (edited)
Avatar
I guess not really. Maybe over a ban message or If we add it today chance is high it could be useful in one year xd
Avatar
I could add this to the scaling PR: Old Client loads map -> Server notices client version to low for map version -> Sends info text, client still be able to play the map, might have some incorrect rendering
15:05
And for anything which gets its own map served (like 0.7), removing the layer is no problem (edited)
Avatar
I think u don't get my point. This is all bloat that has to be maintained and isn't intuitive (edited)
15:08
If u leave ddnet development in 2 month. It's someone else having to understand the code
Avatar
so I KISS, so far it is, it's just scaling. I wonder how it can be so hard to add this in the first place
Avatar
Yeah horrible right xd
Avatar
if i were game dev: If userversion != latest, disconnect("Update!")
Avatar
Yes xd
15:17
Like most games do
Avatar
I'm also not sure if this addition is worth it
Avatar
no, because you can do it all with slicing, add the tileset as a quad, slice each tile out of it, make each quad smaller, puzzle your way to smaller tiles
15:33
i don't see the fps issue there (because I have none)
Avatar
if you're gonna do it with quads then you might as well write a twmap script that takes a tile layer and converts it to scaled quads xD
Avatar
I should do that for funsies
Avatar
you can even make them all move then
Avatar
could even simulate shadows with them
Avatar
Avatar
Ravie
@Ewan maybe you found out already but there is an icon font in the client that you can use, it has a lot of stuff
thanks
Avatar
pulling my hair out with these icon font glyphs
18:28
can't get the escapes right
Avatar
whatever i'll just use \u
Avatar
String literals are bad in source files
18:53
Unicode literals I mean
18:54
They are hard to reproduce
18:54
I just mean for existing icons the game is doing triplets of \x which I was trying to replicate
Avatar
yeah that's it
Avatar
but it was dumb so i just did \u which is a newer escape sequence but should work fine anyway
18:55
anyway. ain't that neat
Avatar
no outline?
Avatar
it's there but maybe hard to see
18:56
it's the default outline color on the default button color so idk
Avatar
normally the client uses the same black shadow for text
Avatar
yeah you're right
18:56
oh lmfao i'm drawing the button after
18:57
anyways im gonna make an enum for fonticons
18:57
so that it's much easier to read
Avatar
uh not sure if it's that simple xd unicode literals aren't always same size and what not
Avatar
doesn't matter
19:00
enum UnicodeMap : uint16_t {} or something
19:00
or just wchar lol
Avatar
I mean weren't unicode symbols made up of 2 others a thing? but maybe the icons don't have it
Avatar
so would i put it into textrenderer.h?
19:02
or is there like, a text.h
Avatar
also do u wanna name every icon in the font or what
19:03
FONTICON_PLUS FONTICON_MINUS FONTICON_LEFT_ARROW (edited)
Avatar
Yeah, fits in textrender.h
Avatar
seems like this should be autogen'd
19:03
but if there's no existing mapping then i guess there's no point
Avatar
I mean this is like a 10th of it so good luck, you never know what someone might use
19:05
though most of those are emojis
19:05
the lower values are what should be enum'd
Avatar
Would be easier to use string literals instead of an enum. const char *FONTICON_CROSS = "\xEF\x80\x8D"; (edited)
Avatar
Avatar
Ravie
I mean this is like a 10th of it so good luck, you never know what someone might use
there is an entire website
Avatar
Avatar
Voxel
HOW TO ADD A NEW ICON TO DDNET: So basically every icon is in a free pack, and you can find all the instances here: https://fontawesome.com/search?o=r&m=free&s=solid . Once you find the icon you like, you have to understand how DDNet reads these symbols. They rely on the UTF-8 encoding, meaning you have to covert it somehow. This website should be perfect for it: https://onlineunicodetools.com/convert-unicode-to-utf8 . You just select the symbol you want in font awesome, click the Copy Glyph button and paste it in the new website. Its output should look something like this: ef 8f ad. Now you just copy that into a code piece that accepts font icons, and format it to \xEF\x8F\xAD. (edited)
look here
Avatar
Avatar
Robyt3
Would be easier to use string literals instead of an enum. const char *FONTICON_CROSS = "\xEF\x80\x8D"; (edited)
messier for sure
19:07
that would also compile as a char literal
19:07
which can be enumerated
Avatar
also personally if I were to look up what icon I wanna use, having to look up the enum value instead of using unicode is even more work xD
Avatar
\u works just fine though
Avatar
Avatar
Ravie
also personally if I were to look up what icon I wanna use, having to look up the enum value instead of using unicode is even more work xD
maybe
19:08
binding it in some fashion is definitely better than having loose string literals for icons in the menu components though
Avatar
Avatar
Ravie
also personally if I were to look up what icon I wanna use, having to look up the enum value instead of using unicode is even more work xD
you can just type in FONT_ICON and you'd be given a list
Avatar
but i wanna see the icons and not names
Avatar
you don't always know which one you want
19:09
also there are many duplicates and references
19:09
so that won't suffice
Avatar
Avatar
Ravie
I mean this is like a 10th of it so good luck, you never know what someone might use
like here I find which one I want and then copy the unicode value and boom I'm done
Avatar
yeah i think fontforge's OS clipboard implementation is broken in my version
19:10
because i couldn't copy anything lol
Avatar
but what if you're an outsider and don't really know how to do that
Avatar
you can also use the fontawesome website
Avatar
There is no real benefit to using an enumeration here. Just put the string literal in a namespace and the usage is basically the same as an enum class. Then you don't need to encode the value as utf8 at runtime.
Avatar
So I just make a long list of const chars?
Avatar
you should find some documentation of the icons or whatever first and not do all 100000 by hand xd
Avatar
Avatar
Voxel
So I just make a long list of const chars?
yes, I'd put them in a separate namespace, but it looks like the other constants in textrender.h are also not in a namespace
Avatar
Avatar
Ravie
you should find some documentation of the icons or whatever first and not do all 100000 by hand xd
i'm not going to do ALL of them, just the ones in the code currently
Avatar
ye ok but they all have official names and it's probably listed somewhere
Avatar
on the website
Avatar
but I mean in a way that is easy to steal all at once xd
Avatar
i have code to draw 4 buttons and a clearable edit box in a line buttons get drawn fine & i'm recycling and moving the rect left to draw so why is it that after i draw the buttons & go to draw the edit box at the same rect just moved left a little bit, it's somewhere else on the screen entirely
19:28
buttons are here and that space on the right is meant to be taken by the box
19:28
but the box is like naw actually i'll just draw myself here
Avatar
you should be making one rect and splitting it accordingly and putting the gui elements in the new split rects
Avatar
why's that
Avatar
dunno just the way this weird system works
19:33
there are functions for splitting rects that assign the new split rects to the pointers that you give it
Avatar
i get it's convention but there's no reason i shouldn't be able to move them myself
19:36
and besides i am using the split functions i'm just recycling the rect
19:36
because i only need it once
Avatar
Avatar
Ewan
but the box is like naw actually i'll just draw myself here
it was my bad i had the arguments mismatched
Avatar
Avatar
Voxel
wtf
why u define constants in source file (edited)
19:37
do it in a header that has a header guard
Avatar
where tf is a header guard (edited)
19:37
what tf is a h
Avatar
u can do like #pragma once or (more old friendly) #ifndef HEADER_H #define HEADER_H // header contents #endif // HEADER_H
19:38
if the compiler goes over the header more than once then anything within the guard is not re-parsed
Avatar
Avatar
Voxel
where tf is a header guard (edited)
C and c++ lovely headers
Avatar
that already is in textrender.h
Avatar
make them static voxel
19:39
translation unit shenanigans
Avatar
so i make all the font icon things const static chars?
19:40
and if you are defining them as literals & they aren't dependent on a non-constexpr function result you can make them constexpr
19:40
makes it more or less equivalent to #defining it
Avatar
well it works now
Avatar
static constexpr char* something = "this is a compile-time determinable value that is defined in all translation units"; (edited)
Avatar
im pretty sure there's a way to get the symbol name out of the font file rather than define them in the code
Avatar
yeah but when you're looking at the unicode INSIDE the code it's a bit harder isn't it?
Avatar
we can use a script to create the enum or all the const char* that is then included somewhere
👍 1
19:46
will probably work only on linux/macos though
Avatar
Well here's what I did so far before reading this c++ namespace FontIcons { const static char *FONT_ICON_LOCK = "\xEF\x80\xA3"; const static char *FONT_ICON_HEART = "\xEF\x80\x84"; const static char *FONT_ICON_CERTIFICATE = "\xEF\x82\xA3"; const static char *FONT_ICON_CHECK = "\xEF\x80\x8C"; const static char *FONT_ICON_XMARK = "\xEF\x80\x8D"; }
19:48
so you can know how to format it if you do write a script
Avatar
is this rly worth it
19:51
just hardcode it
19:51
not like ddnet code looks pretty anyway
Avatar
don't say like this
20:05
robyt3 tries his best to clean up tw/ddnet codebase and he did plenty
Avatar
his cleanup is diferent
20:09
it makes sense xD
20:09
but im just an observant
Avatar
ryoz🔍 zki
Avatar
it does look good
20:33
about as clean as most code from the era gets
20:33
it has a concrete system for almost everything
Avatar
its c its bound to look bad
20:33
dont at me learath
Avatar
it’s cpp
20:35
even tho it’s not devout stl everything imo it still looks more cppish than c-ish
Avatar
i know
Avatar
attractive language
Avatar
c-driven teeworlds > cpp-driven teeworlds
20:36
cmm
Avatar
Avatar
Voxel
Well here's what I did so far before reading this c++ namespace FontIcons { const static char *FONT_ICON_LOCK = "\xEF\x80\xA3"; const static char *FONT_ICON_HEART = "\xEF\x80\x84"; const static char *FONT_ICON_CERTIFICATE = "\xEF\x82\xA3"; const static char *FONT_ICON_CHECK = "\xEF\x80\x8C"; const static char *FONT_ICON_XMARK = "\xEF\x80\x8D"; }
hard-coding just the icons that we use is good enough for me. adding a script to generate all icons is overkill in my opinion
Avatar
Avatar
gerdoe
c-driven teeworlds > cpp-driven teeworlds
okey actually not xd
Avatar
the man has spoken
20:37
you shall obey
Avatar
waitin for ryo-driven ddnet
Avatar
Avatar
Ryozuki
dont at me learath
@Ryozuki
💯 1
Avatar
it seems i can't access variable min/max/default values because CCommand (the implementation through which these variables are used within the console) is private
23:16
sad
23:16
i just have to make an assumption i guess
Avatar
idk wtf i did but when I was testing every font icon, I went into the editor, and then clicked on Load and then I got this: Debug Assertion Failed! Program: ...os\DDNet Builds\fonticon_enum\out\build\x64-Release\DDNet.exe File: minkernel\crts\ucrt\src\appcrt\time\strftime.cpp Line: 135 Expression: timeptr != nullptr
Avatar
looks totally unrelated
23:37
but idk why it would do that when u change font stuff
23:37
I tried reverting my change, and that wasn't the issue
Avatar
../src/engine/textrender.h:53:21: error: ‘FontIcons::FONT_ICON_HEART’ defined but not used [-Werror=unused-variable] 53 | static const char *FONT_ICON_HEART = "\xEF\x80\x84"; | ^~~~~~~~~~~~~~~ ../src/engine/textrender.h:52:21: error: ‘FontIcons::FONT_ICON_MAGNIFYING_GLASS’ defined but not used [-Werror=unused-variable] 52 | static const char *FONT_ICON_MAGNIFYING_GLASS = "\xEF\x80\x82"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/engine/textrender.h:51:21: error: ‘FontIcons::FONT_ICON_LOCK’ defined but not used [-Werror=unused-variable] 51 | static const char *FONT_ICON_LOCK = "\xEF\x80\xA3"; | ^~~~~~~~~~~~~~
23:47
(they are used)
Avatar
why is that an error xd
Avatar
That's the -Werror flag isn't it? It's just making the unused var warning into an error (edited)
23:49
And if they are used... maybe an issue in the linking? (edited)
Avatar
wait wtf is the difference between a char* TEXT and a char *TEXT
Exported 423 message(s)