Comments (3)
I could be unclear on exactly what the request is, but IRC->Cube color codes already work, albeit not entirely as they should. This line shows that all it does is find any EOT escapes (\x03
/ ^C
) that IRC clients use as the start of a "color code" and converts it to a FF (\f
), which is the Cube Engine equivalent.
However, the colors that each number in the color escape sequence represents may not match the ones that Cube uses depending on the IRC client. This is because the IRC protocol does not in itself support color codes and is a feature implemented by the IRC client, thus the color mappings may vary, or not exist at all. Most clients that I know of conform to mIRC color codes.
There are two problems with the current implementation:
- Cube color codes will not match up with most (if not all) IRC clients
- 2-digit IRC color codes will not work
Regarding the first point, examine the table below. What appears as say, Green in a message sent in IRC would appear as Red in-game, because the color code 3 is Green in IRC, but Red in Cube.
Code | mIRC | Cube |
---|---|---|
0 | White | Green |
1 | Black | Blue |
2 | Blue | Yellow |
3 | Green | Red |
4 | Red | Grey |
5 | Brown | Magenta |
6 | Purple | Orange |
7 | Orange | White |
8 | Yellow | Black |
9 | Light Green | Cyan |
Regarding the second problem, Cube only uses a single character to determine the color in the color escape sequence (not counting the use of brackets), where IRC color codes can use 2 digits. Consider the following message, sent by a user in IRC:
^C13this message is in pink!
In IRC, it would display: this message is in pink!
, in pink/magenta as intended. However, in game chat you would see: 3this message is in pink!
in Blue. Notice the 3 at the beginning?
This is because only the 1
in 13
is a part of the Cube color escape sequence; the 3 is left as a part of the regular text and it is rendered Blue.
This could be fixed by applying the reverse of what converttext()
does to deal with color escapes to ircrecv()
. I can work out a patch to do just this. 😃
from base.
Well, I've got working code at the moment, just need to make sure it melds well with the rest of the code and I'm not missing any bugs
from base.
Fixed by #47
from base.
Related Issues (20)
- Inifinite fullscreen to window & back loop. HOT 5
- Sounds linked to pushers do not play correctly in succession
- Master Appimage not being built HOT 3
- Map Shots are Forked HOT 1
- bilinear and tirlinear settings do not save HOT 4
- Sunlight Rotation with Skybox Feature Request
- some buttons do not work/throw errors HOT 1
- ogg files seen as corrupted when read from a zip archive
- Ability to scale individual axis of mapmodels.
- Weapon dynamic lights stop appearing if they only touch models (such as players), but no world geometry HOT 1
- Support for displacement textures on mapmodels.
- Crouch animations are not used for forced crouching when the ceiling is too low HOT 1
- Customizable campaign system HOT 1
- Dehardcode player bodies and skins, allow modding like vanity items HOT 3
- Entity links not persisted when moving or copying / pasting entities
- Undoing brush edits occasionally crashes
- Persistent console history
- Circle Bar And Stamina bar issue (minor HUD bug) HOT 2
- Sound not working HOT 12
- Crash when using `/bloodsize 1`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from base.