Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[DONE - REVIEW] Signs #7952
Conversation
This comment has been minimized.
This comment has been minimized.
|
Good idea, I wanted to add some No-tresspassing signs around the Rivtech facility I'm designing, so that new players don't wander into a death trap. |
This comment has been minimized.
This comment has been minimized.
|
You're blockin' up the scenery and breakin' my mind! ;-P Good thinking, looking forward to this. |
This comment has been minimized.
This comment has been minimized.
|
I love it! This could be tied into the town names system to show names and populations of towns. |
This comment has been minimized.
This comment has been minimized.
|
Agreed with Rivet. |
This comment has been minimized.
This comment has been minimized.
|
I anticipate that this will open up my eyes (nice branch name) ;) |
This comment has been minimized.
This comment has been minimized.
|
For player-writable messages, perhaps overload the grafitti map entity? |
This comment has been minimized.
This comment has been minimized.
|
Glad you guys like music humor. The tesla reference threw me off for just a second. Kevin, thanks for the warning. I wasn't sure if furniture persisted anything or not. I'll take a look at the graffiti code as a starting point. |
jeremyosborne
added some commits
Jun 14, 2014
This comment has been minimized.
This comment has been minimized.
|
About to checkin last piece. Most pieces work, except that I can't confirm map generation of signage works in game, despite how many debugmsg I place in the code. Editmap is a bit of a mystery to me. Check boxes in the original comments explain most things.
"place_specials": [
{ "type": "toilet", "x": 11, "y": 22 },
{ "type": "sign", "x": 10, "y": 22, "signage": "hello cataclysm" }
]
|
jeremyosborne
changed the title
[WIP] Signs
[DONE - REVIEW] Signs
Jun 15, 2014
BevapDin
reviewed
Jun 15, 2014
| @@ -1982,6 +1982,47 @@ void iexamine::curtains(player *p, map *m, const int examx, const int examy) { | |||
| } | |||
| } | |||
|
|
|||
| void iexamine::sign(player *p, map *m, int examx, int examy) | |||
| { | |||
| (void)g; //unused | |||
This comment has been minimized.
This comment has been minimized.
BevapDin
Jun 15, 2014
Contributor
You can remove that line, g once was a parameter to the iexamine functions, but now it's a global variable.
This comment has been minimized.
This comment has been minimized.
BevapDin
reviewed
Jun 15, 2014
| { | ||
| (void)g; //unused | ||
| std::string existing_signage = m->get_signage(examx, examy); | ||
| bool previous_signage_exists = (bool)existing_signage.size(); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jeremyosborne
Jun 16, 2014
Author
Contributor
Done. I'll probably make lots of silly stylistic errors like that.
BevapDin
reviewed
Jun 15, 2014
|
|
||
| // Display existing message, or lack thereof. | ||
| if (previous_signage_exists) { | ||
| popup(_(existing_signage.c_str())); |
This comment has been minimized.
This comment has been minimized.
BevapDin
Jun 15, 2014
Contributor
The translation (the _(...)) should be done when the sing is created. Currently I can spray the text "Maximum trait points" onto that sign and when I examine it, the translated text for this is shown (as the _ function translates the text that I have just entered). This of course only works in non-English environment.
Also, the code that displays the sign text in game.cpp does not translate the text at all.
This comment has been minimized.
This comment has been minimized.
jeremyosborne
Jun 16, 2014
Author
Contributor
Good point. I removed the translation and just pass through the string the user put in. Should we translate the strings at all? Maybe for strings loaded in the JSON?
This comment has been minimized.
This comment has been minimized.
In my test it did one time appear correctly, but not the other times. And in this case the house was in its original (as from the json data) orientation. I guess you forgot to rotate If I use the debug mapgen to generate the house and rotate it there, the sign text is missing. |
jeremyosborne
added some commits
Jun 16, 2014
This comment has been minimized.
This comment has been minimized.
|
BevapDin, i would have never figured out the map::rotate thing. Thank you. Seems to work now by adding in the portage of the signage. |
jeremyosborne
added some commits
Jun 16, 2014
KA101
self-assigned this
Jun 17, 2014
KA101
reviewed
Jun 17, 2014
| @@ -851,7 +851,6 @@ void iexamine::safe(player *p, map *m, int examx, int examy) { | |||
| } | |||
|
|
|||
| void iexamine::bulletin_board(player *p, map *m, int examx, int examy) { | |||
| (void)g; (void)p; //unused | |||
This comment has been minimized.
This comment has been minimized.
KA101
Jun 17, 2014
Contributor
KA101 is being a bit melodramatic here
Nope. if the function calls for p, you'd best make/fake a use for it somewhere. Otherwise the compiler won't be happy.
And when the compiler isn't happy? builds fail and nobody gets DDA!
This comment has been minimized.
This comment has been minimized.
jeremyosborne
Jun 17, 2014
Author
Contributor
I really need to get the same warning level that you have, which I thought the basic build targets did. Which make target do you use for the builds? The presence or lack of the (void)p doesn't throw any warnings or errors in my build, which is:
make NATIVE=osx OSX_MIN=10.7 RELEASE=1 TILES=1 LOCALIZE=0 CLANG=1
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
KA101
Jun 17, 2014
Contributor
Jenkins errors on unused parameters; I imagine Kevin set that to keep our code tidier. I had to make a custom one for mine: -Werror=unused-parameter
KA101
removed their assignment
Jun 17, 2014
KA101
self-assigned this
Jun 17, 2014
This comment has been minimized.
This comment has been minimized.
|
Looks good. Now folks'll have to implement it into their buildings, etc. Stand by. |
KA101
merged commit 495576a
into
CleverRaven:master
Jun 17, 2014
jeremyosborne
deleted the
jeremyosborne:i_saw_the_sign
branch
Jun 17, 2014
This comment has been minimized.
This comment has been minimized.
|
If people report issues, @ me in the messages if you notice before me and I'll fix them (or at least try). |
jeremyosborne commentedJun 13, 2014
Game flavor. Good for marking dangerous areas (mine fields, see issue #7800) or other things.
Open to suggestions, the above are what I'd like to put in.