Commit Graph

12 Commits

Author SHA1 Message Date
Zorchenhimer f76d184173 Don't hardcode emote size
Replaced the hardcoded height attribute in the emote img tags with a
class attribute.  This allows the emotes to be resized with the change
of a CSS value instead of recompiling the server.

Resolves #150
2021-01-16 15:36:44 -05:00
Zorchenhimer fab56e39ea Rework emote parsing to properly handle wrapped emotes
Reworked the emote parsing to properly handle "wrapped" emotes.  A
wrapped emote is one that is wrapped in colons or square braces (eg,
:Kappa: or [Kappa]).  This allows emotes to be input without a space
between them, like is required with non-wrapped emotes.

A new configuration setting has been added to only allow parsing of
wrapped emotes: "WrappedEmotesOnly".  This defaults to False as to not
break current configurations.

The emote autocompletion will only insert non-wrapped emotes.  Setting
"WrappedEmotesOnly" configuration value to True will not change this.

Lastly, made the bare-word emote parsing a bit cleaner by removing a for
loop in favor of a map lookup with a check.  This should in theory be
more efficient.

This change is in response to #111.  The issue should not be considered
resolved until the autocompletion handles the new setting correctly.
2020-04-19 12:26:27 -04:00
Zorchenhimer 6347065dd4 Fix duplicating emotes with /reloademotes
Don't reload emotes directly into the global common.Emotes variable.
Instead, load them into a new variable and write that to common.Emotes
after the search for new emotes completes.  Emotes should no longer
duplicate for each run of `/reloademotes`.

Also tweaked `/addemotes` to automatically reload emotes if nothing went
wrong downloading a new set.
2019-09-22 16:51:13 -04:00
Zorchenhimer a73375f152 Fix emotes
This reworks how emotes are cached in relation to their physical
location on disk.  Functionally, they should be the same from the user
perspective but it sets up some stuff that will make it easier to add
emotes from various sources.
2019-06-18 22:13:53 -04:00
joeyak 7962fad02e commiting so zorch can do my work 2019-06-01 19:41:28 -04:00
Zorchenhimer 0ff872065f Fix trimming characters on non-emote words
Don't trim anything from non-emote words when parsing emotes.
2019-03-30 15:41:33 -04:00
joeyak ca72dc28c0 Add autocomplete for emotes
closes #9
2019-03-30 15:23:54 -04:00
Zorchenhimer f5ea701127 Add colon to the emote trim cutset
This enables parsing emotes in the format :emote: as defined in #9.
This does not add auto-complete, just brings emote parsing up to date.
2019-03-26 12:27:18 -04:00
Zorchenhimer fdbf39f00c Add some logging
Functions added:
- LogErrorf()
- LogErrorln()
- LogChatf()
- LogChatln()
- LogInfof()
- LogInfoln()
- LogDebugf()
- LogDebugln()
- LogDevf()
- LogDevln()

New settings configure the logging: LogLevel and LogFile.  LogLevel can
be set to one of: error, chat, info, or debug and will default to
error.  LogFile is an optional file to write to.  Providing a file will
not prevent output in the console.

LogDevf() and LogDevln() only compile when the "dev" flag passed to
build.  This will cause Travis-CI to fail the build if it finds any
calls to either function.
2019-03-24 18:58:59 -04:00
Zorchenhimer 37cf2f7811 Fix auto-scrolling with emotes
All emotes are set to have a height of 28px.  This fixes the
auto-scroll on message when the message has emotes, but it also forces
all emotes to be 28px high.
2019-03-23 18:13:55 -04:00
Zorchenhimer 49e997c5ff Move some stuff to MovieNight.common
Moved to common/utils.go:
- IsValidName() (function replaces direct calls to regexp.MatchString())
- RandomColor()

Moved to common/emotes.go:
- LoadEmotes()
2019-03-19 17:25:49 -04:00
Zorchenhimer 1c6c23da3e Add /nick command
Using this command will change the current user's nickname in chat.
It has an alias of /name.

An admin can force a name change by supplying the current name and a new
name.  If a name has been changed by an admin, that user can no longer
change their name (similar to forced color change).

Resolves #42
2019-03-19 17:13:20 -04:00