summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/object/robotmain.cpp2
-rw-r--r--src/ui/displayinfo.cpp4
-rw-r--r--src/ui/edit.cpp18
-rw-r--r--src/ui/edit.h4
-rw-r--r--src/ui/maindialog.cpp8
-rw-r--r--src/ui/studio.cpp6
6 files changed, 25 insertions, 17 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 635fc4e..2554ce4 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -1186,7 +1186,7 @@ void CRobotMain::ChangePhase(Phase phase)
pe->SetGenericMode(true);
pe->SetFontType(Gfx::FONT_COLOBOT);
pe->SetEditCap(false);
- pe->SetHiliteCap(false);
+ pe->SetHighlightCap(false);
pe->ReadText(std::string("help/win.txt"));
}
else
diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp
index 5c41f65..974cd60 100644
--- a/src/ui/displayinfo.cpp
+++ b/src/ui/displayinfo.cpp
@@ -381,7 +381,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
edit->ReadText(filename.c_str());
edit->HyperHome(filename.c_str());
edit->SetEditCap(false); // just to see!
- edit->SetHiliteCap(false);
+ edit->SetHighlightCap(false);
edit->SetFocus(true);
ViewDisplayInfo();
@@ -785,7 +785,7 @@ void CDisplayInfo::UpdateIndexButton()
if ( edit != 0 )
{
//? edit->SetHiliteCap(m_index==SATCOM_LOADING);
- edit->SetHiliteCap(true);
+ edit->SetHighlightCap(true);
}
UpdateCopyButton();
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp
index 5ae7162..e4bb3a3 100644
--- a/src/ui/edit.cpp
+++ b/src/ui/edit.cpp
@@ -786,8 +786,7 @@ void CEdit::HyperJump(std::string name, std::string marker)
if ( name[0] == '%' ) {
filename = GetProfile().GetUserBasedPath(name, "") + ".txt";
} else {
- std::string path = CApplication::GetInstancePointer()->GetDataDirPath() + "/help/" + name + ".txt";
- filename = fs::path(path).generic_string();
+ filename = "/help/" + name + ".txt";
}
if ( ReadText(filename) )
@@ -1449,7 +1448,16 @@ bool CEdit::ReadText(std::string filename, int addSize)
bool bInSoluce, bBOL;
if ( filename[0] == 0 ) return false;
- file = fopen(filename.c_str(), "rb");
+ boost::replace_all(filename, "\\", "/");
+
+ /* This is ugly but doesn't require many changes in code. If file doesn't
+ exists it's posible filename is absolute not full path */
+ std::string path = filename;
+ if (!fs::exists(path)) {
+ path = CApplication::GetInstancePointer()->GetDataDirPath() + "/" + filename;
+ }
+
+ file = fopen(fs::path(path).make_preferred().string().c_str(), "rb");
if ( file == NULL ) return false;
fseek(file, 0, SEEK_END);
@@ -1974,12 +1982,12 @@ bool CEdit::GetEditCap()
// Mode management "hilitable" (that's the franch).
-void CEdit::SetHiliteCap(bool bEnable)
+void CEdit::SetHighlightCap(bool bEnable)
{
m_bHilite = bEnable;
}
-bool CEdit::GetHiliteCap()
+bool CEdit::GetHighlightCap()
{
return m_bHilite;
}
diff --git a/src/ui/edit.h b/src/ui/edit.h
index 8b84fcd..1cfec80 100644
--- a/src/ui/edit.h
+++ b/src/ui/edit.h
@@ -155,8 +155,8 @@ public:
void SetEditCap(bool bMode);
bool GetEditCap();
- void SetHiliteCap(bool bEnable);
- bool GetHiliteCap();
+ void SetHighlightCap(bool bEnable);
+ bool GetHighlightCap();
void SetInsideScroll(bool bInside);
bool GetInsideScroll();
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index f4bc75c..8b97f4e 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -891,7 +891,7 @@ pb->SetState(STATE_SHADOW);
pe->SetState(STATE_SHADOW);
pe->SetMaxChar(500);
pe->SetEditCap(false); // just to see
- pe->SetHiliteCap(false);
+ pe->SetHighlightCap(false);
// Button displays the "soluce":
if ( m_phase != PHASE_TRAINER &&
@@ -1815,7 +1815,7 @@ pos.y -= 0.048f;
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
pe->SetGenericMode(true);
pe->SetEditCap(false);
- pe->SetHiliteCap(false);
+ pe->SetHighlightCap(false);
pe->SetFontType(Gfx::FONT_COURIER);
pe->SetFontSize(8.0f);
pe->ReadText("help/authors.txt");
@@ -1827,7 +1827,7 @@ pos.y -= 0.048f;
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT2);
pe->SetGenericMode(true);
pe->SetEditCap(false);
- pe->SetHiliteCap(false);
+ pe->SetHighlightCap(false);
pe->SetFontType(Gfx::FONT_COURIER);
pe->SetFontSize(6.5f);
pe->ReadText("help/licences.txt");
@@ -1847,7 +1847,7 @@ ddim.y = 150.0f/480.0f;
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
pe->SetGenericMode(true);
pe->SetEditCap(false);
- pe->SetHiliteCap(false);
+ pe->SetHighlightCap(false);
pe->SetFontType(Gfx::FONT_COURIER);
pe->SetFontSize(8.0f);
pe->ReadText("help/authors.txt");
diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp
index d24eb4c..da18d83 100644
--- a/src/ui/studio.cpp
+++ b/src/ui/studio.cpp
@@ -990,13 +990,13 @@ void CStudio::UpdateButtons()
{
edit->SetIcon(1); // red background
edit->SetEditCap(false); // just to see
- edit->SetHiliteCap(true);
+ edit->SetHighlightCap(true);
}
else
{
edit->SetIcon(0); // standard background
edit->SetEditCap(true);
- edit->SetHiliteCap(true);
+ edit->SetHighlightCap(true);
}
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_COMPILE));
@@ -1525,7 +1525,7 @@ void CStudio::UpdateDialogList()
for( fs::directory_iterator file(path); file != end_iter; file++) {
if (fs::is_regular_file(file->status()) ) {
TimeToAscii(fs::last_write_time(file->path()), time);
- sprintf(temp, "%s\t%lu \t%s", file->path().filename().c_str(), fs::file_size(file->path()), time);
+ sprintf(temp, "%s\t%lu \t%s", file->path().filename().string().c_str(), fs::file_size(file->path()), time);
pl->SetName(i++, temp);
}