mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 04:51:52 +00:00
Merge with develop
This commit is contained in:
parent
975ed523be
commit
120d2d7dba
15 changed files with 144 additions and 80 deletions
|
@ -43,8 +43,8 @@ namespace NLGUI
|
|||
_BmpLeftW= _BmpMiddleW= _BmpRightW= _BmpH= 0;
|
||||
_WMargin= 0;
|
||||
_WMin= 0;
|
||||
_TextX= -2;
|
||||
_TextY= -2;
|
||||
_TextX= 0;
|
||||
_TextY= 0;
|
||||
_Setuped= false;
|
||||
_ViewText= NULL;
|
||||
_IsViewTextId= false;
|
||||
|
@ -602,7 +602,7 @@ namespace NLGUI
|
|||
_WMin= max(_WMin, _BmpLeftW + _BmpMiddleW + _BmpRightW);
|
||||
|
||||
// TextY
|
||||
_TextY= -2;
|
||||
_TextY= 0;
|
||||
prop = (char*) xmlGetProp( cur, (xmlChar*)"text_y" );
|
||||
if (prop)
|
||||
{
|
||||
|
|
|
@ -2718,9 +2718,18 @@ namespace NLGUI
|
|||
TextContext->setOblique (_Oblique);
|
||||
|
||||
// Letter size
|
||||
UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); // for now we can't now that directly from UTextContext
|
||||
_FontHeight = (uint) si.StringHeight; // + (_Shadow?(_ShadowOutline?2:1):0);
|
||||
_FontLegHeight = (uint) si.StringLine; // + (_Shadow?(_ShadowOutline?2:1):0);
|
||||
ucstring chars;
|
||||
// instead of using the height of "|" that depends on font,
|
||||
// we're using 2 characters:
|
||||
// - "_" that should be the character with the lowest part
|
||||
// - A with an accent for the highest part
|
||||
chars.fromUtf8("_\xc3\x84");
|
||||
|
||||
// for now we can't know that directly from UTextContext
|
||||
UTextContext::CStringInfo si = TextContext->getStringInfo(chars);
|
||||
// add a padding of 1 pixel else the top will be truncated
|
||||
_FontHeight = (uint) si.StringHeight+1;
|
||||
_FontLegHeight = (uint) si.StringLine;
|
||||
|
||||
// Space width
|
||||
si = TextContext->getStringInfo(ucstring(" "));
|
||||
|
|
|
@ -41,13 +41,13 @@
|
|||
<view type="text" id="txt_log" x="0" posref="TM TM" posparent="window" hardtext="uiLogin" fontsize="10" y="-200" color="255 255 255 255" />
|
||||
<view type="text" id="txt_pas" posparent="txt_log" posref="TM TM" hardtext="uiPassword" fontsize="10" y="-48" color="255 255 255 255" />
|
||||
|
||||
<instance template="edit_box_log" id="eb_login" posparent="txt_log" posref="BM TM" w="240" h="24" fontsize="12" x="0" y="-4"
|
||||
text_ref="BM BM" text_y="-2"
|
||||
<instance template="edit_box_log" id="eb_login" posparent="txt_log" posref="BM TM" w="240" h="26" fontsize="12" x="0" y="-4"
|
||||
text_ref="BM BM" text_y="0"
|
||||
reset_focus_on_hide="false" max_historic="0"
|
||||
onenter="set_keyboard_focus" params="target=ui:login:checkpass:content:submit_gr:eb_password:eb|select_all=false"
|
||||
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="12" color="135 243 28 255" />
|
||||
|
||||
<instance template="edit_box_log" id="eb_password" posparent="txt_pas" posref="BM TM" w="240" h="24" fontsize="14" x="0" y="-4"
|
||||
<instance template="edit_box_log" id="eb_password" posparent="txt_pas" posref="BM TM" w="240" h="26" fontsize="12" x="0" y="-4"
|
||||
text_ref="BM BM" text_y="-2"
|
||||
reset_focus_on_hide="false" max_historic="0" entry_type="password"
|
||||
onenter="on_login" params=""
|
||||
|
@ -116,8 +116,8 @@
|
|||
<view type="text" id="title_res" posparent="res_win" posref="TL BL" y="0" color="255 255 255 255" fontsize="10" shadow="true" hardtext="uiLOGResolution" />
|
||||
<view type="text" id="title_lod" posparent="lod_win" posref="TL BL" y="0" color="255 255 255 255" fontsize="10" shadow="true" hardtext="uiLOGLod" />
|
||||
|
||||
<view type="text" id="res_value" posparent="res_win" posref="MM MM" y="-2" color="135 243 28 255" fontsize="10" shadow="true" hardtext="uiResValue" />
|
||||
<view type="text" id="lod_value" posparent="lod_win" posref="MM MM" y="-2" color="135 243 28 255" fontsize="10" shadow="true" hardtext="uiLodValue" />
|
||||
<view type="text" id="res_value" posparent="res_win" posref="MM MM" y="0" color="135 243 28 255" fontsize="10" shadow="true" hardtext="uiResValue" />
|
||||
<view type="text" id="lod_value" posparent="lod_win" posref="MM MM" y="0" color="135 243 28 255" fontsize="10" shadow="true" hardtext="uiLodValue" />
|
||||
|
||||
|
||||
<!-- Boutons Res -->
|
||||
|
@ -297,7 +297,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
|
|||
<!-- Window -->
|
||||
<instance template="server_box" id="check_win" posparent="window" posref="MM MM" w="600" h="128" x="0" y="0" />
|
||||
|
||||
<!-- Textes -->
|
||||
<!-- Texts -->
|
||||
|
||||
<view type="text" id="title" posparent="check_win" posref="TM BM" y="8" color="255 255 255 255"
|
||||
fontsize="12" shadow="true" hardtext="uiOnChecking" />
|
||||
|
@ -626,7 +626,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
|
|||
</group>
|
||||
</template>
|
||||
|
||||
<!-- Page that show the result of data scanning -->
|
||||
<!-- Page that allows to create an account -->
|
||||
<group id="create_account" posref="MM MM" w="1024" h="768" active="false" >
|
||||
|
||||
<group id="content" x="0" y="0" w="1024" h="768" posref="TL TL" >
|
||||
|
@ -647,8 +647,8 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
|
|||
<!-- login -->
|
||||
<view type="text" id="txt_log" posref="TL TL" hardtext="uiUsername" fontsize="12" x="0" y="-60" color="255 255 255 255" />
|
||||
|
||||
<instance template="edit_box_log" id="eb_login" posparent="txt_log" posref="BL BL" w="260" h="24" fontsize="12" x="190" y="0"
|
||||
text_ref="BM BM" text_y="-2"
|
||||
<instance template="edit_box_log" id="eb_login" posparent="txt_log" posref="BL BL" w="250" h="26" fontsize="12" x="200" y="0"
|
||||
text_ref="BM BM" text_y="0"
|
||||
on_focus="create_account_rules" on_focus_params="rules_login" reset_focus_on_hide="false" max_historic="0"
|
||||
onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_password:eb|select_all=false"
|
||||
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="12" color="135 243 28 255" />
|
||||
|
@ -656,7 +656,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
|
|||
<!-- password -->
|
||||
<view type="text" id="txt_pas" posparent="txt_log" posref="BL TL" hardtext="uiPassword" fontsize="12" x="0" y="-30" color="255 255 255 255" />
|
||||
|
||||
<instance template="edit_box_log" id="eb_password" posparent="txt_pas" posref="BL BL" w="260" h="24" fontsize="16" x="190" y="0"
|
||||
<instance template="edit_box_log" id="eb_password" posparent="txt_pas" posref="BL BL" w="250" h="26" fontsize="12" x="200" y="0"
|
||||
text_ref="BM BM" text_y="-2"
|
||||
on_focus="create_account_rules" on_focus_params="rules_password" reset_focus_on_hide="false" max_historic="0" entry_type="password"
|
||||
onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_confirm_password:eb|select_all=false"
|
||||
|
@ -665,7 +665,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
|
|||
<!-- confirm password -->
|
||||
<view type="text" id="txt_confirm_pas" posparent="txt_pas" posref="BL TL" hardtext="uiConfirmPassword" fontsize="12" x="0" y="-30" color="255 255 255 255" />
|
||||
|
||||
<instance template="edit_box_log" id="eb_confirm_password" posparent="txt_confirm_pas" posref="BL BL" w="260" h="24" fontsize="16" x="190" y="0"
|
||||
<instance template="edit_box_log" id="eb_confirm_password" posparent="txt_confirm_pas" posref="BL BL" w="250" h="26" fontsize="12" x="200" y="0"
|
||||
text_ref="BM BM" text_y="-2"
|
||||
on_focus="create_account_rules" on_focus_params="rules_password_conf" reset_focus_on_hide="false" max_historic="0" entry_type="password"
|
||||
onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_email:eb|select_all=false"
|
||||
|
@ -674,8 +674,8 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
|
|||
<!-- email -->
|
||||
<view type="text" id="txt_email" posparent="txt_confirm_pas" posref="BL TL" hardtext="uiEmail" fontsize="12" x="0" y="-30" color="255 255 255 255" />
|
||||
|
||||
<instance template="edit_box_log" id="eb_email" posparent="txt_email" posref="BL BL" w="260" h="24" fontsize="12" x="190" y="0"
|
||||
text_ref="BM BM" text_y="-2"
|
||||
<instance template="edit_box_log" id="eb_email" posparent="txt_email" posref="BL BL" w="250" h="26" fontsize="12" x="200" y="0"
|
||||
text_ref="BM BM" text_y="0"
|
||||
on_focus="create_account_rules" on_focus_params="rules_email" reset_focus_on_hide="false" max_historic="0"
|
||||
onenter="" params=""
|
||||
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="254" color="135 243 28 255" />
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
</template>
|
||||
|
||||
|
||||
<template name="edit_box_log" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" multi_line="false" x="0" y="0" w="0" h="0"
|
||||
<template name="edit_box_log" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" multi_line="false" x="0" y="0" w="0" h="0"
|
||||
id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true" on_focus="" on_focus_params=""
|
||||
enter_loose_focus="true" prompt=">"
|
||||
enter_recover_focus="true"
|
||||
|
@ -100,7 +100,7 @@
|
|||
</template>
|
||||
|
||||
|
||||
<template name="edit_box_widget_multiline" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
|
||||
<template name="edit_box_widget_multiline" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
|
||||
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
|
||||
enter_loose_focus="true" prompt=">"
|
||||
enter_recover_focus="true"
|
||||
|
@ -141,7 +141,7 @@
|
|||
|
||||
|
||||
<!-- Alternate look for multi line input -->
|
||||
<template name="edit_box_widget_multiline_2" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
|
||||
<template name="edit_box_widget_multiline_2" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
|
||||
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
|
||||
enter_loose_focus="true" prompt=">"
|
||||
enter_recover_focus="true"
|
||||
|
@ -195,7 +195,7 @@
|
|||
<style style="log_std_but" type="text_button" button_type="push_button"
|
||||
tx_normal="but" tx_pushed="but" tx_over="but_over" wmargin="16"
|
||||
color="255 255 255 160" col_over="255 255 255 255" col_pushed="255 255 255 255"
|
||||
text_y="-3" fontsize="10" shadow="true"
|
||||
text_y="-1" fontsize="10" shadow="true"
|
||||
text_color_normal="135 243 28 160"
|
||||
text_color_pushed="135 243 28 255"
|
||||
text_color_over="135 243 28 255"
|
||||
|
@ -232,7 +232,7 @@
|
|||
<style style="text_button_16" type="text_button" button_type="push_button"
|
||||
tx_normal="w_text_button_normal" tx_pushed="w_text_button_pushed" tx_over="w_text_button_over"
|
||||
global_color_normal="true" global_color_over="true" global_color_pushed="true"
|
||||
text_y="-2" fontsize="10" shadow="true" case_mode="%case_upper" wmargin="8"
|
||||
text_y="0" fontsize="10" shadow="true" case_mode="%case_upper" wmargin="8"
|
||||
text_color_normal="255 255 255 128" text_color_pushed="255 255 255 255" text_color_over="255 255 255 255" />
|
||||
|
||||
|
||||
|
@ -385,7 +385,7 @@
|
|||
<!-- * EDIT BOX WIDGET * -->
|
||||
<!-- ********************* -->
|
||||
|
||||
<template name="edit_box_widget" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" child_resize_h="true" multi_line="false" x="0" y="0" w="0" h="0"
|
||||
<template name="edit_box_widget" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" multi_line="false" x="0" y="0" w="0" h="0"
|
||||
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
|
||||
enter_loose_focus="true" prompt=">"
|
||||
enter_recover_focus="true"
|
||||
|
@ -423,7 +423,7 @@
|
|||
</template>
|
||||
|
||||
<!-- alternate look for edit box -->
|
||||
<template name="edit_box_widget_2" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" child_resize_h="true" multi_line="false" x="0" y="0" w="0" h="0"
|
||||
<template name="edit_box_widget_2" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" multi_line="false" x="0" y="0" w="0" h="0"
|
||||
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
|
||||
enter_loose_focus="true" prompt=">"
|
||||
enter_recover_focus="true"
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
tx_normal="qh_off" tx_pushed="qh_on" tx_over="qh_off" wmin="80" wmargin="40"
|
||||
global_color_normal="false" global_color_over="false" global_color_pushed="false"
|
||||
color="255 255 255 255" col_over="255 255 255 0" col_pushed="255 255 255 255"
|
||||
text_y="-1" fontsize="13" shadow="true"
|
||||
text_y="1" fontsize="13" shadow="true"
|
||||
text_color_normal="222 201 182 255"
|
||||
text_color_pushed="222 201 182 255"
|
||||
text_color_over="255 255 255 255"
|
||||
|
|
|
@ -2619,7 +2619,7 @@
|
|||
<template name="edit_box_widget"
|
||||
posref="TL TL"
|
||||
text_x="0"
|
||||
text_y="-1"
|
||||
text_y="0"
|
||||
text_ref="BL BL"
|
||||
child_resize_h="true"
|
||||
child_resize_hmargin="0"
|
||||
|
@ -2789,7 +2789,7 @@
|
|||
<template name="edit_box_widget_multiline"
|
||||
posref="TL TL"
|
||||
text_x="0"
|
||||
text_y="-1"
|
||||
text_y="0"
|
||||
text_ref="BL BL"
|
||||
child_resize_h="true"
|
||||
multi_line="true"
|
||||
|
@ -3036,7 +3036,7 @@
|
|||
id="edit"
|
||||
entry_type="positive_integer"
|
||||
text_ref="TR TR"
|
||||
text_y="-1"
|
||||
text_y="0"
|
||||
fontsize="12"
|
||||
posparent="sheet"
|
||||
posref="MR ML"
|
||||
|
@ -4520,7 +4520,7 @@
|
|||
entry_type="positive_integer"
|
||||
id="edit"
|
||||
text_ref="TR TR"
|
||||
text_y="-1"
|
||||
text_y="0"
|
||||
fontsize="12"
|
||||
posparent="sheet"
|
||||
posref="MR ML"
|
||||
|
@ -4850,7 +4850,7 @@
|
|||
global_color_normal="true"
|
||||
global_color_over="true"
|
||||
global_color_pushed="true"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
fontsize="10"
|
||||
shadow="true"
|
||||
case_mode="%case_upper"
|
||||
|
@ -4868,7 +4868,7 @@
|
|||
global_color_normal="true"
|
||||
global_color_over="true"
|
||||
global_color_pushed="true"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
fontsize="10"
|
||||
shadow="true"
|
||||
case_mode="%case_upper"
|
||||
|
@ -4902,7 +4902,7 @@
|
|||
x="0"
|
||||
y="0"
|
||||
posref="TL TL"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
onclick_l="#onclick_ok"
|
||||
params_l="#onclick_ok_param"
|
||||
hardtext="#ok_text"
|
||||
|
@ -4910,7 +4910,7 @@
|
|||
<ctrl style="button_cancel"
|
||||
x="4"
|
||||
posparent="ok"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
posref="TR TL"
|
||||
onclick_l="#onclick_cancel"
|
||||
params_l="#onclick_cancel_param"
|
||||
|
@ -4946,7 +4946,7 @@
|
|||
global_color_normal="true"
|
||||
global_color_over="true"
|
||||
global_color_pushed="true"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
fontsize="10"
|
||||
shadow="true"
|
||||
case_mode="%case_upper"
|
||||
|
@ -4960,7 +4960,7 @@
|
|||
tx_normal="w_text_button_normal"
|
||||
tx_pushed="w_text_button_pushed"
|
||||
tx_over="w_text_button_over"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
fontsize="10"
|
||||
shadow="true"
|
||||
case_mode="%case_upper"
|
||||
|
@ -4984,7 +4984,7 @@
|
|||
global_color_normal="true"
|
||||
global_color_over="true"
|
||||
global_color_pushed="true"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
fontsize="10"
|
||||
shadow="true"
|
||||
case_mode="%case_upper"
|
||||
|
@ -5002,7 +5002,7 @@
|
|||
tx_normal="w_text_button_normal"
|
||||
tx_pushed="w_text_button_pushed"
|
||||
tx_over="w_text_button_over"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
fontsize="10"
|
||||
shadow="true"
|
||||
case_mode="%case_upper"
|
||||
|
@ -5030,7 +5030,7 @@
|
|||
color="255 255 255 128"
|
||||
col_over="255 255 255 0"
|
||||
col_pushed="255 128 0 192"
|
||||
text_y="-2"
|
||||
text_y="0"
|
||||
fontsize="12"
|
||||
shadow="true"
|
||||
text_color_normal="255 255 255 255"
|
||||
|
@ -5056,7 +5056,7 @@
|
|||
color="255 255 255 128"
|
||||
col_over="255 255 255 0"
|
||||
col_pushed="255 190 0 192"
|
||||
text_y="-3"
|
||||
text_y="0"
|
||||
fontsize="12"
|
||||
shadow="true"
|
||||
text_color_normal="255 255 255 160"
|
||||
|
@ -5093,7 +5093,7 @@
|
|||
color="255 255 255 255"
|
||||
col_over="255 255 255 255"
|
||||
col_pushed="255 255 255 255"
|
||||
text_y="-3"
|
||||
text_y="0"
|
||||
fontsize="14"
|
||||
shadow="true"
|
||||
text_color_pushed="255 255 255 255"
|
||||
|
@ -5143,7 +5143,7 @@
|
|||
color="255 255 255 255"
|
||||
col_over="255 255 255 255"
|
||||
col_pushed="255 255 255 255"
|
||||
text_y="-4"
|
||||
text_y="-2"
|
||||
fontsize="10"
|
||||
shadow="true"
|
||||
case_mode="%case_upper"
|
||||
|
|
|
@ -46,9 +46,6 @@
|
|||
// Ligo.
|
||||
#include "nel/ligo/ligo_config.h"
|
||||
|
||||
// Std.
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
// Client
|
||||
#include "init.h"
|
||||
#include "input.h"
|
||||
|
@ -578,14 +575,12 @@ void listStereoDisplayDevices(std::vector<NL3D::CStereoDeviceInfo> &devices)
|
|||
IStereoDisplay::listDevices(devices);
|
||||
for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
|
||||
{
|
||||
std::stringstream name;
|
||||
name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName;
|
||||
std::stringstream fullname;
|
||||
fullname << std::string("[") << name.str() << "] [" << it->Serial << "]";
|
||||
nlinfo("VR [C]: Stereo Display: %s", name.str().c_str());
|
||||
std::string name = toString("%s - %s - %s", IStereoDisplay::getLibraryName(it->Library), it->Manufacturer.c_str(), it->ProductName.c_str());
|
||||
std::string fullname = toString("[%s] [%s]", name.c_str(), it->Serial.c_str());
|
||||
nlinfo("VR [C]: Stereo Display: %s", name.c_str());
|
||||
if (cache)
|
||||
{
|
||||
VRDeviceCache.push_back(std::pair<std::string, std::string>(name.str(), it->Serial)); // VR_CONFIG
|
||||
VRDeviceCache.push_back(std::pair<std::string, std::string>(name, it->Serial)); // VR_CONFIG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -623,9 +618,8 @@ void initStereoDisplayDevice()
|
|||
{
|
||||
for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
|
||||
{
|
||||
std::stringstream name;
|
||||
name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName;
|
||||
if (name.str() == ClientCfg.VRDisplayDevice)
|
||||
std::string name = toString("%s - %s - %s", IStereoDisplay::getLibraryName(it->Library), it->Manufacturer.c_str(), it->ProductName.c_str());
|
||||
if (name == ClientCfg.VRDisplayDevice)
|
||||
deviceInfo = &(*it);
|
||||
if (ClientCfg.VRDisplayDeviceId == it->Serial)
|
||||
break;
|
||||
|
|
|
@ -927,7 +927,7 @@ public:
|
|||
CEntityCL *pSel = EntitiesMngr.entity(UserEntity->selection());
|
||||
if (pSel != NULL)
|
||||
if (pSel->isForageSource())
|
||||
UserEntity->moveToExtractionPhrase(UserEntity->selection(), 2.0f, ~0, ~0, true);
|
||||
UserEntity->moveToExtractionPhrase(UserEntity->selection(), 2.0f, std::numeric_limits<uint>::max(), std::numeric_limits<uint>::max(), true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -862,11 +862,6 @@ OperationStep CConfigFile::getInstallNextStep() const
|
|||
return CopyInstaller;
|
||||
}
|
||||
|
||||
if (m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
|
||||
{
|
||||
return UninstallOldClient;
|
||||
}
|
||||
|
||||
// no default profile
|
||||
if (profile.id.isEmpty())
|
||||
{
|
||||
|
@ -898,6 +893,11 @@ OperationStep CConfigFile::getInstallNextStep() const
|
|||
if (!settings.contains("InstallLocation")) return CreateAddRemoveEntry;
|
||||
#endif
|
||||
|
||||
if (m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
|
||||
{
|
||||
return UninstallOldClient;
|
||||
}
|
||||
|
||||
return Done;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,23 +61,6 @@ int main(int argc, char *argv[])
|
|||
QApplication::setApplicationVersion(RYZOM_VERSION);
|
||||
QApplication::setWindowIcon(QIcon(":/icons/ryzom.ico"));
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(_DEBUG)
|
||||
QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
|
||||
|
||||
// check if launched from TEMP directory
|
||||
if (QApplication::applicationDirPath() != tempPath)
|
||||
{
|
||||
// copy installer and required files to TEMP directory
|
||||
if (copyInstallerExecutable(tempPath))
|
||||
{
|
||||
QString tempFile = tempPath + "/" + QFileInfo(QApplication::applicationFilePath()).fileName();
|
||||
|
||||
// launch copy in TEMP directory with same arguments
|
||||
if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
QLocale locale = QLocale::system();
|
||||
|
||||
// load application translations
|
||||
|
@ -125,6 +108,23 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (parser.isSet(uninstallOption))
|
||||
{
|
||||
#if defined(Q_OS_WIN) && !defined(_DEBUG)
|
||||
QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
|
||||
|
||||
// check if launched from TEMP directory
|
||||
if (QApplication::applicationDirPath() != tempPath)
|
||||
{
|
||||
// copy installer and required files to TEMP directory
|
||||
if (copyInstallerExecutable(tempPath))
|
||||
{
|
||||
QString tempFile = tempPath + "/" + QFileInfo(QApplication::applicationFilePath()).fileName();
|
||||
|
||||
// launch copy in TEMP directory with same arguments
|
||||
if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SComponents components;
|
||||
|
||||
// add all servers by default
|
||||
|
|
|
@ -38,12 +38,14 @@ struct SComponents
|
|||
SComponents()
|
||||
{
|
||||
installer = true;
|
||||
downloadedFiles = true;
|
||||
}
|
||||
|
||||
QStringList servers;
|
||||
QStringList profiles;
|
||||
|
||||
bool installer;
|
||||
bool downloadedFiles;
|
||||
};
|
||||
|
||||
enum OperationStep
|
||||
|
|
|
@ -243,11 +243,13 @@ void COperationDialog::updateAddRemoveComponents()
|
|||
// update components to remove
|
||||
m_removeComponents.profiles << profilesToDelete;
|
||||
m_removeComponents.installer = false;
|
||||
m_removeComponents.downloadedFiles = false;
|
||||
|
||||
// update components to add
|
||||
m_addComponents.profiles << profilesToAdd;
|
||||
m_addComponents.servers << serversToUpdate;
|
||||
m_addComponents.installer = false;
|
||||
m_addComponents.downloadedFiles = false;
|
||||
}
|
||||
|
||||
void COperationDialog::processUpdateProfilesNextStep()
|
||||
|
@ -351,6 +353,10 @@ void COperationDialog::processUninstallNextStep()
|
|||
{
|
||||
QtConcurrent::run(this, &COperationDialog::deleteComponentsProfiles);
|
||||
}
|
||||
else if (m_removeComponents.downloadedFiles)
|
||||
{
|
||||
QtConcurrent::run(this, &COperationDialog::deleteComponentsDownloadedFiles);
|
||||
}
|
||||
else if (m_removeComponents.installer)
|
||||
{
|
||||
QtConcurrent::run(this, &COperationDialog::deleteComponentsInstaller);
|
||||
|
@ -1154,6 +1160,43 @@ void COperationDialog::deleteComponentsInstaller()
|
|||
|
||||
// TODO:
|
||||
|
||||
// reset it once it's done
|
||||
m_removeComponents.installer = false;
|
||||
|
||||
emit onProgressSuccess(1);
|
||||
emit done();
|
||||
}
|
||||
|
||||
void COperationDialog::deleteComponentsDownloadedFiles()
|
||||
{
|
||||
m_currentOperation = tr("Delete downloaded files");
|
||||
m_currentOperationProgressFormat = tr("Deleting %1...");
|
||||
|
||||
CConfigFile *config = CConfigFile::getInstance();
|
||||
|
||||
QString path = config->getInstallationDirectory();
|
||||
|
||||
QDir dir(path);
|
||||
|
||||
QStringList filter;
|
||||
filter << "*.7z";
|
||||
filter << "*.bnp";
|
||||
filter << "*.zip";
|
||||
filter << "*.part";
|
||||
|
||||
QStringList files = dir.entryList(filter, QDir::Files);
|
||||
|
||||
foreach(const QString &file, files)
|
||||
{
|
||||
if (!QFile::remove(file))
|
||||
{
|
||||
qDebug() << "Unable to delete" << file;
|
||||
}
|
||||
}
|
||||
|
||||
// reset it once it's done
|
||||
m_removeComponents.downloadedFiles = false;
|
||||
|
||||
emit onProgressSuccess(1);
|
||||
emit done();
|
||||
}
|
||||
|
|
|
@ -116,8 +116,8 @@ protected:
|
|||
void addComponentsProfiles();
|
||||
void deleteComponentsProfiles();
|
||||
|
||||
void addComponentsInstaller();
|
||||
void deleteComponentsInstaller();
|
||||
void deleteComponentsDownloadedFiles();
|
||||
|
||||
void updateAddRemoveComponents();
|
||||
|
||||
|
|
|
@ -79,7 +79,14 @@ CUninstallDialog::CUninstallDialog(QWidget *parent):QDialog(parent), m_installer
|
|||
// installer
|
||||
m_installerIndex = model->rowCount();
|
||||
|
||||
item = new QStandardItem(tr("Ryzom Installer"));
|
||||
item = new QStandardItem(tr("Installer"));
|
||||
item->setCheckable(true);
|
||||
model->appendRow(item);
|
||||
|
||||
// downloaded files
|
||||
m_downloadedFilesIndex = model->rowCount();
|
||||
|
||||
item = new QStandardItem(tr("Downloaded Files"));
|
||||
item->setCheckable(true);
|
||||
model->appendRow(item);
|
||||
|
||||
|
@ -148,6 +155,10 @@ void CUninstallDialog::setSelectedComponents(const SComponents &components)
|
|||
// installer
|
||||
item = model->item(m_installerIndex);
|
||||
if (item) item->setCheckState(components.installer ? Qt::Checked : Qt::Unchecked);
|
||||
|
||||
// downloaded files
|
||||
item = model->item(m_downloadedFilesIndex);
|
||||
if (item) item->setCheckState(components.downloadedFiles ? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
|
||||
SComponents CUninstallDialog::getSelectedCompenents() const
|
||||
|
@ -187,6 +198,10 @@ SComponents CUninstallDialog::getSelectedCompenents() const
|
|||
item = model->item(m_installerIndex);
|
||||
res.installer = item && item->checkState() == Qt::Checked;
|
||||
|
||||
// downloaded files
|
||||
item = model->item(m_downloadedFilesIndex);
|
||||
res.downloadedFiles = item && item->checkState() == Qt::Checked;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ private:
|
|||
IDIndicesMap m_profilesIndices;
|
||||
|
||||
int m_installerIndex;
|
||||
int m_downloadedFilesIndex;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue