Compare commits

...
Sign in to create a new pull request.

20 commits

Author SHA1 Message Date
Hendrik Brummermann
d9cd7e774b fixed Plinks text on question completion
Some checks failed
Java CI / build (push) Has been cancelled
2023-12-25 00:29:12 +01:00
Hendrik Brummermann
2793ab2382 avoid creation of "{{...}}"-subclass for initialisation 2023-12-25 00:17:20 +01:00
Jordan Irwin
e462173cd7
Add "challenge" to known chat options 2023-12-23 00:21:17 -08:00
Jordan Irwin
b2f1d21f5f
Make Alrak understand both singular & plural forms of "kobolds" & "supplies" 2023-12-23 00:21:05 -08:00
Jordan Irwin
8a1e83f573
Lighten sickle sprite 2023-12-23 00:20:44 -08:00
Jordan Irwin
47cc43572f
Highlight travel log tabs when selected 2023-12-22 00:23:22 -08:00
Jordan Irwin
93178b8f09
Send chat options event whenever NPC becomes idle 2023-12-21 21:02:31 -08:00
Jordan Irwin
c15aa34830
Register producer activities with chat options 2023-12-21 20:46:38 -08:00
Jordan Irwin
6966df0328
Slightly improved wave emoji 2023-12-21 19:47:08 -08:00
Jordan Irwin
a18c93b323
Thumbs up/down & wave emojis 2023-12-21 19:35:49 -08:00
Jordan Irwin
197c85541b
Remember executed chat options in chat history 2023-12-21 18:49:08 -08:00
Jordan Irwin
abbe0bac01
Add chat options ending with ellipis to chat input instead of sending event 2023-12-21 18:48:54 -08:00
Jordan Irwin
54068a796f
Add ChatInputComponent to singletons 2023-12-21 18:48:43 -08:00
Jordan Irwin
83077c591e
Add "heal" to ChatOptionsEvent.SORT_INDEX 2023-12-21 18:48:34 -08:00
Jordan Irwin
741bface9b
Add "complete" to known chat options 2023-12-21 18:48:23 -08:00
Jordan Irwin
2605e35066
Prevent dialog window title bar placement outside browser page
https://github.com/arianne/stendhal/issues/602
2023-12-21 15:36:15 -08:00
Jordan Irwin
9cc0648272
Disable browser double-tap zoom
Interferes with dpad & double-tap items.
2023-12-21 15:36:05 -08:00
Jordan Irwin
e964352fe9
Make Monogenes respond to both "building" & "buildings" 2023-12-21 15:02:00 -08:00
Jordan Irwin
bef30954e8
Remove click/touch indicator 2023-12-17 22:28:29 -08:00
Hendrik Brummermann
a44c60c08d updated version 2023-12-17 19:21:53 +01:00
30 changed files with 110 additions and 71 deletions

View file

@ -85,7 +85,7 @@ version_server = http://arianne.sourceforge.net/stendhal.version
# current version of stendhal
version.old = 1.44
version = 1.44.5
version = 1.45
# javac options
javac.deprecation = true

View file

@ -1,4 +1,4 @@
site_name: Stendhal 1.44.5 Reference Documentation
site_name: Stendhal 1.45 Reference Documentation
site_description: A fun, friendly, & free multiplayer online adventure game.
copyright: Copyright © 2003-2023 Stendhal
site_url: https://stendhalgame.org/

View file

@ -40,7 +40,11 @@
"musicnotequarter",
"musicnoteeighth",
"musicnotesasc",
"musicnotesdesc"
"musicnotesdesc",
"thumbsup",
"thumbsdown",
"wave"
],
"emojimap":
@ -245,12 +249,20 @@
":nervous:": "sweat",
"💧": "sweat",
":thumbdown:": "thumbsdown",
"👎": "thumbsdown",
":thumbup:": "thumbsup",
"👍": "thumbsup",
":p": "tongue",
":P": "tongue",
":-p": "tongue",
":-P": "tongue",
"😛": "tongue",
"👋": "wave",
":winking:": "wink",
";)": "wink",
";-)": "wink",

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

