Skip to content

Commit

Permalink
NWN2: Move cursor group names to cursor.h
Browse files Browse the repository at this point in the history
  • Loading branch information
rjshae authored and DrMcCoy committed Feb 22, 2019
1 parent c81b917 commit 0a267b7
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 68 deletions.
127 changes: 127 additions & 0 deletions src/engines/nwn2/cursor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names
* can be found in the AUTHORS file distributed with this source
* distribution.
*
* xoreos is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* xoreos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with xoreos. If not, see <http://www.gnu.org/licenses/>.
*/

/** @file
* NWN2 cursor types.
*/

#ifndef ENGINES_NWN2_CURSOR_H
#define ENGINES_NWN2_CURSOR_H

namespace Engines {

namespace NWN2 {

/*
* The strings below are used for the cursor group identifiers. The values
* after the comments are the cursor## numbers used in NWN2Engine::initCursors.
*
* Ref.: https://oeiprogrammer.blogspot.com/2007/03/uiobjectinputactiontargetscript.html
*/

static const Common::UString kCursorDefault = "default"; // 0, 1
static const Common::UString kCursorWalk = "walk"; // 3, 4 (testing: 0, 2)
static const Common::UString kCUrsorNoWalk = "nowalk"; // 5, 6
static const Common::UString kCursorAttack = "attack"; // 7, 8
static const Common::UString kCursorNoAttack = "noattack"; // 9, 10
static const Common::UString kCursorTalk = "talk"; // 11, 12
static const Common::UString kCursorNoTalk = "notalk"; // 13, 14
static const Common::UString kCursorFollow = "follow"; // 15, 16
static const Common::UString kCursorExamine = "examine"; // 17, 18
static const Common::UString kCursorNoExamine = "noexamine"; // 19, 20
static const Common::UString kCursorTransition = "transition"; // 21, 22
static const Common::UString kCursorDoor = "door"; // 23, 24
static const Common::UString kCursorUse = "use"; // 25, 26 (game uses "action")
static const Common::UString kCursorNoUse = "nouse"; // 27, 28
static const Common::UString kCursorMagic = "magic"; // 29, 30
static const Common::UString kCursorNoMagic = "nomagic"; // 31, 32
static const Common::UString kCursorDisarm = "disarm"; // 33, 34
static const Common::UString kCursorNoDisarm = "nodisarm"; // 35, 36
static const Common::UString kCursorAction = "action"; // 37, 38
static const Common::UString kCursorNoAction = "noaction"; // 39, 40
static const Common::UString kCursorLock = "lock"; // 41, 42
static const Common::UString kCursorNoLock = "nolock"; // 43, 44
static const Common::UString kCursorPushPin = "pushpin"; // 45, 46
static const Common::UString kCursorCreate = "create"; // 47, 48
static const Common::UString kCursorNoCreate = "nocreate"; // 49, 50
static const Common::UString kCursorKill = "kill"; // 51, 52
static const Common::UString kCursorNoKill = "nokill"; // 53, 54
static const Common::UString kCursorHeal = "heal"; // 55, 56
static const Common::UString kCursorNoHeal = "noheal"; // 57, 58
static const Common::UString kCursorRunArrow00 = "runarrow0"; // 59
static const Common::UString kCursorRunArrow01 = "runarrow1"; // 60
static const Common::UString kCursorRunArrow02 = "runarrow2"; // 61
static const Common::UString kCursorRunArrow03 = "runarrow3"; // 62
static const Common::UString kCursorRunArrow04 = "runarrow4"; // 63
static const Common::UString kCursorRunArrow05 = "runarrow5"; // 64
static const Common::UString kCursorRunArrow06 = "runarrow6"; // 65
static const Common::UString kCursorRunArrow07 = "runarrow7"; // 66
static const Common::UString kCursorRunArrow08 = "runarrow8"; // 67
static const Common::UString kCursorRunArrow09 = "runarrow9"; // 68
static const Common::UString kCursorRunArrow10 = "runarrow10"; // 69
static const Common::UString kCursorRunArrow11 = "runarrow11"; // 70
static const Common::UString kCursorRunArrow12 = "runarrow12"; // 71
static const Common::UString kCursorRunArrow13 = "runarrow13"; // 72
static const Common::UString kCursorRunArrow14 = "runarrow14"; // 73
static const Common::UString kCursorRunArrow15 = "runarrow15"; // 74
static const Common::UString kCursorWalkArrow00 = "walkarrow0"; // 75
static const Common::UString kCursorWalkArrow01 = "walkarrow1"; // 76
static const Common::UString kCursorWalkArrow02 = "walkarrow2"; // 77
static const Common::UString kCursorWalkArrow03 = "walkarrow3"; // 78
static const Common::UString kCursorWalkArrow04 = "walkarrow4"; // 79
static const Common::UString kCursorWalkArrow05 = "walkarrow5"; // 80
static const Common::UString kCursorWalkArrow06 = "walkarrow6"; // 81
static const Common::UString kCursorWalkArrow07 = "walkarrow7"; // 82
static const Common::UString kCursorWalkArrow08 = "walkarrow8"; // 83
static const Common::UString kCursorWalkArrow09 = "walkarrow9"; // 84
static const Common::UString kCursorWalkArrow10 = "walkarrow10"; // 85
static const Common::UString kCursorWalkArrow11 = "walkarrow11"; // 86
static const Common::UString kCursorWalkArrow12 = "walkarrow12"; // 87
static const Common::UString kCursorWalkArrow13 = "walkarrow13"; // 88
static const Common::UString kCursorWalkArrow14 = "walkarrow14"; // 89
static const Common::UString kCursorWalkArrow15 = "walkarrow15"; // 90
static const Common::UString kCursorPickup = "pickup"; // 91, 92
static const Common::UString kCursorChatBoxSize00 = "chatboxsize0"; // 93
static const Common::UString kCursorChatBoxSize01 = "chatboxsize1"; // 94
static const Common::UString kCursorChatBoxSize02 = "chatboxsize2"; // 95
static const Common::UString kCursorChatBoxSize03 = "chatboxsize3"; // 96
static const Common::UString kCursorChatBoxSize04 = "chatboxsize4"; // 97
static const Common::UString kCursorChatBoxSize05 = "chatboxsize5"; // 98
static const Common::UString kCursorChatBoxSize06 = "chatboxsize6"; // 99
static const Common::UString kCursorChatBoxSize07 = "chatboxsize7"; // 100
static const Common::UString kCursorChatBoxSize08 = "chatboxsize8"; // 101
static const Common::UString kCursorChatBoxSize09 = "chatboxsize9"; // 102
static const Common::UString kCursorChatBoxSize10 = "chatboxsize10"; // 103
static const Common::UString kCursorChatBoxSize11 = "chatboxsize11"; // 104
static const Common::UString kCursorChatBoxSize12 = "chatboxsize12"; // 105
static const Common::UString kCursorChatBoxSize13 = "chatboxsize13"; // 106
static const Common::UString kCursorChatBoxSize14 = "chatboxsize14"; // 107
static const Common::UString kCursorChatBoxSize15 = "chatboxsize15"; // 108

static const Common::UString kCursorNoDefault = "nodefault"; // 125, 126
static const Common::UString kCursorMap = "map"; // 128, 127
static const Common::UString kCursorNoMap = "nomap"; // 130, 129
static const Common::UString kCursorWait = "wait"; // 131, 132

} // End of namespace NWN2

} // End of namespace Engines

