[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[adonthell-wastesedge-commits] Release_0-3-1 1b6640a 151/237: MOVED engi
From: |
Kai Sterker |
Subject: |
[adonthell-wastesedge-commits] Release_0-3-1 1b6640a 151/237: MOVED engine control into seperate script |
Date: |
Mon, 25 Jul 2016 18:15:08 +0000 (UTC) |
tag: Release_0-3-1
commit 1b6640a2c68f05e016fa8dbfa07a43442623e849
Author: adondev <adondev>
Commit: adondev <adondev>
MOVED engine control into seperate script
FIXED intro text (trading post -> inn)
---
scripts/actions/talk.py | 5 ++
scripts/init.py | 5 +-
scripts/modules/intro.py | 8 +-
scripts/schedules/Makefile.am | 12 +++
scripts/schedules/control.py | 95 ++++++++++++++++++++
.../schedules/mapcharacters/keyboard_control.py | 81 +++--------------
6 files changed, 131 insertions(+), 75 deletions(-)
diff --git a/scripts/actions/talk.py b/scripts/actions/talk.py
index b964741..f9255a3 100755
--- a/scripts/actions/talk.py
+++ b/scripts/actions/talk.py
@@ -25,11 +25,16 @@ class talk:
args[0].set_schedule_active (1)
args[1].set_schedule_active (1)
+ adonthell.gamedata_engine ().set_control_active (1)
+
def run (self, requester):
if requester.get_name() == adonthell.gamedata_player ().get_name():
# -- deactivate the schedule of the characters involved
self.myself.set_schedule_active (0)
requester.set_schedule_active (0)
+
+ # -- don't allow access to main menu and stuff
+ adonthell.gamedata_engine ().set_control_active (0)
# -- look into the player's face
self.myself.look_invert (requester.currentmove ())
diff --git a/scripts/init.py b/scripts/init.py
index 225a02a..408eda7 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -164,11 +164,7 @@ class title_screen:
# -- once the menu is closed, see what we got
retval = menu.get_result ()
- print "Main menu closed with retval", retval
- audio_pause_music ()
- audio_unload_background (0)
-
# -- start new game
if retval == 1:
# -- let the player chose a name for his character
@@ -193,6 +189,7 @@ class title_screen:
self.window.set_visible (0)
self.cleanup ()
gamedata_engine ().mapview_start ()
+ gamedata_engine ().set_control_active (1)
gamedata_engine ().fade_in ()
# -- quit the game
diff --git a/scripts/modules/intro.py b/scripts/modules/intro.py
index 91a4020..8dc411d 100644
--- a/scripts/modules/intro.py
+++ b/scripts/modules/intro.py
@@ -67,11 +67,11 @@ cont.add (lab)
wintext = ("One week out of Cirdanth, the trail had\nbecome hard. I had begun
to wonder\ndays ago whether \
it could still be called\na trail, but it was the only way the\ncaravans had.",
"There were no caravans now, only me,\nand I had seen few others on
the road.\nEven those had \
-become more scarce the\nfurther I went.",
+become more scarce\nthe further I went.",
"It was easy to see why.",
"The Lady Silverhair, intent on her\nmission, had gone on ahead
while I was\nleft to complete \
business in her name,\ntrusting me to follow in good speed.",
- "A lone Half-Elf, may travel with much\nmore speed than an Elven
lady and her\nservants, so she \
+ "A lone Half-Elf may travel with much\nmore speed than an Elven
lady and her\nservants, so she \
was now only a day\nahead. The thought nearly caused me\nto forget \
the harshness of the road.",
"Still, Waste's Edge was a welcome sight.",
@@ -101,9 +101,9 @@ post of Waste's Edge?", "yellow", 130, 5, 500, 2),
("That it is, but this is all you'll see of it.", "red", 25, 5,
300, 1),
("If you turn now and make haste, you should be able to make safe
camping \
before dark.", "red", 25, 5, 400, 1),
- ("Turn back? Whatever for? And why is the gate of a free trading
post locked \
+ ("Turn back? Whatever for? And why is the gate of a free Inn
locked \
against a footsore traveller?", "yellow", 130, 5, 500, 0),
- ("I am sorry, traveller, but the post is barred and you must be
off.", "red", 25, 5, 300, 0),
+ ("I am sorry, traveller, but the Inn is barred and you must be
off.", "red", 25, 5, 300, 0),
("There has been trouble inside and I have instructions to turn
away all who \
need not be here.", "red", 25, 5, 400, 0),
("Trouble? Why then, I must get inside. My employer will need me
close at \
diff --git a/scripts/schedules/Makefile.am b/scripts/schedules/Makefile.am
index c3bfa88..3e1d84c 100755
--- a/scripts/schedules/Makefile.am
+++ b/scripts/schedules/Makefile.am
@@ -1,3 +1,15 @@
SUBDIRS = mapcharacters mapviews
pkgdatadir = $(gamedatadir)/scripts/schedules
+
+pkgdata_DATA = *.pyc
+
+EXTRA_DIST = control.py
+
+all:
+ $(adonthell_binary) -c
+
+*.pyc: *.py
+
+clean:
+ rm -f *.pyc
diff --git a/scripts/schedules/control.py b/scripts/schedules/control.py
new file mode 100644
index 0000000..8280b79
--- /dev/null
+++ b/scripts/schedules/control.py
@@ -0,0 +1,95 @@
+#
+# $Id$
+#
+# (C) Copyright 2001 Kai Sterker <address@hidden>
+# Part of the Adonthell Project http://adonthell.linuxgames.com
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY.
+#
+# See the COPYING file for more details
+#
+
+from adonthell import *
+
+class control:
+
+ def run (self):
+ # -- bring up the main menu
+ if input_has_been_pushed (SDLK_ESCAPE):
+ import main_menu
+
+ # -- create main menu without animation,
+ # with saving and background enabled
+ menu = main_menu.main_menu (1, 1, 1)
+
+ # -- Stop updating the map
+ gamedata_engine ().set_update_map (0)
+ gamedata_engine ().set_control_active (0)
+
+ # -- open the main menu
+ gamedata_engine ().main (menu, "game_menu")
+
+ # -- main menu closed -> see what to do
+ if menu.get_result () == 5:
+ # -- quit the game
+ gamedata_engine ().main_quit ()
+ else:
+ # -- continue
+ gamedata_engine ().set_update_map (1)
+ gamedata_engine ().set_control_active (1)
+
+
+ # -- shortcut to the load screen
+ elif input_has_been_pushed (SDLK_l):
+ s = data_screen (LOAD_SCREEN)
+ s.set_activate (1)
+
+ # -- Stop updating the map
+ gamedata_engine ().set_update_map (0)
+ gamedata_engine ().set_control_active (0)
+
+ # -- open the load screen
+ gamedata_engine ().main (s, "load_screen")
+
+ # -- continue
+ gamedata_engine ().set_update_map (1)
+ gamedata_engine ().set_control_active (1)
+
+
+ # -- and to the save screen
+ elif input_has_been_pushed (SDLK_s):
+ s = data_screen (SAVE_SCREEN)
+ s.set_activate (1)
+
+ # -- Stop updating the map
+ gamedata_engine ().set_update_map (0)
+ gamedata_engine ().set_control_active (0)
+
+ # -- open the save screen
+ gamedata_engine ().main (s, "save_screen")
+
+ # -- continue
+ gamedata_engine ().set_update_map (1)
+ gamedata_engine ().set_control_active (1)
+
+
+ # -- python console
+ elif input_has_been_pushed (SDLK_TAB):
+ import console
+
+ c = console.console (globals ())
+ c.set_activate (1)
+
+ # -- Stop updating the map
+ gamedata_engine ().set_update_map (0)
+ gamedata_engine ().set_control_active (0)
+
+ # -- open the console
+ gamedata_engine ().main (c, "console")
+
+ # -- continue
+ gamedata_engine ().set_update_map (1)
+ gamedata_engine ().set_control_active (1)
diff --git a/scripts/schedules/mapcharacters/keyboard_control.py
b/scripts/schedules/mapcharacters/keyboard_control.py
index 6a719a4..9be1a2d 100755
--- a/scripts/schedules/mapcharacters/keyboard_control.py
+++ b/scripts/schedules/mapcharacters/keyboard_control.py
@@ -1,3 +1,17 @@
+#
+# $Id$
+#
+# (C) Copyright 2001 Alexandre Courbot
+# Part of the Adonthell Project http://adonthell.linuxgames.com
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY.
+#
+# See the COPYING file for more details
+#
+
from adonthell import *
class keyboard_control:
@@ -77,28 +91,6 @@ class keyboard_control:
evt.c = self.myself
event_handler_raise_event (evt)
- # -- bring up the main menu
- elif input_has_been_pushed (SDLK_ESCAPE):
- import main_menu
-
- # -- create main menu without animation, with saving and
background enabled
- menu = main_menu.main_menu (1, 1, 1)
-
- # -- Stop updating the map
- gamedata_engine ().set_update_map (0)
-
- # -- open the main menu
- gamedata_engine ().main (menu, "game_menu")
-
- # -- main menu closed -> see what to do
- if menu.get_result () == 5:
- # -- quit the game
- gamedata_engine ().main_quit ()
- else:
- # -- continue
- gamedata_engine ().set_update_map (1)
-
- menu = None
# -- move the player around
if input_is_pushed (SDLK_UP): self.myself.go_north ()
@@ -121,48 +113,3 @@ class keyboard_control:
else:
self.myself.jump_to (gamedata_engine ().get_landmap
().nbr_of_submaps () - 1, 5, 3)
- # -- shortcut to the load screen
- elif input_has_been_pushed (SDLK_l):
- s = data_screen (LOAD_SCREEN)
- s.set_activate (1)
-
- # -- Stop updating the map
- gamedata_engine ().set_update_map (0)
-
- # -- open the load screen
- gamedata_engine ().main (s, "load_screen")
-
- # -- continue
- gamedata_engine ().set_update_map (1)
-
- # -- and to the save screen
- elif input_has_been_pushed (SDLK_s):
- s = data_screen (SAVE_SCREEN)
- s.set_activate (1)
-
- # -- Stop updating the map
- gamedata_engine ().set_update_map (0)
-
- # -- open the save screen
- gamedata_engine ().main (s, "save_screen")
-
- # -- continue
- gamedata_engine ().set_update_map (1)
-
- # -- python console
- elif input_has_been_pushed (SDLK_TAB):
- import console
-
- c = console.console (globals ())
- c.set_activate (1)
-
- # -- Stop updating the map
- gamedata_engine ().set_update_map (0)
-
- # -- open the console
- gamedata_engine ().main (c, "console")
-
- # -- continue
- gamedata_engine ().set_update_map (1)
-
- c = None
- [adonthell-wastesedge-commits] Release_0-3-1 2affe60 115/237: Oops! Forgot that one..., (continued)
- [adonthell-wastesedge-commits] Release_0-3-1 2affe60 115/237: Oops! Forgot that one..., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 365c99f 100/237: Added Alek and Jelom, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 f5cbecf 142/237: FIXED spelling, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 662757a 091/237: FIXED a small bug in the python console, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 af508ec 185/237: ADDED in-game tunes, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 3bca664 054/237: Added new mapcharacters., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 ae421bc 146/237: Python scripts files are now compiled by the Adonthell binary., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 3e84510 056/237: Forgot to update the Makefile, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 d6345fa 228/237: REMOVED audio schedule for the extro, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 bf5e61e 123/237: Took care of the case when the player takes Erek to Jelom and has not made it into Bjarn's room yet, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 1b6640a 151/237: MOVED engine control into seperate script,
Kai Sterker <=
- [adonthell-wastesedge-commits] Release_0-3-1 7ff9ee3 116/237: FIXED a few spelling errors, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 89d9191 037/237: Added Talan Wendth, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 31f9068 122/237: Schedule to get everybody down the cellar, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 ed1c142 160/237: FIXED Makefile.am's, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 6087908 137/237: ADDED Bjarn's schedule, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 69c9103 210/237: Fixed the extro a bit, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 79418df 227/237: ADDED Enter as alternative 'Action' key, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 4f1725f 119/237: FIXED erek and jelom, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 8fdfd66 165/237: Added Barn interior, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 48053be 090/237: Updated the init script, so you can skip the title sequence, Kai Sterker, 2016/07/25