BIN
data/sprites/emoji/wave.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 B

After

Width:  |  Height:  |  Size: 331 B

Before After
Before After

View file

@ -1,6 +1,6 @@
@echo off
set STENDHAL_VERSION=1.44.5
set STENDHAL_VERSION=1.45
set SERVER_JAR=stendhal-server-%STENDHAL_VERSION%.jar
:: change to server directory

2
runserver.sh Executable file → Normal file
View file

@ -1,6 +1,6 @@
#!/bin/sh
STENDHAL_VERSION="1.44.5"
STENDHAL_VERSION="1.45"
SERVER_JAR="stendhal-server-${STENDHAL_VERSION}.jar"
# change to server directory

View file

@ -26,7 +26,7 @@ public class Debug {
/** version. */
// Note: This line is updated by build.xml using a regexp so be sure to adjust it in case you modify this line.
public static final String VERSION = "1.44.5";
public static final String VERSION = "1.45";
/** pre release suffix */
// Note: This line is updated by build.xml using a regexp so be sure to adjust it in case you modify this line.

View file

@ -67,7 +67,8 @@ public class ConversationPhrases {
public static final List<String> PURCHASE_MESSAGES = Arrays.asList("buy", "purchase");
public static final ImmutableSet<String> KNOWN = ImmutableSet.of("hello", "help", "job",
"task", "done", "another", "offer", "yes", "no", "bye", "buy", "sell", "heal");
"task", "complete", "done", "another", "offer", "yes", "no", "bye", "buy", "sell", "heal",
"challenge");
/**
* Combine a string collection (list) with additional strings.

View file

@ -338,6 +338,7 @@ public class SpeakerNPC extends PassiveNPC {
* the entity with whom the NPC should be talking.
*/
public void setAttending(final RPEntity rpentity) {
final RPEntity was_attending = attending;
attending = rpentity;
lastMessageTurn = SingletonRepository.getRuleProcessor().getTurn();
if (rpentity != null) {
@ -348,6 +349,10 @@ public class SpeakerNPC extends PassiveNPC {
}
setIdea(null);
learnedWordsInCurrentConversation = new HashSet<>();
// send chat option event when NPC becomes "idle"
if (was_attending instanceof Player) {
engine.addChatOptionsEvent((Player) was_attending);
}
}
// set facing direction
@ -478,11 +483,7 @@ public class SpeakerNPC extends PassiveNPC {
}
onGoodbye(attending);
engine.setCurrentState(ConversationStates.IDLE);
final Player player = attending instanceof Player ? (Player) attending : null;
setAttending(null);
if (player != null) {
engine.addChatOptionsEvent(player);
}
}
public boolean inConversationRange() {

View file

@ -35,6 +35,7 @@ import games.stendhal.server.entity.npc.condition.SentenceHasErrorCondition;
import games.stendhal.server.entity.npc.condition.TransitionMayBeExecutedCondition;
import games.stendhal.server.entity.npc.fsm.Engine;
import games.stendhal.server.entity.player.Player;
import games.stendhal.server.events.ChatOptionsEvent;
public class ProducerAdder {
private static final Logger logger = Logger.getLogger(ProducerAdder.class);
@ -73,6 +74,12 @@ public class ProducerAdder {
producerRegister.add(npcName, behaviour);
npc.put("job_producer", "");
final String activity = behaviour.getProductionActivity();
// add to NPC's known chat options
npc.addKnownChatOptions(activity);
// add to known merchant/producer activities
ChatOptionsEvent.addMerchantActivity(activity);
/* The Player greets the NPC.
* The NPC is not currently producing for player (not started, is rejected, or is complete) */
engine.add(ConversationStates.IDLE,

View file

@ -11,7 +11,9 @@
***************************************************************************/
package games.stendhal.server.events;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@ -47,16 +49,23 @@ public class ChatOptionsEvent extends RPEvent {
SORT_INDEX.put("Yes", 11);
SORT_INDEX.put("No", 12);
SORT_INDEX.put("Another", 21);
SORT_INDEX.put("Done", 22);
SORT_INDEX.put("Task", 23);
SORT_INDEX.put("Complete", 22);
SORT_INDEX.put("Done", 23);
SORT_INDEX.put("Task", 24);
SORT_INDEX.put("Challenge", 25);
SORT_INDEX.put("Help", 31);
SORT_INDEX.put("Job", 32);
SORT_INDEX.put("Offer", 33);
SORT_INDEX.put("Buy ...", 34);
SORT_INDEX.put("Sell ...", 35);
SORT_INDEX.put("Heal", 41);
SORT_INDEX.put("Bye", 9999);
}
// common triggers for merchants & producers
private static final List<String> merchantActivities = new LinkedList<>(Arrays.asList("buy", "sell"));
private String trigger;
private String label;
private String options = "";
@ -67,7 +76,7 @@ public class ChatOptionsEvent extends RPEvent {
String label = Grammar.makeUpperCaseWord(trigger);
String options = "";
if (trigger.equals("buy") || trigger.equals("sell") || trigger.equals("")) {
if (merchantActivities.contains(trigger) || trigger.equals("")) {
label = label + " ...";
options = "params";
}
@ -172,4 +181,15 @@ public class ChatOptionsEvent extends RPEvent {
rpclass.addAttribute(NPC, Type.STRING);
rpclass.addAttribute(OPTIONS, Type.VERY_LONG_STRING);
}
/**
* Add a word or phrase to list of known merchant/producer activities.
*/
public static void addMerchantActivity(final String activity) {
if (ChatOption.merchantActivities.contains(activity)) {
return;
}
ChatOption.merchantActivities.add(activity);
// XXX: should it also be added to ChatOption.SORT_INDEX?
}
}

View file

@ -122,7 +122,7 @@ public class MeetMonogenes extends AbstractQuest {
"That's right, like that! Now, I can show you a #map or direct you to the #bank, the #library, the #tavern, the #temple, the #blacksmith, the #bakery, or the old #village.");
npc.addReply(
"buildings",
"building",
"I can show you a #map or direct you to the #bank, the #library, the #tavern, the #temple, the #blacksmith, the #bakery, the #public #chest or the old #village.");
npc.add(

View file

@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2023 - Stendhal *
***************************************************************************
***************************************************************************
* *
@ -255,7 +255,7 @@ public class ObsidianKnife extends AbstractQuest {
// Player asks what supplies he needs, and a random choice of what he
// wants is made.
npc.add(ConversationStates.QUEST_ITEM_QUESTION,
"supplies",
"supply",
null,
ConversationStates.QUEST_OFFERED,
null,

View file

@ -81,9 +81,9 @@ public class PlinksToy implements QuestManuscript {
step2();
quest.complete()
.greet("Ah, I see, you have enough coal to keep my BBQ on! Is it for me?")
.respondToReject("Well then, hopefully someone else will help me before my BBQ goes out.")
.respondToAccept("You found him! *hugs teddy* Thank you, thank you! *smile*")
.greet("You found my teddy! Please, please, may I have him back?")
.respondToReject("*snifff*")
.respondToAccept("*hugs teddy* Thank you, thank you! *smile*")
.rewardWith(new IncreaseXPAction(20))
.rewardWith(new IncreaseKarmaAction(10));

View file

@ -89,7 +89,7 @@ public class BlacksmithNPC implements ZoneConfigurator {
addJob("I am a blacksmith. I was a mountain dwarf but I left that lot behind me. Good riddance, I say!");
addHelp("I've heard rumours of a fearsome creature living below these mines, and his small minions, evil imps. I wouldn't go down there even to look, if I were you. It's very dangerous.");
addOffer("#Wrvil is the one who runs a shop, not me. I still #make the occasional #bobbin if you need one, though.");
addReply("kobolds", "You know, those odd furry creatures. Don't get much conversation out of any except #Wrvil.");
addReply("kobold", "You know, those odd furry creatures. Don't get much conversation out of any except #Wrvil.");
addReply("Wrvil", "He runs a trading business not far from here. I used to make the odd item for him, but don't have any energy left.");
addGoodbye();

View file

@ -8,6 +8,11 @@
overflow: hidden;
}
/* disable double-tap zoom in browsers that support it */
html {
touch-action: manipulation;
}
/* disable pull down refresh in browsers that support it */
html, body {
overscroll-behavior: none;

View file

@ -252,7 +252,6 @@
<label class="checksetting"><input type="checkbox" id="chk_chestqp">Quick pickup from chests and corpses</label>
<label class="checksetting"><input type="checkbox" id="chk_movecont">Continuous movement</label>
<label class="checksetting"><input type="checkbox" id="chk_pvtsnd">Private message notifications</label>
<label class="checksetting"><input type="checkbox" id="chk_clickindicator">Display clicks/touches</label>
<label class="checksetting"><input type="checkbox" id="chk_pathfinding">Click ground to move</label>
</div>
<div id="settings_panel3" class="verticalgroup vgroupcolr">
@ -415,9 +414,6 @@
<div></div>
</template>
<!-- place at end of document so drawn above all other elements -->
<img id="click-indicator">
<!-- hidden canvas for manipulating images before being displayed -->
<canvas id="drawing-stage"></canvas>

View file

@ -48,8 +48,6 @@ export class Client {
private unloading = false;
public username?: string;
private static click_indicator_id: number|undefined = undefined;
/** Singleton instance. */
private static instance: Client;
@ -425,20 +423,6 @@ export class Client {
soundbutton.addEventListener("click", stendhal.main.toggleSound);
// update button state
this.onSoundToggled();
// click/touch indicator
// TODO:
// - animate
// - would work better if displayed upon mousedown/touchstart then position updated & timer
// started upon release
const click_indicator = document.getElementById("click-indicator")! as HTMLImageElement;
click_indicator.onload = () => {
click_indicator.onload = null;
// FIXME: some event handlers cancel propagation
document.addEventListener("click", Client.handleClickIndicator);
document.addEventListener("touchend", Client.handleClickIndicator);
};
click_indicator.src = stendhal.paths.gui + "/click_indicator.png";
}
toggleSound() {
@ -493,22 +477,4 @@ export class Client {
// use Stendhal's built-in cursor for entire page
(e.target as HTMLElement).style.cursor = "url(" + stendhal.paths.sprites + "/cursor/normal.png) 1 3, auto";
}
static handleClickIndicator(e: Event) {
if (!stendhal.config.getBoolean("input.click.indicator")) {
return;
}
if (Client.click_indicator_id !== undefined) {
clearTimeout(Client.click_indicator_id);
Client.click_indicator_id = undefined;
}
const pos = stendhal.data.html.extractPosition(e);
const click_indicator = document.getElementById("click-indicator")! as HTMLImageElement;
click_indicator.style["left"] = (pos.pageX - (click_indicator.width / 2)) + "px";
click_indicator.style["top"] = (pos.pageY - (click_indicator.height / 2)) + "px";
click_indicator.style["display"] = "inline";
Client.click_indicator_id = setTimeout(function() {
click_indicator.style["display"] = "none";
}, 300);
}
}

View file

@ -27,6 +27,8 @@ import { Paths } from "./data/Paths";
import { SpriteStore, store } from "./data/SpriteStore";
import { TileStore } from "./data/TileStore";
import { ui } from "./ui/UI";
import { UIComponentEnum } from "./ui/UIComponentEnum";
import { HTMLManager } from "./ui/HTMLManager";
import { Inventory } from "./ui/Inventory";
import { KeyHandler } from "./ui/KeyHandler";
@ -35,6 +37,8 @@ import { SoundManager } from "./ui/SoundManager";
import { TouchHandler } from "./ui/TouchHandler";
import { ViewPort } from "./ui/ViewPort";
import { ChatInputComponent } from "./ui/component/ChatInputComponent";
export class SingletonRepo {
@ -46,6 +50,10 @@ export class SingletonRepo {
return CacheManager.get();
}
static getChatInput(): ChatInputComponent {
return ui.get(UIComponentEnum.ChatInput) as ChatInputComponent;
}
static getClient(): Client {
return Client.get();
}

View file

@ -38,12 +38,14 @@ export class ProgressStatusEvent extends RPEvent {
travelLogDialog = new TravelLogDialog(dataItems);
new FloatingWindow("Travel Log", travelLogDialog, dstate.x, dstate.y).setId("travellog");
}
travelLogDialog.updateTabs();
return;
}
if (!travelLogDialog) {
return;
}
travelLogDialog.updateTabs();
if (!this["item"]) {
if (progressType === "repeatable") {

View file

@ -570,8 +570,6 @@ export class ViewPort {
stendhal.ui.touch.unsetHeldItem();
stendhal.ui.touch.unsetOrigin();
}
// execute here because "touchend" event propagation is cancelled on the veiwport
Client.handleClickIndicator(e);
}
onContentMenu(e: MouseEvent) {

View file

@ -113,7 +113,7 @@ export class ChatInputComponent extends Component {
}
}
private remember(text: string) {
public remember(text: string) {
if (this.history.length > 100) {
this.history.shift();
}

View file

@ -11,6 +11,7 @@
import { DialogContentComponent } from "../toolkit/DialogContentComponent";
import { Chat } from "../../util/Chat";
import { singletons } from "../../SingletonRepo";
declare var marauroa: any;
declare var stendhal: any;
@ -89,11 +90,21 @@ export class ChatOptionsDialog extends DialogContentComponent {
}
private onButtonPressed(keyword: string) {
const action = {
"type": "chat",
"text": keyword
} as any;
marauroa.clientFramework.sendAction(action);
if (keyword.endsWith("...")) {
// add to chat input instead of sending text
while (keyword.endsWith(".")) {
keyword = keyword.substring(0, keyword.length-1);
}
singletons.getChatInput().setText(keyword);
} else {
const action = {
"type": "chat",
"text": keyword
} as any;
marauroa.clientFramework.sendAction(action);
// add to chat history
singletons.getChatInput().remember(keyword);
}
this.close();
}
}

View file

@ -126,9 +126,6 @@ export class SettingsDialog extends DialogContentComponent {
undefined, "ui/notify_up", "null");
chk_pvtsnd.checked = stendhal.config.get("event.pvtmsg.sound") === "ui/notify_up";
this.createCheckBox("chk_clickindicator", "input.click.indicator",
"Displaying clicks", "Not displaying clicks");
this.createCheckBox("chk_pathfinding", "client.pathfinding",
"Pathfinding on ground enabled", "Pathfinding on ground disabled");

View file

@ -67,12 +67,24 @@ export class TravelLogDialog extends DialogContentComponent {
});
}
public updateTabs() {
document.querySelectorAll(".progressTypeButton").forEach((tab) => {
const element = document.getElementById(tab.id)! as HTMLElement;
if (element.id == this.currentProgressType) {
// highlight selected tab
element.style.setProperty("background-color", "#b3b3b3");
} else {
element.style.removeProperty("background-color");
}
});
}
private onProgressTypeButtonClick(event: Event) {
// clear details when changing category
this.refreshDetails();
this.currentProgressType = (event.target as HTMLElement).id;
this.updateTabs();
var action = {
"type": "progressstatus",
"progress_type": this.currentProgressType

View file

@ -163,8 +163,12 @@ export class FloatingWindow extends Component {
window.removeEventListener("mouseup", this.onMouseUpDuringDragListener, true);
window.removeEventListener("touchmove", this.onMouseMovedDuringDragListener, true);
window.removeEventListener("touchend", this.onMouseUpDuringDragListener, true);
this.onMoved();
}
/**
* Keeps dialog window within browser page.
*/
private checkPos(): any {
if (this.content) {
this.content.onMoved();

View file

@ -51,7 +51,6 @@ export class ConfigManager {
"gamescreen.nonude": "false",
"gamescreen.shadows": "true",
"gamescreen.speech.creature": "true",
"input.click.indicator": "false",
"input.movecont": "false",
//"input.doubleclick": "false",
"action.item.doubleclick": "false",