@ -100,8 +100,8 @@ namespace
return getWidget < MWGui : : BookPage > ( name ) ;
return getWidget < MWGui : : BookPage > ( name ) ;
}
}
JournalWindowImpl ( MWGui : : JournalViewModel : : Ptr Model , bool questList )
JournalWindowImpl ( MWGui : : JournalViewModel : : Ptr Model , bool questList , ToUTF8 : : FromType encoding )
: JournalBooks ( Model ), JournalWindow ( )
: JournalBooks ( Model , encoding ), JournalWindow ( )
{
{
center ( ) ;
center ( ) ;
@ -161,6 +161,15 @@ namespace
Gui : : ImageButton * showActiveButton = getWidget < Gui : : ImageButton > ( ShowActiveBTN ) ;
Gui : : ImageButton * showActiveButton = getWidget < Gui : : ImageButton > ( ShowActiveBTN ) ;
Gui : : ImageButton * showAllButton = getWidget < Gui : : ImageButton > ( ShowAllBTN ) ;
Gui : : ImageButton * showAllButton = getWidget < Gui : : ImageButton > ( ShowAllBTN ) ;
Gui : : ImageButton * questsButton = getWidget < Gui : : ImageButton > ( QuestsBTN ) ;
Gui : : ImageButton * questsButton = getWidget < Gui : : ImageButton > ( QuestsBTN ) ;
Gui : : ImageButton * nextButton = getWidget < Gui : : ImageButton > ( NextPageBTN ) ;
if ( nextButton - > getSize ( ) . width = = 64 )
{
// english button has a 7 pixel wide strip of garbage on its right edge
nextButton - > setSize ( 64 - 7 , nextButton - > getSize ( ) . height ) ;
nextButton - > setImageCoord ( MyGUI : : IntCoord ( 0 , 0 , 64 - 7 , nextButton - > getSize ( ) . height ) ) ;
}
if ( ! questList )
if ( ! questList )
{
{
// If tribunal is not installed (-> no options button), we still want the Topics button available,
// If tribunal is not installed (-> no options button), we still want the Topics button available,
@ -176,6 +185,8 @@ namespace
showActiveButton - > setVisible ( false ) ;
showActiveButton - > setVisible ( false ) ;
showAllButton - > setVisible ( false ) ;
showAllButton - > setVisible ( false ) ;
questsButton - > setVisible ( false ) ;
questsButton - > setVisible ( false ) ;
adjustButton ( TopicsBTN ) ;
}
}
else
else
{
{
@ -188,16 +199,6 @@ namespace
adjustButton ( ShowActiveBTN ) ;
adjustButton ( ShowActiveBTN ) ;
adjustButton ( OptionsBTN ) ;
adjustButton ( OptionsBTN ) ;
adjustButton ( QuestsBTN ) ;
adjustButton ( QuestsBTN ) ;
}
Gui : : ImageButton * nextButton = getWidget < Gui : : ImageButton > ( NextPageBTN ) ;
if ( nextButton - > getSize ( ) . width = = 64 )
{
// english button has a 7 pixel wide strip of garbage on its right edge
nextButton - > setSize ( 64 - 7 , nextButton - > getSize ( ) . height ) ;
nextButton - > setImageCoord ( MyGUI : : IntCoord ( 0 , 0 , 64 - 7 , nextButton - > getSize ( ) . height ) ) ;
}
adjustButton ( TopicsBTN ) ;
adjustButton ( TopicsBTN ) ;
int topicsWidth = getWidget < MyGUI : : Widget > ( TopicsBTN ) - > getSize ( ) . width ;
int topicsWidth = getWidget < MyGUI : : Widget > ( TopicsBTN ) - > getSize ( ) . width ;
int cancelLeft = getWidget < MyGUI : : Widget > ( CancelBTN ) - > getPosition ( ) . left ;
int cancelLeft = getWidget < MyGUI : : Widget > ( CancelBTN ) - > getPosition ( ) . left ;
@ -207,7 +208,7 @@ namespace
// Usually Topics, Quests, and Cancel buttons have the 64px width, so we can place the Topics left-up from the Cancel button, and the Quests right-up from the Cancel button.
// Usually Topics, Quests, and Cancel buttons have the 64px width, so we can place the Topics left-up from the Cancel button, and the Quests right-up from the Cancel button.
// But in some installations, e.g. German one, the Topics button has the 128px width, so we should place it exactly left from the Quests button.
// But in some installations, e.g. German one, the Topics button has the 128px width, so we should place it exactly left from the Quests button.
if ( getWidget < MyGUI : : Widget > ( TopicsBTN ) - > getSize ( ) . w idth = = 64 )
if ( topicsW idth = = 64 )
{
{
getWidget < MyGUI : : Widget > ( TopicsBTN ) - > setPosition ( cancelLeft - topicsWidth , getWidget < MyGUI : : Widget > ( TopicsBTN ) - > getPosition ( ) . top ) ;
getWidget < MyGUI : : Widget > ( TopicsBTN ) - > setPosition ( cancelLeft - topicsWidth , getWidget < MyGUI : : Widget > ( TopicsBTN ) - > getPosition ( ) . top ) ;
}
}
@ -216,6 +217,7 @@ namespace
int questLeft = getWidget < MyGUI : : Widget > ( QuestsBTN ) - > getPosition ( ) . left ;
int questLeft = getWidget < MyGUI : : Widget > ( QuestsBTN ) - > getPosition ( ) . left ;
getWidget < MyGUI : : Widget > ( TopicsBTN ) - > setPosition ( questLeft - topicsWidth , getWidget < MyGUI : : Widget > ( TopicsBTN ) - > getPosition ( ) . top ) ;
getWidget < MyGUI : : Widget > ( TopicsBTN ) - > setPosition ( questLeft - topicsWidth , getWidget < MyGUI : : Widget > ( TopicsBTN ) - > getPosition ( ) . top ) ;
}
}
}
mQuestMode = false ;
mQuestMode = false ;
mAllQuests = false ;
mAllQuests = false ;
@ -475,7 +477,7 @@ namespace
MWBase : : Environment : : get ( ) . getWindowManager ( ) - > playSound ( " book page " ) ;
MWBase : : Environment : : get ( ) . getWindowManager ( ) - > playSound ( " book page " ) ;
}
}
void notifyIndexLinkClicked ( MWGui : : TypesetBook : : InteractiveId character )
void notifyIndexLinkClicked ( MWGui : : TypesetBook : : InteractiveId index )
{
{
setVisible ( LeftTopicIndex , false ) ;
setVisible ( LeftTopicIndex , false ) ;
setVisible ( RightTopicIndex , false ) ;
setVisible ( RightTopicIndex , false ) ;
@ -488,7 +490,7 @@ namespace
AddNamesToList add ( list ) ;
AddNamesToList add ( list ) ;
mModel - > visitTopicNamesStartingWith ( ( char ) character , add ) ;
mModel - > visitTopicNamesStartingWith ( index , add ) ;
list - > adjustSize ( ) ;
list - > adjustSize ( ) ;
@ -643,9 +645,9 @@ namespace
}
}
// glue the implementation to the interface
// glue the implementation to the interface
MWGui : : JournalWindow * MWGui : : JournalWindow : : create ( JournalViewModel : : Ptr Model , bool questList )
MWGui : : JournalWindow * MWGui : : JournalWindow : : create ( JournalViewModel : : Ptr Model , bool questList , ToUTF8 : : FromType encoding )
{
{
return new JournalWindowImpl ( Model , questList );
return new JournalWindowImpl ( Model , questList , encoding );
}
}
MWGui : : JournalWindow : : JournalWindow ( )
MWGui : : JournalWindow : : JournalWindow ( )