#endif // ENGINES_NWN2_CURSOR_H
137 changes: 69 additions & 68 deletions src/engines/nwn2/nwn2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "src/engines/nwn2/modelloader.h"
#include "src/engines/nwn2/console.h"
#include "src/engines/nwn2/game.h"
#include "src/engines/nwn2/cursor.h"

namespace Engines {

Expand Down Expand Up @@ -350,82 +351,82 @@ void NWN2Engine::initResources(LoadProgress &progress) {
}

void NWN2Engine::initCursors() {
CursorMan.add("cursor0" , "default" , "up" ); // Walk cursor
CursorMan.add("cursor1" , "default" , "down");
CursorMan.add("cursor0" , kCursorDefault , "up" );
CursorMan.add("cursor1" , kCursorDefault , "down");

// Cursor types in 'cursors.2da'
CursorMan.add("cursor21" , "transition", "up" );
CursorMan.add("cursor22" , "transition", "down");
CursorMan.add("cursor37" , "use" , "up" ); // Note: changed from cursor25
CursorMan.add("cursor38" , "use" , "down");
CursorMan.add("cursor17" , "examine" , "up" );
CursorMan.add("cursor18" , "examine" , "down");
CursorMan.add("cursor11" , "talk" , "up" );
CursorMan.add("cursor12" , "talk" , "down");
// CursorMan.add("cursor0" , "walk" , "up" ); // Error
CursorMan.add("cursor2" , "walk" , "down");
CursorMan.add("cursor125", "xwalk" , "up" ); // Note: changed from cursor5
CursorMan.add("cursor126", "xwalk" , "down");
CursorMan.add("cursor7" , "attack" , "up" );
CursorMan.add("cursor8" , "attack" , "down");
CursorMan.add("cursor29" , "magic" , "up" );
CursorMan.add("cursor30" , "magic" , "down");
CursorMan.add("cursor39" , "nouse" , "up" ); // Note: changed from cursor27
CursorMan.add("cursor40" , "nouse" , "down");
CursorMan.add("cursor33" , "trap" , "up" );
CursorMan.add("cursor34" , "trap" , "down");
CursorMan.add("cursor21" , kCursorTransition , "up" );
CursorMan.add("cursor22" , kCursorTransition , "down");
CursorMan.add("cursor37" , kCursorAction , "up" );
CursorMan.add("cursor38" , kCursorAction , "down");
CursorMan.add("cursor17" , kCursorExamine , "up" );
CursorMan.add("cursor18" , kCursorExamine , "down");
CursorMan.add("cursor11" , kCursorTalk , "up" );
CursorMan.add("cursor12" , kCursorTalk , "down");
CursorMan.add("cursor3" , kCursorWalk , "up" );
CursorMan.add("cursor4" , kCursorWalk , "down");
CursorMan.add("cursor125", kCursorNoDefault , "up" );
CursorMan.add("cursor126", kCursorNoDefault , "down");
CursorMan.add("cursor7" , kCursorAttack , "up" );
CursorMan.add("cursor8" , kCursorAttack , "down");
CursorMan.add("cursor29" , kCursorMagic , "up" );
CursorMan.add("cursor30" , kCursorMagic , "down");
CursorMan.add("cursor39" , kCursorNoAction , "up" );
CursorMan.add("cursor40" , kCursorNoAction , "down");
CursorMan.add("cursor33" , kCursorDisarm , "up" );
CursorMan.add("cursor34" , kCursorDisarm , "down");

// Exploration mode run cursors
CursorMan.add("cursor59" , "run0" , "down"); // Arrow up
CursorMan.add("cursor60" , "run1" , "down");
CursorMan.add("cursor61" , "run2" , "down");
CursorMan.add("cursor62" , "run3" , "down");
CursorMan.add("cursor63" , "run4" , "down"); // Arrow right
CursorMan.add("cursor64" , "run5" , "down");
CursorMan.add("cursor65" , "run6" , "down");
CursorMan.add("cursor66" , "run7" , "down");
CursorMan.add("cursor67" , "run8" , "down"); // Arrow down
CursorMan.add("cursor68" , "run9" , "down");
CursorMan.add("cursor69" , "run10" , "down");
CursorMan.add("cursor70" , "run11" , "down");
CursorMan.add("cursor71" , "run12" , "down"); // Arrow left
CursorMan.add("cursor72" , "run13" , "down");
CursorMan.add("cursor73" , "run14" , "down");
CursorMan.add("cursor74" , "run15" , "down");
CursorMan.add("cursor59" , kCursorRunArrow00 , "down"); // Arrow up
CursorMan.add("cursor60" , kCursorRunArrow01 , "down");
CursorMan.add("cursor61" , kCursorRunArrow02 , "down");
CursorMan.add("cursor62" , kCursorRunArrow03 , "down");
CursorMan.add("cursor63" , kCursorRunArrow04 , "down"); // Arrow right
CursorMan.add("cursor64" , kCursorRunArrow05 , "down");
CursorMan.add("cursor65" , kCursorRunArrow06 , "down");
CursorMan.add("cursor66" , kCursorRunArrow07 , "down");
CursorMan.add("cursor67" , kCursorRunArrow08 , "down"); // Arrow down
CursorMan.add("cursor68" , kCursorRunArrow09 , "down");
CursorMan.add("cursor69" , kCursorRunArrow10 , "down");
CursorMan.add("cursor70" , kCursorRunArrow11 , "down");
CursorMan.add("cursor71" , kCursorRunArrow12 , "down"); // Arrow left
CursorMan.add("cursor72" , kCursorRunArrow13 , "down");
CursorMan.add("cursor73" , kCursorRunArrow14 , "down");
CursorMan.add("cursor74" , kCursorRunArrow15 , "down");

// Exploration mode walk cursors
CursorMan.add("cursor75" , "walk0" , "down"); // Arrow up
CursorMan.add("cursor76" , "walk1" , "down");
CursorMan.add("cursor77" , "walk2" , "down");
CursorMan.add("cursor78" , "walk3" , "down");
CursorMan.add("cursor79" , "walk4" , "down"); // Arrow right
CursorMan.add("cursor80" , "walk5" , "down");
CursorMan.add("cursor81" , "walk6" , "down");
CursorMan.add("cursor82" , "walk7" , "down");
CursorMan.add("cursor83" , "walk8" , "down"); // Arrow down
CursorMan.add("cursor84" , "walk9" , "down");
CursorMan.add("cursor85" , "walk10" , "down");
CursorMan.add("cursor86" , "walk11" , "down");
CursorMan.add("cursor87" , "walk12" , "down"); // Arrow left
CursorMan.add("cursor88" , "walk13" , "down");
CursorMan.add("cursor89" , "walk14" , "down");
CursorMan.add("cursor90" , "walk15" , "down");
CursorMan.add("cursor75" , kCursorWalkArrow00, "down"); // Arrow up
CursorMan.add("cursor76" , kCursorWalkArrow01, "down");
CursorMan.add("cursor77" , kCursorWalkArrow02, "down");
CursorMan.add("cursor78" , kCursorWalkArrow03, "down");
CursorMan.add("cursor79" , kCursorWalkArrow04, "down"); // Arrow right
CursorMan.add("cursor80" , kCursorWalkArrow05, "down");
CursorMan.add("cursor81" , kCursorWalkArrow06, "down");
CursorMan.add("cursor82" , kCursorWalkArrow07, "down");
CursorMan.add("cursor83" , kCursorWalkArrow08, "down"); // Arrow down
CursorMan.add("cursor84" , kCursorWalkArrow09, "down");
CursorMan.add("cursor85" , kCursorWalkArrow10, "down");
CursorMan.add("cursor86" , kCursorWalkArrow11, "down");
CursorMan.add("cursor87" , kCursorWalkArrow12, "down"); // Arrow left
CursorMan.add("cursor88" , kCursorWalkArrow13, "down");
CursorMan.add("cursor89" , kCursorWalkArrow14, "down");
CursorMan.add("cursor90" , kCursorWalkArrow15, "down");

// Other cursors
CursorMan.add("cursor23" , "door" , "up" );
CursorMan.add("cursor24" , "door" , "down");
CursorMan.add("cursor41" , "lock" , "up" );
CursorMan.add("cursor42" , "lock" , "down");
CursorMan.add("cursor55" , "healing" , "up" );
CursorMan.add("cursor56" , "healing" , "down");
CursorMan.add("cursor91" , "loot" , "up" );
CursorMan.add("cursor92" , "loot" , "down");
CursorMan.add("cursor127", "compass" , "up" );
CursorMan.add("cursor128", "compass" , "down");
CursorMan.add("cursor131", "clock" , "up" );
CursorMan.add("cursor132", "clock" , "down");

CursorMan.setDefault("default", "up");
CursorMan.add("cursor23" , kCursorDoor , "up" );
CursorMan.add("cursor24" , kCursorDoor , "down");
CursorMan.add("cursor41" , kCursorLock , "up" );
CursorMan.add("cursor42" , kCursorLock , "down");
CursorMan.add("cursor55" , kCursorHeal , "up" );
CursorMan.add("cursor56" , kCursorHeal , "down");
CursorMan.add("cursor91" , kCursorPickup , "up" );
CursorMan.add("cursor92" , kCursorPickup , "down");
CursorMan.add("cursor127", kCursorMap , "up" );
CursorMan.add("cursor128", kCursorMap , "down");
CursorMan.add("cursor131", kCursorWait , "up" );
CursorMan.add("cursor132", kCursorWait , "down");

CursorMan.setDefault(kCursorDefault, "up");
}

void NWN2Engine::initConfig() {
Expand Down

0 comments on commit 0a267b7

Please sign in to comment.